hlmod.hu

Magyar Half-Life Mód közösség!
Pontos idő: 2024.06.16. 06:18



Jelenlévő felhasználók

Jelenleg 428 felhasználó van jelen :: 1 regisztrált, 0 rejtett és 427 vendég

A legtöbb felhasználó (1565 fő) 2020.11.21. 11:26-kor tartózkodott itt.

Regisztrált felhasználók: Google [Bot] az elmúlt 5 percben aktív felhasználók alapján

Utoljára aktív
Ahhoz hogy lásd ki volt utoljára aktív, be kell jelentkezned.



Az oldal teljeskörű
használatához regisztrálj.

Regisztráció

Kereső


Új téma nyitása  Hozzászólás a témához  [ 4 hozzászólás ] 
Szerző Üzenet
 Hozzászólás témája: Surf pont rendszer
HozzászólásElküldve: 2013.04.15. 19:14 
Offline
Őskövület
Avatar

Csatlakozott: 2011.12.28. 00:35
Hozzászólások: 2736
Megköszönt másnak: 56 alkalommal
Megköszönték neki: 275 alkalommal
Hali.

Valaki ebbe bele tudná írni azt, hogy névre mentse a pontokat.
Mert amikor belépek ölök egy embert kilépek és megint nulla pont.
Mert úgy kéne, hogy el is mentse.

SMA Forráskód: [ Mindet kijelol ]
  1. // Includes
  2. // --- #include <xs> not needed!
  3. #define _xs_included
  4.  
  5. #include <amxmodx>
  6. #include <amxmisc>
  7. #include <hamsandwich>
  8. #include <fakemeta_util>
  9. #include <cstrike>
  10. #include <surf>
  11.  
  12. // Pragma
  13. #pragma semicolon 1
  14.  
  15. // Plugin info
  16. new const PLUGIN[] = "Surf Buy";
  17. new const VERSION[] = "1.0";
  18. new const AUTHOR[] = "Hattrick";
  19.  
  20. // Customization
  21. new const xPrefix[] = "!g[Surf Buy]";
  22. new const ConfigFile[] = "addons/amxmodx/configs/surf_buy.cfg";
  23.  
  24. // Unlimited clip offsets
  25. #if cellbits == 32
  26. const OFFSET_CLIPAMMO = 51;
  27. #else
  28. const OFFSET_CLIPAMMO = 65;
  29. #endif
  30. const OFFSET_LINUX_WEAPONS = 4;
  31.  
  32. // Maxclip const
  33. new const MAXCLIP[] = { -1, 13, -1, 10, 1, 7, -1, 30, 30, 1, 30, 20, 25, 30, 35, 25, 12, 20, 10, 30, 100, 8, 30, 30, 20, 2, 7, 30, 30, -1, 50 };
  34.  
  35. // Entities list
  36. new entlist[][] = { "func_button", "trigger_multiple", "trigger_once" };
  37.  
  38. // Cvars
  39. new cvar_health1_cost, cvar_speed_cost, cvar_gravity_cost, cvar_invisibility_cost, cvar_moneys_cost, cvar_damage_cost, cvar_noclip_cost, cvar_godmode_cost,
  40. cvar_health2_cost, cvar_unlimitedclip_cost, cvar_jail_cost, cvar_shotguns_cost,
  41. cvar_health1_cost2, cvar_speed_cost2, cvar_gravity_cost2, cvar_invisibility_cost2, cvar_moneys_cost2, cvar_damage_cost2, cvar_noclip_cost2, cvar_godmode_cost2,
  42. cvar_health2_cost2, cvar_unlimitedclip_cost2, cvar_jail_cost2, cvar_shotguns_cost2;
  43.  
  44. // Bools
  45. new bool:b_Speed[33], bool:b_Invisibility[33], bool:b_Damage[33], bool:b_Noclip[33], bool:b_Godmode[33],
  46. bool:b_Unlimitedclip[33], b_Spawns[33], g_GodmodeCount[33], g_NoclipCount[33], bool:b_Gravity[33], bool:b_Shotguns[33];
  47.  
  48. // Init
  49. public plugin_init()
  50. {
  51. // Register the plugin
  52. register_plugin(PLUGIN, VERSION, AUTHOR);
  53.  
  54. // Register the plugin dictionary
  55. register_dictionary("surf_buy.txt");
  56.  
  57. // Register the plugins events
  58. register_event("CurWeapon", "event_CurWeapon", "be", "1=1");
  59.  
  60. // Client commands
  61. register_clcmd("say /menu", "command_Buy");
  62. register_clcmd("say menu", "command_Buy");
  63. register_clcmd("say /shop", "command_Buy");
  64. register_clcmd("say shop", "command_Buy");
  65.  
  66. // Menu commands
  67. register_menucmd(register_menuid("aaaxMenu1"), 1023, "BuyMenu");
  68. register_menucmd(register_menuid("bbbxMenu2"), 1023, "BuyMenu2");
  69.  
  70. // Messages
  71. register_message(get_user_msgid("CurWeapon"), "message_cur_weapon");
  72.  
  73. // Plugin cvars
  74. cvar_health1_cost = register_cvar("surf_health1_cost", "3");
  75. cvar_speed_cost = register_cvar("surf_speed_cost", "3");
  76. cvar_gravity_cost = register_cvar("surf_gravity_cost", "3");
  77. cvar_invisibility_cost = register_cvar("surf_invisibility_cost", "4");
  78. cvar_moneys_cost = register_cvar("surf_moneys_cost", "4");
  79. cvar_damage_cost = register_cvar("surf_damage_cost", "5");
  80. cvar_noclip_cost = register_cvar("surf_noclip_cost", "7");
  81. cvar_godmode_cost = register_cvar("surf_godmode_cost", "7");
  82. cvar_health2_cost = register_cvar("surf_health2_cost", "8");
  83. cvar_unlimitedclip_cost = register_cvar("surf_unlimitedclip_cost", "8");
  84. cvar_jail_cost = register_cvar("surf_jail_cost", "3");
  85. cvar_shotguns_cost = register_cvar("surf_shotguns_cost", "8");
  86. cvar_health1_cost2 = register_cvar("surf_health1_cost2", "1500");
  87. cvar_speed_cost2 = register_cvar("surf_speed_cost2", "1750");
  88. cvar_gravity_cost2 = register_cvar("surf_gravity_cost2", "1500");
  89. cvar_invisibility_cost2 = register_cvar("surf_invisibility_cost2", "2000");
  90. cvar_moneys_cost2 = register_cvar("surf_moneys_cost2", "10000");
  91. cvar_damage_cost2 = register_cvar("surf_damage_cost2", "8000");
  92. cvar_noclip_cost2 = register_cvar("surf_noclip_cost2", "12000");
  93. cvar_godmode_cost2 = register_cvar("surf_godmode_cost2", "12000");
  94. cvar_health2_cost2 = register_cvar("surf_health2_cost2", "14500");
  95. cvar_unlimitedclip_cost2 = register_cvar("surf_unlimitedclip_cost2", "14500");
  96. cvar_jail_cost2 = register_cvar("surf_jail_cost2", "3750");
  97. cvar_shotguns_cost2 = register_cvar("surf_shotguns_cost2", "15000");
  98.  
  99. // Forwards
  100. RegisterHam(Ham_Spawn, "player", "ham_PlayerSpawned_Post", 1);
  101. RegisterHam(Ham_TakeDamage, "player", "ham_TakeDamage");
  102. }
  103.  
  104. // Public plugin config
  105. public plugin_cfg()
  106. {
  107. new x[128];
  108. format(x, 127, "exec %s", ConfigFile);
  109. server_cmd(x);
  110. server_exec();
  111. }
  112.  
  113. // Menu format
  114. public command_Buy(id)
  115. {
  116. // Make menu (2024 max characters)
  117. new menuBody[2025];
  118. add(menuBody, 2024, "\rJust_ *Surf Vasarlas menu 1. Oldal \d[\yCfg: Danii\d]^n^n");
  119. add(menuBody, 2024, "\w1.\y Elet \d[\r+255 HP\d] \wAra: 4 pont vagy 2000$^n");
  120. add(menuBody, 2024, "\w2.\y Gyorsasag \d[\r350 gyorsasasg\d] \wAra: 4 pont vagy 2500$^n");
  121. add(menuBody, 2024, "\w3.\y Gravitacio \d[\r500 Gravitacio\d] \wAra: 4 pont vagy 2500$^n");
  122. add(menuBody, 2024, "\w4.\y Lathatatlansag \d[\r100% lathatatlansag\d] \wAra: 4 pont vagy 3000$^n");
  123. add(menuBody, 2024, "\w5.\y Penz \d[\r+12500$\d] \wAra: 5 pont vagy 10000$^n");
  124. add(menuBody, 2024, "\w6.\y Sebzes \d[\r2x DMG\d] \wAra: 6 pont vagy 8000$^n");
  125. add(menuBody, 2024, "\w7.\y Noclip \d[\r20 masodperc\d] \wAra: 12 pont vagy 13000$^n");
  126. add(menuBody, 2024, "\w8.\y Isten mod \d[\r20 masodperc\d] \wAra: 10 pont vagy 12500$^n^n");
  127. add(menuBody, 2024, "\w9.\y Kovetkezo^n^n");
  128. add(menuBody, 2024, "\w0.\y Kilepes^n");
  129.  
  130. // Show menu to player
  131. show_menu(id, (1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7 | 1<<8 | 1<<9), menuBody, -1, "aaaxMenu1");
  132. }
  133.  
  134. // Menu2 format
  135. public command_Buy2(id)
  136. {
  137. // Make menu (2024 max characters)
  138. new menuBody[2025];
  139. add(menuBody, 2024, "\rJust_ *Surf Vasarlas menu 2. oldal \d[\yCfg: Danii\d]^n^n");
  140. add(menuBody, 2024, "\w1.\y Elet \d[\r+1000 HP\d] \wAra: 10 pont vagy 14500$^n");
  141. add(menuBody, 2024, "\w2.\y Unlimited Clip \d[\rVegtelen loszer\d] \wAra: 10 pont vagy 14500$^n");
  142. add(menuBody, 2024, "\w3.\y Jail kinyitas \wAra: 2 pont vagy 2250$^n");
  143. add(menuBody, 2024, "\w4.\y ShotGuns \d[\rM3 \d& \rXM1014\d] \wAra: 14 pont vagy 15000$^n^n");
  144. add(menuBody, 2024, "\w9.\y Vissza^n^n");
  145. add(menuBody, 2024, "\w0.\y Kilepes^n");
  146.  
  147. // Show menu to player
  148. show_menu(id, (1<<0 | 1<<1 | 1<<2 | 1<<3 | 1<<4 | 1<<5 | 1<<6 | 1<<7 | 1<<8 | 1<<9), menuBody, -1, "bbbxMenu2");
  149. }
  150.  
  151. // Buy menu
  152. public BuyMenu(id, key)
  153. {
  154. // Get the user name
  155. new name[32];
  156. get_user_name(id, name, 31);
  157.  
  158. // Switch the player key
  159. switch(key)
  160. {
  161. // Health +255
  162. case 0:
  163. {
  164. // Has enough points?
  165. if (surf_get_user_points(id) >= get_pcvar_num(cvar_health1_cost))
  166. {
  167. fm_set_user_health(id, get_user_health(id) + 255);
  168. surf_del_user_points(id, get_pcvar_num(cvar_health1_cost));
  169. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "+255 HP");
  170. }
  171. // Not has enough points, has enough moneys?
  172. else if (cs_get_user_money(id) >= get_pcvar_num(cvar_health1_cost2))
  173. {
  174. fm_set_user_health(id, get_user_health(id) + 255);
  175. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_health1_cost2));
  176. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "+255 HP");
  177. }
  178. // Not has points, not has moneys... I'm sorry...
  179. else
  180. {
  181. write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_health1_cost), get_pcvar_num(cvar_health1_cost2));
  182. }
  183. }
  184. // 300 Speed
  185. case 1:
  186. {
  187. // Has enough points?
  188. if (surf_get_user_points(id) >= get_pcvar_num(cvar_speed_cost))
  189. {
  190. b_Speed[id] = true;
  191. surf_del_user_points(id, get_pcvar_num(cvar_speed_cost));
  192. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "300 Speed");
  193. }
  194. // Not has enough points, has enough moneys?
  195. else if (cs_get_user_money(id) >= get_pcvar_num(cvar_speed_cost2))
  196. {
  197. b_Speed[id] = true;
  198. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_speed_cost2));
  199. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "300 Speed");
  200. }
  201. // Not has points, not has moneys... I'm sorry...
  202. else
  203. {
  204. write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_speed_cost), get_pcvar_num(cvar_speed_cost2));
  205. }
  206. }
  207. // 500 Gravity
  208. case 2:
  209. {
  210. // Has enough points?
  211. if (surf_get_user_points(id) >= get_pcvar_num(cvar_gravity_cost))
  212. {
  213. b_Gravity[id] = true;
  214. fm_set_user_gravity(id, 0.7);
  215. surf_del_user_points(id, get_pcvar_num(cvar_gravity_cost));
  216. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "500 Gravity");
  217. }
  218. // Not has enough points, has enough moneys?
  219. else if (cs_get_user_money(id) >= get_pcvar_num(cvar_gravity_cost2))
  220. {
  221. b_Gravity[id] = true;
  222. fm_set_user_gravity(id, 0.7);
  223. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_gravity_cost2));
  224. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "500 Gravity");
  225. }
  226. // Not has points, not has moneys... I'm sorry...
  227. else
  228. {
  229. write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_gravity_cost), get_pcvar_num(cvar_gravity_cost2));
  230. }
  231. }
  232. // 100% Invisibility
  233. case 3:
  234. {
  235. // Has enough points?
  236. if (surf_get_user_points(id) >= get_pcvar_num(cvar_invisibility_cost))
  237. {
  238. b_Invisibility[id] = true;
  239. fm_set_user_rendering(id, kRenderFxHologram, 0, 0, 0, kRenderTransAlpha, 250);
  240. surf_del_user_points(id, get_pcvar_num(cvar_invisibility_cost));
  241. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "100% Invisible");
  242. }
  243. // Not has enough points, has enough moneys?
  244. else if (cs_get_user_money(id) >= get_pcvar_num(cvar_invisibility_cost2))
  245. {
  246. b_Invisibility[id] = true;
  247. fm_set_user_rendering(id, kRenderFxHologram, 0, 0, 0, kRenderTransAlpha, 250);
  248. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_invisibility_cost2));
  249. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "100% Invisible");
  250. }
  251. // Not has points, not has moneys... I'm sorry...
  252. else
  253. {
  254. write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_invisibility_cost), get_pcvar_num(cvar_invisibility_cost2));
  255. }
  256. }
  257. // 12500$ Moneys
  258. case 4:
  259. {
  260. // Has enough points?
  261. if (surf_get_user_points(id) >= get_pcvar_num(cvar_moneys_cost))
  262. {
  263. cs_set_user_money(id, cs_get_user_money(id) + 12500);
  264. surf_del_user_points(id, get_pcvar_num(cvar_moneys_cost));
  265. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "12500$ Moneys");
  266. }
  267. // Not has enough points, has enough moneys?
  268. else if (cs_get_user_money(id) >= get_pcvar_num(cvar_moneys_cost2))
  269. {
  270. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_moneys_cost2));
  271. cs_set_user_money(id, cs_get_user_money(id) + 12500);
  272. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "12500$ Moneys");
  273. }
  274. // Not has points, not has moneys... I'm sorry...
  275. else
  276. {
  277. write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_moneys_cost), get_pcvar_num(cvar_moneys_cost2));
  278. }
  279. }
  280. // 2x Damage
  281. case 5:
  282. {
  283. // Has enough points?
  284. if (surf_get_user_points(id) >= get_pcvar_num(cvar_damage_cost))
  285. {
  286. b_Damage[id] = true;
  287. surf_del_user_points(id, get_pcvar_num(cvar_damage_cost));
  288. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "2x Damage");
  289. }
  290. // Not has enough points, has enough moneys?
  291. else if (cs_get_user_money(id) >= get_pcvar_num(cvar_damage_cost2))
  292. {
  293. b_Damage[id] = true;
  294. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_damage_cost2));
  295. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "2x Damage");
  296. }
  297. // Not has points, not has moneys... I'm sorry...
  298. else
  299. {
  300. write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_damage_cost), get_pcvar_num(cvar_damage_cost2));
  301. }
  302. }
  303. // Noclip 20 seconds
  304. case 6:
  305. {
  306. // Has enough points?
  307. if (surf_get_user_points(id) >= get_pcvar_num(cvar_noclip_cost))
  308. {
  309. b_Noclip[id] = true;
  310. g_NoclipCount[id] = 19;
  311. fm_set_user_noclip(id, 1);
  312. surf_del_user_points(id, get_pcvar_num(cvar_noclip_cost));
  313. set_task(20.0, "task_RemoveNoclip", id);
  314. set_task(1.0, "task_NoclipCountDown", id, _, _, "a", 19);
  315. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "Noclip");
  316. }
  317. // Not has enough points, has enough moneys?
  318. else if (cs_get_user_money(id) >= get_pcvar_num(cvar_noclip_cost2))
  319. {
  320. b_Noclip[id] = true;
  321. g_NoclipCount[id] = 19;
  322. fm_set_user_noclip(id, 1);
  323. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_noclip_cost2));
  324. set_task(20.0, "task_RemoveNoclip", id);
  325. set_task(1.0, "task_NoclipCountDown", id, _, _, "a", 19);
  326. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "Noclip");
  327. }
  328. // Not has points, not has moneys... I'm sorry...
  329. else
  330. {
  331. write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_noclip_cost), get_pcvar_num(cvar_noclip_cost2));
  332. }
  333. }
  334. // Godmode 20 seconds
  335. case 7:
  336. {
  337. // Has enough points?
  338. if (surf_get_user_points(id) >= get_pcvar_num(cvar_godmode_cost))
  339. {
  340. b_Godmode[id] = true;
  341. g_GodmodeCount[id] = 19;
  342. fm_set_user_godmode(id, 1);
  343. surf_del_user_points(id, get_pcvar_num(cvar_godmode_cost));
  344. set_task(20.0, "task_RemoveGodmode", id);
  345. set_task(1.0, "task_GodmodeCountDown", id, _, _, "a", 19);
  346. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "Godmode");
  347. }
  348. // Not has enough points, has enough moneys?
  349. else if (cs_get_user_money(id) >= get_pcvar_num(cvar_godmode_cost2))
  350. {
  351. b_Godmode[id] = true;
  352. g_GodmodeCount[id] = 19;
  353. fm_set_user_godmode(id, 1);
  354. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_godmode_cost2));
  355. set_task(20.0, "task_RemoveGodmode", id);
  356. set_task(1.0, "task_GodmodeCountDown", id, _, _, "a", 19);
  357. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "Godmode");
  358. }
  359. // Not has points, not has moneys... I'm sorry...
  360. else
  361. {
  362. write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_godmode_cost), get_pcvar_num(cvar_godmode_cost2));
  363. }
  364. }
  365. case 8:
  366. {
  367. command_Buy2(id);
  368. }
  369. default:
  370. {
  371. return PLUGIN_CONTINUE;
  372. }
  373. }
  374. return PLUGIN_CONTINUE;
  375. }
  376.  
  377. // Buy menu2
  378. public BuyMenu2(id, key)
  379. {
  380. // Get the user name
  381. new name[32];
  382. get_user_name(id, name, 31);
  383.  
  384. // Switch the player key
  385. switch(key)
  386. {
  387. // Health +1000
  388. case 0:
  389. {
  390. // Has enough points?
  391. if (surf_get_user_points(id) >= get_pcvar_num(cvar_health2_cost))
  392. {
  393. fm_set_user_health(id, get_user_health(id) + 1000);
  394. surf_del_user_points(id, get_pcvar_num(cvar_health2_cost));
  395. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "+1000 HP");
  396. }
  397. // Not has enough points, has enough moneys?
  398. else if (cs_get_user_money(id) >= get_pcvar_num(cvar_health2_cost2))
  399. {
  400. fm_set_user_health(id, get_user_health(id) + 1000);
  401. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_health2_cost2));
  402. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "+1000 HP");
  403. }
  404. // Not has points, not has moneys... I'm sorry...
  405. else
  406. {
  407. write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_health2_cost), get_pcvar_num(cvar_health2_cost2));
  408. }
  409. }
  410. // Unlimited Clip
  411. case 1:
  412. {
  413. // Has enough points?
  414. if (surf_get_user_points(id) >= get_pcvar_num(cvar_unlimitedclip_cost))
  415. {
  416. b_Unlimitedclip[id] = true;
  417. surf_del_user_points(id, get_pcvar_num(cvar_unlimitedclip_cost));
  418. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "Unlimited Clip");
  419. }
  420. // Not has enough points, has enough moneys?
  421. else if (cs_get_user_money(id) >= get_pcvar_num(cvar_unlimitedclip_cost2))
  422. {
  423. b_Unlimitedclip[id] = true;
  424. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_unlimitedclip_cost2));
  425. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "Unlimited Clip");
  426. }
  427. // Not has points, not has moneys... I'm sorry...
  428. else
  429. {
  430. write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_unlimitedclip_cost), get_pcvar_num(cvar_unlimitedclip_cost2));
  431. }
  432. }
  433. // Jail open
  434. case 2:
  435. {
  436. // Has enough points?
  437. if (surf_get_user_points(id) >= get_pcvar_num(cvar_jail_cost))
  438. {
  439. open_jail(id);
  440. surf_del_user_points(id, get_pcvar_num(cvar_jail_cost));
  441. }
  442. // Not has enough points, has enough moneys?
  443. else if (cs_get_user_money(id) >= get_pcvar_num(cvar_jail_cost2))
  444. {
  445. open_jail(id);
  446. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_jail_cost2));
  447. }
  448. // Not has points, not has moneys... I'm sorry...
  449. else
  450. {
  451. write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_jail_cost), get_pcvar_num(cvar_jail_cost2));
  452. }
  453. }
  454. // ShotGuns
  455. case 3:
  456. {
  457. // Has enough points?
  458. if (surf_get_user_points(id) >= get_pcvar_num(cvar_shotguns_cost))
  459. {
  460. b_Shotguns[id] = true;
  461. fm_give_item(id, "weapon_m3");
  462. fm_give_item(id, "weapon_xm1014");
  463. cs_set_user_bpammo(id, CSW_M3, 999);
  464. cs_set_user_bpammo(id, CSW_XM1014, 999);
  465. surf_del_user_points(id, get_pcvar_num(cvar_shotguns_cost));
  466. }
  467. // Not has enough points, has enough moneys?
  468. else if (cs_get_user_money(id) >= get_pcvar_num(cvar_shotguns_cost2))
  469. {
  470. b_Shotguns[id] = true;
  471. fm_give_item(id, "weapon_m3");
  472. fm_give_item(id, "weapon_xm1014");
  473. cs_set_user_bpammo(id, CSW_M3, 999);
  474. cs_set_user_bpammo(id, CSW_XM1014, 999);
  475. cs_set_user_money(id, cs_get_user_money(id) - get_pcvar_num(cvar_shotguns_cost2));
  476. }
  477. // Not has points, not has moneys... I'm sorry...
  478. else
  479. {
  480. write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NO_ENOUGH_MONEY", get_pcvar_num(cvar_shotguns_cost), get_pcvar_num(cvar_shotguns_cost2));
  481. }
  482. }
  483. case 8:
  484. {
  485. command_Buy(id);
  486. }
  487. default:
  488. {
  489. return PLUGIN_CONTINUE;
  490. }
  491. }
  492. return PLUGIN_CONTINUE;
  493. }
  494.  
  495. // Current Weapon event
  496. public event_CurWeapon(id)
  497. {
  498. if (b_Speed[id])
  499. {
  500. fm_set_user_maxspeed(id, 350.0);
  501. }
  502. }
  503.  
  504. // When client is spawned
  505. public ham_PlayerSpawned_Post(id)
  506. {
  507. b_Spawns[id]++;
  508. if (b_Speed[id])
  509. {
  510. b_Speed[id] = false;
  511. }
  512. if (b_Invisibility[id])
  513. {
  514. b_Invisibility[id] = false;
  515. fm_set_user_rendering(id, kRenderFxNone, 0, 0, 0, kRenderTransAlpha, 255);
  516. }
  517. if (b_Gravity[id])
  518. {
  519. b_Gravity[id] = false;
  520. fm_set_user_gravity(id, 1.0);
  521. }
  522. if (b_Damage[id])
  523. {
  524. b_Damage[id] = false;
  525. }
  526. if (b_Noclip[id])
  527. {
  528. b_Noclip[id] = false;
  529. fm_set_user_noclip(id, 0);
  530. }
  531. if (b_Godmode[id])
  532. {
  533. b_Godmode[id] = false;
  534. fm_set_user_godmode(id, 0);
  535. }
  536. if (b_Spawns[id] == 3)
  537. {
  538. command_Buy(id);
  539. write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_BEGGIN_INFO");
  540. write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_BEGGIN_INFO");
  541. }
  542. if (b_Unlimitedclip[id])
  543. {
  544. b_Unlimitedclip[id] = false;
  545. }
  546. if (g_GodmodeCount[id])
  547. {
  548. g_GodmodeCount[id] = 0;
  549. }
  550. if (g_NoclipCount[id])
  551. {
  552. g_NoclipCount[id] = 0;
  553. }
  554. if (b_Shotguns[id])
  555. {
  556. b_Shotguns[id] = false;
  557. fm_give_item(id, "weapon_m3");
  558. fm_give_item(id, "weapon_xm1014");
  559. cs_set_user_bpammo(id, CSW_M3, 999);
  560. cs_set_user_bpammo(id, CSW_XM1014, 999);
  561. }
  562. }
  563.  
  564. // Damage multiplier
  565. public ham_TakeDamage(victim, inflictor, attacker, Float:damage)
  566. {
  567. if (victim == attacker || !is_user_connected(attacker))
  568. {
  569. return HAM_IGNORED;
  570. }
  571. if (b_Damage[attacker])
  572. {
  573. damage *= 2.0;
  574. SetHamParamFloat(4, damage);
  575. }
  576. return HAM_IGNORED;
  577. }
  578.  
  579. // When client joining
  580. public client_putinserver(id)
  581. {
  582. set_task(25.0, "task_Announce", id);
  583. }
  584.  
  585. // When client disconnect
  586. public client_disconnect(id)
  587. {
  588. if (b_Speed[id])
  589. {
  590. b_Speed[id] = false;
  591. }
  592. if (b_Invisibility[id])
  593. {
  594. b_Invisibility[id] = false;
  595. }
  596. if (b_Gravity[id])
  597. {
  598. b_Gravity[id] = false;
  599. }
  600. if (b_Damage[id])
  601. {
  602. b_Damage[id] = false;
  603. }
  604. if (b_Noclip[id])
  605. {
  606. b_Noclip[id] = false;
  607. }
  608. if (b_Godmode[id])
  609. {
  610. b_Godmode[id] = false;
  611. }
  612. if (b_Spawns[id])
  613. {
  614. b_Spawns[id] = 0;
  615. }
  616. if (b_Unlimitedclip[id])
  617. {
  618. b_Unlimitedclip[id] = false;
  619. }
  620. if (g_GodmodeCount[id])
  621. {
  622. g_GodmodeCount[id] = 0;
  623. }
  624. if (g_NoclipCount[id])
  625. {
  626. g_NoclipCount[id] = 0;
  627. }
  628. if (b_Shotguns[id])
  629. {
  630. b_Shotguns[id] = false;
  631. }
  632. }
  633.  
  634. // Remove Noclip task
  635. public task_RemoveNoclip(id)
  636. {
  637. if (!is_user_connected(id))
  638. {
  639. return;
  640. }
  641. if (fm_get_user_noclip(id))
  642. {
  643. b_Noclip[id] = false;
  644. fm_set_user_noclip(id, 0);
  645. new Float:origin[3], hulltype;
  646. pev(id, pev_origin, origin);
  647. hulltype = (pev(id, pev_flags) & FL_DUCKING) ? HULL_HEAD : HULL_HUMAN;
  648. if (!hattrick_hull_vacant(id, origin, hulltype))
  649. {
  650. user_kill(id);
  651. write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NOCLIP_DIED");
  652. }
  653. if (is_user_alive(id))
  654. {
  655. write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_NOCLIP_REMOVED");
  656. }
  657. }
  658. }
  659.  
  660. // Remove Godmode task
  661. public task_RemoveGodmode(id)
  662. {
  663. if (!is_user_connected(id))
  664. {
  665. return;
  666. }
  667. if (fm_get_user_godmode(id))
  668. {
  669. b_Godmode[id] = false;
  670. fm_set_user_godmode(id, 0);
  671. write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_GODMODE_REMOVED");
  672. }
  673. }
  674.  
  675. // Announce the player
  676. public task_Announce(id)
  677. {
  678. if (is_user_connected(id))
  679. {
  680. write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_WELCOME");
  681. }
  682. }
  683.  
  684. // Countdown player noclip
  685. public task_NoclipCountDown(id)
  686. {
  687. if (!is_user_connected(id) || !is_user_alive(id))
  688. {
  689. return;
  690. }
  691. g_NoclipCount[id]--;
  692. set_hudmessage(0, 255, 0, 0.35, 0.8, _, _, 7.0);
  693. show_hudmessage(id, "%L", LANG_PLAYER, "SURF_YOU_HAVE", "noclip", g_NoclipCount[id]);
  694. }
  695.  
  696. // Countdown player godmode
  697. public task_GodmodeCountDown(id)
  698. {
  699. if (!is_user_connected(id) || !is_user_alive(id))
  700. {
  701. return;
  702. }
  703. g_GodmodeCount[id]--;
  704. set_hudmessage(0, 255, 0, 0.35, 0.8, _, _, 7.0);
  705. show_hudmessage(id, "%L", LANG_PLAYER, "SURF_YOU_HAVE", "godmode", g_GodmodeCount[id]);
  706. }
  707.  
  708. // Write colored function
  709. public write_colored(const id, const string[], {Float, Sql, Resul,_}:...)
  710. {
  711. new msg[191], players[32], count = 1;
  712. vformat(msg, 190, string, 3);
  713. replace_all(msg, 190, "!n", "^1");
  714. replace_all(msg, 190, "!t", "^3");
  715. replace_all(msg, 190, "!g", "^4");
  716. if (id) players[0] = id;
  717. else get_players(players, count, "ch");
  718. for (new i = 0; i < count; i++)
  719. {
  720. if (is_user_connected(players[i]))
  721. {
  722. message_begin(MSG_ONE_UNRELIABLE, get_user_msgid("SayText"), _, players[i]);
  723. write_byte(players[i]);
  724. write_string(msg);
  725. message_end();
  726. }
  727. }
  728. }
  729.  
  730. // Is hull vacant stock (credits ==> VEN)
  731. stock bool:hattrick_hull_vacant(id, const Float:origin[3], hullType = HULL_HEAD, &hitent = 0)
  732. {
  733. engfunc(EngFunc_TraceHull, origin, origin, 0, hullType, id, 0);
  734. hitent = get_tr2(0, TraceResult:TR_pHit);
  735. if (!get_tr2(0, TraceResult:TR_StartSolid) && !get_tr2(0, TraceResult:TR_AllSolid) && get_tr2(0, TraceResult:TR_InOpen))
  736. {
  737. return true;
  738. }
  739. return false;
  740. }
  741.  
  742. // Unlimited clip stuff
  743. public message_cur_weapon(msg_id, msg_dest, msg_entity)
  744. {
  745. if (!b_Unlimitedclip[msg_entity])
  746. {
  747. return;
  748. }
  749. if (!is_user_alive(msg_entity) || get_msg_arg_int(1) != 1)
  750. {
  751. return;
  752. }
  753. static weapon, clip;
  754. weapon = get_msg_arg_int(2);
  755. clip = get_msg_arg_int(3);
  756. if (MAXCLIP[weapon] > 2)
  757. {
  758. set_msg_arg_int(3, get_msg_argtype(3), MAXCLIP[weapon]);
  759. if (clip < 2)
  760. {
  761. static wname[32], weapon_ent;
  762. get_weaponname(weapon, wname, 31);
  763. weapon_ent = fm_find_ent_by_owner(-1, wname, msg_entity);
  764. fm_set_weapon_ammo(weapon_ent, MAXCLIP[weapon]);
  765. }
  766. }
  767. }
  768.  
  769. stock fm_set_weapon_ammo(entity, amount)
  770. {
  771. set_pdata_int(entity, OFFSET_CLIPAMMO, amount, OFFSET_LINUX_WEAPONS);
  772. }
  773.  
  774. // Open jail function
  775. public open_jail(id)
  776. {
  777. // Get the user name
  778. new name[32];
  779. get_user_name(id, name, 31);
  780.  
  781. new ent, target[32], ent2;
  782. for (new i = 0; i < sizeof entlist; i++)
  783. {
  784. ent = 0;
  785. ent2 = 0;
  786. while((ent = engfunc(EngFunc_FindEntityByString, ent, "classname", entlist[i])))
  787. {
  788. if (pev_valid(ent))
  789. {
  790. pev(ent, pev_target, target, 31);
  791. while((ent2 = engfunc(EngFunc_FindEntityByString, ent2, "targetname", target)))
  792. {
  793. dllfunc(DLLFunc_Use, ent2, id);
  794. write_colored(0, "%s %L", xPrefix, LANG_PLAYER, "SURF_CHAT_INFO_X", name, "Jail Opener");
  795. return PLUGIN_HANDLED;
  796. }
  797. }
  798. }
  799. }
  800. write_colored(id, "%s %L", xPrefix, LANG_PLAYER, "SURF_CANT_FIND");
  801. return PLUGIN_HANDLED;
  802. }

_________________
****


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Surf pont rendszer
HozzászólásElküldve: 2013.04.16. 19:40 
Offline
Veterán
Avatar

Csatlakozott: 2013.03.26. 20:20
Hozzászólások: 1846
Megköszönt másnak: 27 alkalommal
Megköszönték neki: 120 alkalommal
elküldöd a surf.inc fájlt?

_________________
Projektem:

[CSO2] Ghost Mod
CSO2 GamePlay video: https://www.youtube.com/watch?feature=p ... iOS4Ik1Yrk


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Surf pont rendszer
HozzászólásElküldve: 2013.04.16. 20:56 
Offline
Őskövület
Avatar

Csatlakozott: 2011.12.28. 00:35
Hozzászólások: 2736
Megköszönt másnak: 56 alkalommal
Megköszönték neki: 275 alkalommal
RaZzoR írta:
elküldöd a surf.inc fájlt?


Köszi.
Már nem kell.
Most lettem kész vele, és működik.

Inkább ebbe segíts kérlek:

Csak pontokért.

_________________
****


Hozzászólás jelentése
Vissza a tetejére
   
 Hozzászólás témája: Re: Surf pont rendszer
HozzászólásElküldve: 2013.04.17. 19:08 
Offline
Veterán
Avatar

Csatlakozott: 2013.03.26. 20:20
Hozzászólások: 1846
Megköszönt másnak: 27 alkalommal
Megköszönték neki: 120 alkalommal
Okok :D

_________________
Projektem:

[CSO2] Ghost Mod
CSO2 GamePlay video: https://www.youtube.com/watch?feature=p ... iOS4Ik1Yrk


Hozzászólás jelentése
Vissza a tetejére
   
Hozzászólások megjelenítése:  Rendezés  
Új téma nyitása  Hozzászólás a témához  [ 4 hozzászólás ] 


Ki van itt

Jelenlévő fórumozók: nincs regisztrált felhasználó valamint 140 vendég


Nyithatsz új témákat ebben a fórumban.
Válaszolhatsz egy témára ebben a fórumban.
Nem szerkesztheted a hozzászólásaidat ebben a fórumban.
Nem törölheted a hozzászólásaidat ebben a fórumban.
Nem küldhetsz csatolmányokat ebben a fórumban.

Keresés:
Ugrás:  
Powered by phpBB® Forum Software © phpBB Limited
Magyar fordítás © Magyar phpBB Közösség
Portal: Kiss Portal Extension © Michael O'Toole