Guest User

Untitled

a guest
Jan 19th, 2019
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 34.46 KB | None | 0 0
  1. /*
  2.  
  3. =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
  4. .::Usefull Role-Play commands FILTERSCRIPT!::.
  5. .::Mask, 24/7 store, advertisements, weapon selling system, PD commands::.
  6.  
  7. .::Made by Dizzle, all rights reserved 2012(c)::.
  8. =+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=+=
  9.  
  10. */
  11.  
  12. //=============================================START OF DEFINES/SCRIPT=========================================================================
  13. // This is a comment
  14. // uncomment the line below if you want to write a filterscript
  15. #define FILTERSCRIPT
  16. #include <a_samp>
  17. #include <zcmd>
  18. #include <foreach>
  19. #include <sscanf2>
  20. #define COLOR_ERROR 0xFF0000AA
  21. #define COLOR_PM 0xFF0000AA
  22. #define green 0x33FF33AA
  23. #define yellow 0xFFFF00AA
  24. #define COLOR_FADE1 0xC2A2DAAA
  25. #define COLOR_FADE2 0xFFFFFFAA
  26. #define COLOR_FADE3 0xAAAAAAAA
  27. #define COLOR_FADE4 0x8C8C8C8C
  28. #define COLOR_FADE5 0x6E6E6E6E
  29. #define color_GREEN 0x9FFF00FF
  30. #define LIGHTGREEN 0x38FF06FF
  31. #define LIGHTBLUE2 0xF6BB0AA
  32. #define LIGHTBLUE 0x0BBF6AA
  33. #define COLOR_PINK 0xFF66FFAA
  34. #define COLOR_BLUE 0x0000BBAA
  35. #define COLOR_PURPLE 0x800080AA
  36. #define COLOR_GOVERNMENT 0x8A2BE2AA
  37. #define COLOR_WHITE 0xFFFFFFFF
  38. #define COLOR_GREY 0xAFAFAFFF
  39. #define COLOR_RED 0xFF0000AA
  40. #define COLOR_YELLOW 0xFFFF00FF
  41. #define COLOR_PDBLUE 0x2641FEAA
  42. #define COLOR_ORANGE 0xFF9900AA
  43. #define TYPE_NORMAL (0)
  44. new HasBoughtMask[MAX_PLAYERS];
  45. new HasBoughtCigar[MAX_PLAYERS];
  46. new HasBoughtBeer[MAX_PLAYERS];
  47. new bool:maskonface[MAX_PLAYERS] = false;
  48. new TogPM[MAX_PLAYERS];
  49. new AdvTimer1;
  50.  
  51. #pragma tabsize 0
  52. #if defined FILTERSCRIPT
  53.  
  54. //========================END OF DEFINES=========START OF COMMANDS==================================================================
  55.  
  56. CMD:cigar(playerid, params[])
  57. {
  58. if(HasBoughtCigar[playerid] == 1)
  59. SetPlayerSpecialAction(playerid, SPECIAL_ACTION_SMOKE_CIGGY);
  60. else if(HasBoughtCigar[playerid] == 0)
  61. SendClientMessage(playerid, COLOR_RED, "You dont have any cigars, head to the 24/7 to buy some !");
  62. return 1;
  63. }
  64.  
  65. CMD:beer(playerid, params[])
  66. {
  67. if(HasBoughtBeer[playerid] == 1)
  68. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER );
  69. else if(HasBoughtBeer[playerid] == 0)
  70. SendClientMessage(playerid, COLOR_RED, "You dont have beer, head to the 24/7 to buy one !");
  71. return 1;
  72. }
  73.  
  74. CMD:maskon(playerid, params[])
  75. {
  76. if(maskonface[playerid] == true) return SendClientMessage(playerid,COLOR_RED,"You are already masked!");
  77. if(IsPlayerConnected(playerid))
  78. if(HasBoughtMask[playerid] == 1)
  79. {
  80. SendClientMessage(playerid, COLOR_FADE2,"You have put a mask on your face!");
  81. for(new i = 0; i < MAX_PLAYERS; i++)
  82. {
  83. maskonface[playerid] = true;
  84. ApplyAnimation(playerid, "SHOP", "ROB_Shifty", 4.0, 0, 0, 0, 0, 0);
  85. ShowPlayerNameTagForPlayer(i, playerid, false);
  86. }
  87. }
  88. else if(HasBoughtMask[playerid] == 0)
  89. SendClientMessage(playerid, COLOR_RED, "You dont have a mask, head to the 24/7 to buy one !");
  90. return 1;
  91. }
  92.  
  93. CMD:maskoff(playerid, params[])
  94. {
  95. if(maskonface[playerid] == false) return SendClientMessage(playerid,COLOR_RED,"You are not masked!");
  96. if(IsPlayerConnected(playerid))
  97. {
  98. for(new i = 0; i < MAX_PLAYERS; i++)
  99. {
  100. if(IsPlayerConnected(i))
  101. {
  102. maskonface[playerid] = false;
  103. ApplyAnimation(playerid, "MISC", "plyr_shkhead", 4.0, 0, 0, 0, 0, 0);
  104. ShowPlayerNameTagForPlayer(i, playerid, true);
  105. }
  106. }
  107. SendClientMessage(playerid, COLOR_FADE2, "You took the mask off your face!");
  108. }
  109. return 1;
  110. }
  111.  
  112.  
  113. CMD:me(playerid, params[])
  114. {
  115. new textv2[128];
  116. if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /me [action]");
  117. if(maskonface[playerid] == true)
  118. {
  119. format(textv2, sizeof (textv2), "* Stranger %s", params);
  120. if(AntiAdv(playerid, params)) return 1;
  121. NearMessageSender(playerid, 6, textv2, COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1);
  122. return 1;
  123. }
  124. else
  125. if(maskonface[playerid] == false)
  126. {
  127. format(textv2, sizeof(textv2), "* %s %s", NAMEGET(playerid), params);
  128. NearMessageSender(playerid, 6, textv2, COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1);
  129. return 1;
  130. }
  131. return 1;
  132. }
  133.  
  134. CMD:do(playerid, params[])
  135. {
  136. new textv2[128];
  137. if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /do [action]");
  138. if(maskonface[playerid] == true)
  139. {
  140. format(textv2, sizeof (textv2), "* %s ((Stranger))", params);
  141. if(AntiAdv(playerid, params)) return 1;
  142. NearMessageSender(playerid, 6, textv2, COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1);
  143. return 1;
  144. }
  145. else
  146. if(maskonface[playerid] == false)
  147. {
  148. format(textv2, sizeof(textv2), "* %s ((%s))", params, NAMEGET(playerid));
  149. NearMessageSender(playerid, 6, textv2, COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1);
  150. return 1;
  151. }
  152. return 1;
  153. }
  154.  
  155. CMD:b(playerid, params[])
  156. {
  157. new string[128];
  158. if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /b [text] (Local OOC Chat)");
  159. if(AntiAdv(playerid, params)) return 1;
  160. format(string, sizeof(string), "(( Local OOC: %s: %s ))", NAMEGET(playerid), params);
  161. NearMessageSender(playerid, 12, string, COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2);
  162. return 1;
  163. }
  164.  
  165. CMD:shout(playerid, params[])
  166. {
  167. new textv2[128];
  168. if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /shout [text]");
  169. if(maskonface[playerid] == true)
  170. {
  171. format(textv2, sizeof (textv2), "Stranger shouts: %s!", params);
  172. if(AntiAdv(playerid, params)) return 1;
  173. NearMessageSender(playerid, 15, textv2, COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2);
  174. return 1;
  175. }
  176. else
  177. if(maskonface[playerid] == false)
  178. {
  179. format(textv2, sizeof(textv2), "%s shouts: %s!", NAMEGET(playerid), params);
  180. NearMessageSender(playerid, 15, textv2, COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2);
  181. return 1;
  182. }
  183. return 1;
  184. }
  185.  
  186.  
  187. CMD:think(playerid, params[])
  188. {
  189. new textv2[128];
  190. if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /think [text]");
  191. if(maskonface[playerid] == true)
  192. {
  193. format(textv2, sizeof (textv2), "Stranger thinks: %s", params);
  194. if(AntiAdv(playerid, params)) return 1;
  195. NearMessageSender(playerid, 6, textv2, COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1);
  196. return 1;
  197. }
  198. else
  199. if(maskonface[playerid] == false)
  200. {
  201. format(textv2, sizeof(textv2), "%s thinks: %s", NAMEGET(playerid), params);
  202. NearMessageSender(playerid, 6, textv2, COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1);
  203. return 1;
  204. }
  205. return 1;
  206. }
  207.  
  208. CMD:low(playerid, params[])
  209. {
  210. new textv2[128];
  211. if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /low [text]");
  212. if(maskonface[playerid] == true)
  213. {
  214. format(textv2, sizeof (textv2), "Stranger says low: %s", params);
  215. if(AntiAdv(playerid, params)) return 1;
  216. NearMessageSender(playerid, 3, textv2, COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1);
  217. return 1;
  218. }
  219. else
  220. if(maskonface[playerid] == false)
  221. {
  222. format(textv2, sizeof(textv2), "%s says low: %s", NAMEGET(playerid), params);
  223. NearMessageSender(playerid, 3, textv2, COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1);
  224. return 1;
  225. }
  226. return 1;
  227. }
  228.  
  229. CMD:mp(playerid, params[])
  230. {
  231. new string[128];
  232. new Skin;
  233. Skin = GetPlayerSkin(playerid);
  234. if(Skin == 265||Skin == 266||Skin == 267||Skin == 280||Skin == 282||Skin == 288||Skin == 165||Skin == 166||Skin == 284||Skin == 285||Skin == 286||Skin == 287||Skin == 283)
  235. if(sscanf(params, "s[128]", params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /mp [text]");
  236. if(AntiAdv(playerid, params)) return 1;
  237. for(new i=0;i<MAX_PLAYERS;i++)
  238. if(GetPlayerSkin(i) == 265 || GetPlayerSkin(i) == 266 || GetPlayerSkin(i) == 267 || GetPlayerSkin(i) == 280 || GetPlayerSkin(i) == 282 || GetPlayerSkin(i) == 288 || GetPlayerSkin(i) == 165 || GetPlayerSkin(i) == 166 || GetPlayerSkin(i) == 284 || GetPlayerSkin(i) == 285 || GetPlayerSkin(i) == 286 || GetPlayerSkin(i) == 287)
  239. format(string, sizeof(string), "[MEGAPHONE: %s!!!]", params);
  240. NearMessageSender(playerid, 25, string, COLOR_BLUE,COLOR_BLUE,COLOR_BLUE,COLOR_BLUE,COLOR_BLUE);
  241. return 1;
  242. }
  243.  
  244. CMD:gannounce(playerid, params[])
  245. {
  246. new string[128];
  247. new Skin;
  248. Skin = GetPlayerSkin(playerid);
  249. if(Skin == 265||Skin == 266||Skin == 267||Skin == 280||Skin == 282||Skin == 288||Skin == 165||Skin == 166||Skin == 284||Skin == 285||Skin == 286||Skin == 287||Skin == 283)
  250. if(sscanf(params, "s[256]", params)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /gannounce [text]");
  251. if(AntiAdv(playerid, params)) return 1;
  252. format(string, sizeof(string), "[Government Announce: %s]", params);
  253. SendClientMessageToAll(COLOR_PDBLUE, string);
  254. return 1;
  255. }
  256.  
  257. CMD:pay(playerid, params[])
  258. {
  259. new string[128], playerb, amount;
  260. if(sscanf(params, "ui", playerb, amount)) return SendClientMessage(playerid, COLOR_RED, "Usage: /pay [playerid] [amount]");
  261. if(amount <= 0) return SendClientMessage(playerid, COLOR_RED, "Invalid money ammount.");
  262. if(playerid == playerb) return SendClientMessage(playerid, COLOR_RED, "You can't pay yourself.");
  263. if(!IsPlayerNearPlayer(playerid, playerb, 5.0)) return SendClientMessage(playerid, COLOR_RED, "You are too far away from that player.");
  264. if(GetPlayerMoney(playerid) < amount) return SendClientMessage(playerid, COLOR_RED, "You don't have that much money.");
  265. GivePlayerMoney(playerid, -amount);
  266. GivePlayerMoney(playerb, amount);
  267. format(string, sizeof(string), "** %s takes out $%d, passing them to %s", NAMEGET(playerid), amount, NAMEGET(playerb));
  268. NearMessageSender(playerid, 7, string, COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1);
  269. format(string, sizeof(string), " You have given %s $%d.", NAMEGET(playerb), amount);
  270. SendClientMessage(playerid, COLOR_RED, string);
  271. format(string, sizeof(string), " %s has given you $%d.", NAMEGET(playerid), amount);
  272. SendClientMessage(playerb, COLOR_RED, string);
  273. return 1;
  274. }
  275.  
  276.  
  277. CMD:cuff(playerid, params[])
  278. {
  279. new targetid;
  280. new Skin;
  281. Skin = GetPlayerSkin(playerid);
  282. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Usage: /cuff [id]");
  283. if(Skin == 265||Skin == 266||Skin == 267||Skin == 280||Skin == 282||Skin == 288||Skin == 165||Skin == 166||Skin == 284||Skin == 285||Skin == 286||Skin == 287||Skin == 283)
  284. if(IsPlayerConnected(targetid))
  285. {
  286. new Float:x, Float:y, Float:z;
  287. GetPlayerPos(playerid, x, y, z);
  288. if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))
  289. {
  290. new str[512];
  291. new name[MAX_PLAYER_NAME];
  292. GetPlayerName(playerid, name, sizeof(name));
  293. new target[MAX_PLAYER_NAME];
  294. GetPlayerName(targetid, target, sizeof(target));
  295. format(str, sizeof(str), "You have cuffed %s!",target);
  296. SendClientMessage(playerid, 0x0000BBAA, str);
  297. format(str, sizeof(str), "You have been cuffed by Officer %s!",name);
  298. SendClientMessage(targetid, 0x0000BBAA, str);
  299. SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000);//this will set the object cuffs at the hand of the player you want to cuff.
  300. SetPlayerSpecialAction(targetid,SPECIAL_ACTION_CUFFED);
  301. return 1;
  302. }
  303.  
  304. }
  305. return 1;
  306. }
  307.  
  308. CMD:uncuff(playerid, params[])
  309. {
  310.  
  311. new targetid;
  312. new Skin;
  313. Skin = GetPlayerSkin(playerid);
  314. if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, -1, "Usage: /uncuff [id]");
  315. if(IsPlayerConnected(targetid))
  316. {
  317. new Float:x, Float:y, Float:z;
  318. GetPlayerPos(playerid, x, y, z);
  319. if(Skin == 265||Skin == 266||Skin == 267||Skin == 280||Skin == 282||Skin == 288||Skin == 165||Skin == 166||Skin == 284||Skin == 285||Skin == 286||Skin == 287||Skin == 283)
  320. if(IsPlayerInRangeOfPoint(targetid, 5.0, x, y, z))
  321. {
  322. if(!SetPlayerAttachedObject(targetid, 0, 19418, 6, -0.011000, 0.028000, -0.022000, -15.600012, -33.699977,-81.700035, 0.891999, 1.000000, 1.168000))return SendClientMessage(playerid,-1,"ERROR: The player is not cuffed!");
  323. PlayerPlaySound(playerid, 5201, x,y,z);
  324. RemovePlayerAttachedObject(targetid,0);
  325. SetPlayerSpecialAction(targetid,SPECIAL_ACTION_NONE);
  326. new str[512];
  327. new name[MAX_PLAYER_NAME];
  328. GetPlayerName(playerid, name, sizeof(name));
  329. new target[MAX_PLAYER_NAME];
  330. GetPlayerName(targetid, target, sizeof(target));
  331. format(str, sizeof(str), "You have uncuffed %s!",target);
  332. SendClientMessage(playerid, 0x0000BBAA, str);
  333. format(str, sizeof(str), "You have been uncuffed by Officer %s!",name);
  334. SendClientMessage(targetid, 0x0000BBAA, str);
  335. return 1;
  336. }
  337.  
  338. }
  339. return 1;
  340. }
  341.  
  342. CMD:sms(playerid, cmdtext[])
  343. {
  344. new idx = strfind(cmdtext, " ", true);
  345. if((cmdtext[0] == EOS) || ((cmdtext[0] == '\1') && (cmdtext[1] == EOS)) || (idx == -1)) {
  346. SendClientMessage(playerid,COLOR_RED,"Usage: /sms [id] [message]");
  347. return 1;
  348. }
  349. if(cmdtext[idx + 1] == EOS) {
  350. SendClientMessage(playerid,COLOR_RED,"Usage: /sms [id] [message]");
  351. return 1;
  352. }
  353. cmdtext[idx++] = EOS;
  354. new
  355. id = strval(cmdtext);
  356. if(!IsPlayerConnected(id)) {
  357. SendClientMessage(playerid,COLOR_RED,"Invalid Player ID");
  358. return 1;
  359. }
  360. if(playerid == id) {
  361. SendClientMessage(playerid,COLOR_RED,"You cannot send SMS to yourself.");
  362. return 1;
  363. }
  364. new
  365. string[256];
  366. GetPlayerName(id, string, MAX_PLAYER_NAME);
  367. format(string, sizeof string, "[SMS] sent to %s(%d): {FFFFFF}%s", string, id, cmdtext[idx]);
  368. SendClientMessage(playerid, COLOR_ORANGE, string);
  369.  
  370. GetPlayerName(playerid, string, MAX_PLAYER_NAME);
  371. format(string, sizeof string, "[SMS] from %s(%d): {FFFFFF}%s", string, playerid, cmdtext[idx]);
  372. SendClientMessage(id, COLOR_ORANGE, string);
  373. PlayerPlaySound(id, 1057, 0.0, 0.0, 0.0);
  374.  
  375. printf("SMS: %s", cmdtext[idx]);
  376. return 1;
  377. }
  378.  
  379. CMD:pm(playerid, cmdtext[])
  380. {
  381. new idx = strfind(cmdtext, " ", true);
  382. if((cmdtext[0] == EOS) || ((cmdtext[0] == '\1') && (cmdtext[1] == EOS)) || (idx == -1)) {
  383. SendClientMessage(playerid,COLOR_RED,"Usage: /pm [id] [message]");
  384. return 1;
  385. }
  386. if(cmdtext[idx + 1] == EOS) {
  387. SendClientMessage(playerid,COLOR_RED,"Usage: /pm [id] [message]");
  388. return 1;
  389. }
  390. cmdtext[idx++] = EOS;
  391. new
  392. id = strval(cmdtext);
  393. if(!IsPlayerConnected(id)) {
  394. SendClientMessage(playerid,COLOR_RED,"Invalid Player ID");
  395. return 1;
  396. }
  397. if(playerid == id) {
  398. SendClientMessage(playerid,COLOR_RED,"You cannot PM yourself.");
  399. return 1;
  400. }
  401. new
  402. string[256];
  403. if(TogPM{id} == 0) return SendClientMessage(playerid, COLOR_ERROR, "This player has turned off his PM's!");
  404. else
  405. GetPlayerName(id, string, MAX_PLAYER_NAME);
  406. format(string, sizeof string, "[PM] sent to %s(%d): {FFFFFF}%s", string, id, cmdtext[idx]);
  407. SendClientMessage(playerid, COLOR_RED, string);
  408.  
  409. GetPlayerName(playerid, string, MAX_PLAYER_NAME);
  410. format(string, sizeof string, "[PM] from %s(%d): {FFFFFF}%s", string, playerid, cmdtext[idx]);
  411. SendClientMessage(id, COLOR_RED, string);
  412. printf("PM: %s", cmdtext[idx]);
  413. return 1;
  414. }
  415.  
  416. CMD:sellak(playerid, params[])
  417. {
  418. new playerb, bullets, string[128];
  419. new Skin;
  420. Skin = GetPlayerSkin(playerid);
  421. if(Skin == 6||Skin == 176||Skin == 29||Skin ==28||Skin ==24||Skin ==233||Skin ==180)
  422. if(!IsPlayerInRangeOfPoint(playerid,7, 1397.20117188, -1897.06628418, 12.71907330)) return SendClientMessage(playerid,-1,"You are not at the right place!");
  423. if(sscanf(params,"ii",playerb,bullets)) return SendClientMessage(playerid,-1,"Usage: /sellak [id] [ammo]");
  424. if(!IsPlayerNearPlayer(playerid, playerb, 5.0)) return SendClientMessage(playerid,-1,"You are too far away from that player!");
  425. if(bullets < 1 || bullets > 400) return SendClientMessage(playerid, 0xFF9900AA, "You can only take 1-400 bullets at once!");
  426. format(string, sizeof(string), "** %s takes out a AK-47 and a box of ammo as he passes it to %s", NAMEGET(playerid), NAMEGET(playerb), bullets);
  427. NearMessageSender(playerid, 7, string, COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1);
  428. format(string, sizeof(string), "Gun Dealer %s has given you a AK-47 and a box of ammo.", NAMEGET(playerid));
  429. SendClientMessage(playerb, COLOR_RED, string);
  430. GivePlayerWeapon(playerb, 30, bullets);
  431. GivePlayerMoney(playerid, -200);//you can change the ammount of money taken from the player
  432. return 1;
  433. }
  434.  
  435. CMD:selluzi(playerid, params[])
  436. {
  437. new playerb, bullets, string[128];
  438. new Skin;
  439. Skin = GetPlayerSkin(playerid);
  440. if(Skin == 6||Skin == 176||Skin == 29||Skin ==28||Skin ==24||Skin ==233||Skin ==180)// change the skins to the ones you want
  441. if(!IsPlayerInRangeOfPoint(playerid,7, 1397.20117188, -1897.06628418, 12.71907330)) return SendClientMessage(playerid,-1,"You are not at the right place!");// change the co-ords to the ones you want
  442. if(sscanf(params,"ii",playerb,bullets)) return SendClientMessage(playerid,-1,"Usage: /selluzi [id] [ammo]");
  443. if(!IsPlayerNearPlayer(playerid, playerb, 5.0)) return SendClientMessage(playerid,-1,"You are too far away from that player!");
  444. if(bullets < 1 || bullets > 400) return SendClientMessage(playerid, 0xFF9900AA, "You can only take 1-400 bullets at once!");
  445. format(string, sizeof(string), "** %s takes out a Mac-10 and a box of ammo as he passes it to %s", NAMEGET(playerid), NAMEGET(playerb), bullets);
  446. NearMessageSender(playerid, 7, string, COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1);
  447. format(string, sizeof(string), "Gun Dealer %s has given you a Mac-10 and a box of ammo.", NAMEGET(playerid));
  448. SendClientMessage(playerb, COLOR_RED, string);
  449. GivePlayerWeapon(playerb, 28, bullets);
  450. GivePlayerMoney(playerid, -200);//you can change the ammount of money taken from the player
  451. return 1;
  452. }
  453.  
  454. CMD:sellshot(playerid, params[])
  455. {
  456. new playerb, bullets, string[128];
  457. new Skin;
  458. Skin = GetPlayerSkin(playerid);
  459. if(Skin == 6||Skin == 176||Skin == 29||Skin ==28||Skin ==24||Skin ==233||Skin ==180)// change the skins to the ones you want
  460. if(!IsPlayerInRangeOfPoint(playerid,7, 1397.20117188, -1897.06628418, 12.71907330)) return SendClientMessage(playerid,-1,"You are not at the right place!");// change the co-ords to the ones you want
  461. if(sscanf(params,"ii",playerb,bullets)) return SendClientMessage(playerid,-1,"Usage: /sellshot [id] [ammo]");
  462. if(!IsPlayerNearPlayer(playerid, playerb, 5.0)) return SendClientMessage(playerid,-1,"You are too far away from that player!");
  463. if(bullets < 1 || bullets > 400) return SendClientMessage(playerid, 0xFF9900AA, "You can only take 1-400 bullets at once!");
  464. format(string, sizeof(string), "** %s takes out a Shotgun and a box of ammo as he passes it to %s", NAMEGET(playerid), NAMEGET(playerb), bullets);
  465. NearMessageSender(playerid, 7, string, COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1);
  466. format(string, sizeof(string), "Gun Dealer %s has given you a Shotgun and a box of ammo.", NAMEGET(playerid));
  467. SendClientMessage(playerb, COLOR_RED, string);
  468. GivePlayerWeapon(playerb, 25, bullets);
  469. GivePlayerMoney(playerid, -200);//you can change the ammount of money taken from the player
  470. return 1;
  471. }
  472.  
  473. CMD:selltec9(playerid, params[])
  474. {
  475. new playerb, bullets, string[128];
  476. new Skin;
  477. Skin = GetPlayerSkin(playerid);
  478. if(Skin == 6||Skin == 176||Skin == 29||Skin ==28||Skin ==24||Skin ==233||Skin ==180)// change the skins to the ones you want
  479. if(!IsPlayerInRangeOfPoint(playerid,7, 1397.20117188, -1897.06628418, 12.71907330)) return SendClientMessage(playerid,-1,"You are not at the right place!");// change the co-ords to the ones you want
  480. if(sscanf(params,"ii",playerb,bullets)) return SendClientMessage(playerid,-1,"Usage: /selltec9 [id] [ammo]");
  481. if(!IsPlayerNearPlayer(playerid, playerb, 5.0)) return SendClientMessage(playerid,-1,"You are too far away from that player!");
  482. if(bullets < 1 || bullets > 400) return SendClientMessage(playerid, 0xFF9900AA, "You can only take 1-400 bullets at once!");
  483. format(string, sizeof(string), "** %s takes out a Tec-9 and a box of ammo as he passes it to %s", NAMEGET(playerid), NAMEGET(playerb), bullets);
  484. NearMessageSender(playerid, 7, string, COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1);
  485. format(string, sizeof(string), "Gun Dealer %s has given you a Tec-9 and a box of ammo.", NAMEGET(playerid));
  486. SendClientMessage(playerb, COLOR_RED, string);
  487. GivePlayerWeapon(playerb, 32, bullets);
  488. GivePlayerMoney(playerid, -200);//you can change the ammount of money taken from the player
  489. return 1;
  490. }
  491.  
  492. CMD:sellcolt(playerid, params[])
  493. {
  494. new playerb, bullets, string[128];
  495. new Skin;
  496. Skin = GetPlayerSkin(playerid);
  497. if(Skin == 6||Skin == 176||Skin == 29||Skin ==28||Skin ==24||Skin ==233||Skin ==180)// change the skins to the ones you want
  498. if(!IsPlayerInRangeOfPoint(playerid,7, 1397.20117188, -1897.06628418, 12.71907330)) return SendClientMessage(playerid,-1,"You are not at the right place!");// change the co-ords to the ones you want
  499. if(sscanf(params,"ii",playerb,bullets)) return SendClientMessage(playerid,-1,"Usage: /sellcolt [id] [ammo]");
  500. if(!IsPlayerNearPlayer(playerid, playerb, 5.0)) return SendClientMessage(playerid,-1,"You are too far away from that player!");
  501. if(bullets < 1 || bullets > 400) return SendClientMessage(playerid, 0xFF9900AA, "You can only take 1-400 bullets at once!");
  502. format(string, sizeof(string), "** %s takes out a Glock-17 and a box of ammo as he passes it to %s", NAMEGET(playerid), NAMEGET(playerb), bullets);
  503. NearMessageSender(playerid, 7, string, COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1);
  504. format(string, sizeof(string), "Gun Dealer %s has given you a Glock-17 and a box of ammo.", NAMEGET(playerid));
  505. SendClientMessage(playerb, COLOR_RED, string);
  506. GivePlayerWeapon(playerb, 22, bullets);
  507. GivePlayerMoney(playerid, -200);//you can change the ammount of money taken from the player
  508. return 1;
  509. }
  510.  
  511. CMD:sellvest(playerid, params[])
  512. {
  513. new playerb, string[128];
  514. new Skin;
  515. Skin = GetPlayerSkin(playerid);
  516. if(Skin == 6||Skin == 176||Skin == 29||Skin ==28||Skin ==24||Skin ==233||Skin ==180)// change the skins to the ones you want
  517. if(!IsPlayerInRangeOfPoint(playerid,7, 1397.20117188, -1897.06628418, 12.71907330)) return SendClientMessage(playerid,-1,"You are not at the right place!");// change the co-ords to the ones you want
  518. if(sscanf(params, "ui", playerb)) return SendClientMessage(playerid, COLOR_RED, "Usage: /sellvest [id]");
  519. if(!IsPlayerNearPlayer(playerid, playerb, 5.0)) return SendClientMessage(playerid, COLOR_RED, "You are too far away from that player.");
  520. format(string, sizeof(string), "** %s takes out a Bulletproof Vest as he passes it to %s", NAMEGET(playerid), NAMEGET(playerb));
  521. NearMessageSender(playerid, 7, string, COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1,COLOR_FADE1);
  522. format(string, sizeof(string), "Gun Dealer %s has given you a bulletproof vest.", NAMEGET(playerid));
  523. SendClientMessage(playerb, COLOR_RED, string);
  524. SetPlayerArmour(playerb, 35);// you can change the ammount of armour given to the player
  525. return 1;
  526. }
  527.  
  528. CMD:buy(playerid, params[])
  529. {
  530. if(!IsPlayerInRangeOfPoint(playerid, 7.0, -29.0543,-184.3049,1003.5469)) return SendClientMessage(playerid,-1,"You need to be in a 24/7 store."); // change the co-ords to the ones you want
  531. ShowPlayerDialog(playerid,1,DIALOG_STYLE_LIST,"24/7 Store","Spraycan [$100]\nBat [$50]\nGolf Club [$70]\nShovel [$70]\nKatana [$100]\nCamera [$60]\nMask [$350]\nRuffles [$10]\nCoca-Cola [$10]\nCheeseburger [$15]\nCigarettes [$40]\nBeer [$20]","Purchase","Exit");
  532. return 1;
  533. }
  534.  
  535. forward AdvTimer();
  536.  
  537. CMD:adv(playerid, params[])
  538. {
  539. if (AdvTimer1 != 0) return SendClientMessage(playerid, 0xFF0000FF, "You must wait some time before making another advertisement.");
  540. if (isnull(params))
  541. {
  542. SendClientMessage(playerid, 0xFF0000FF, "Usage: /adv [advertisement]");
  543. return 1;
  544. }
  545. new string[152], playername[24];
  546. GetPlayerName(playerid, playername, sizeof(playername));
  547. if(AntiAdv(playerid, params)) return 1;
  548. format(string, sizeof(string), "||*** Advertisement from %s: %s ***||", playername, params);
  549. SendClientMessageToAll(0xFF0000FF, string);
  550. AdvTimer1 = 1;
  551. SetTimer("AdvTimer", 180000, false);
  552. GivePlayerMoney(playerid, -350);
  553. SendClientMessage(playerid, -1, "The advertisement has costed you 350$!");
  554. return 1;
  555. }
  556.  
  557.  
  558. COMMAND:pmsoff(playerid, params[])
  559. {
  560. SendClientMessage(playerid, COLOR_ERROR, "You've turned your private messages {FFFFFF}[OFF]"), TogPM{playerid} = 0;
  561. return true;
  562. }
  563.  
  564. COMMAND:pmson(playerid, params[])
  565. {
  566. SendClientMessage(playerid, COLOR_ERROR, "You've turned your private messages {FFFFFF}[ON]"), TogPM{playerid} = 1;
  567. return true;
  568. }
  569.  
  570.  
  571. //====================================START OF PUBLICS==============================================================================================================
  572.  
  573. public AdvTimer()
  574. {
  575. AdvTimer1 = 0;
  576. }
  577.  
  578. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  579. {
  580. if(newkeys & KEY_JUMP && !(oldkeys & KEY_JUMP) && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED) ApplyAnimation(playerid, "GYMNASIUM", "gym_jog_falloff",4.1,0,1,1,0,0);
  581. if(newkeys & KEY_SPRINT && !(oldkeys & KEY_SPRINT) && GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_CUFFED) ApplyAnimation(playerid, "GYMNASIUM", "gym_jog_falloff",4.1,0,1,1,0,0);
  582. return 1;
  583. }
  584.  
  585. public OnPlayerText(playerid, text[])
  586. {
  587. new textv2[128];
  588. if(maskonface[playerid] == true)
  589. {
  590. format(textv2, sizeof (textv2), "Stranger says: %s",text);
  591. NearMessageSender(playerid, 8, textv2, COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2,COLOR_FADE2);
  592. return 0;
  593. }
  594. else
  595. if(maskonface[playerid] == false)
  596. {
  597. return 1;
  598. }
  599. return 1;
  600. }
  601.  
  602. public OnPlayerDeath(playerid, killerid, reason)
  603. {
  604. (HasBoughtMask[playerid] = 0);
  605. (HasBoughtBeer[playerid] = 0);
  606. (HasBoughtCigar[playerid] = 0);
  607.  
  608. if(maskonface[playerid] == true)
  609. {
  610. maskonface[playerid] = false;
  611. for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(i, playerid, true);
  612. }
  613. return 1;
  614. }
  615.  
  616. public OnPlayerStreamIn(playerid, forplayerid)
  617. {
  618.  
  619. if(maskonface[playerid] == true)
  620. {
  621. ShowPlayerNameTagForPlayer(forplayerid, playerid, false);
  622. }
  623. return 1;
  624. }
  625.  
  626. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  627. {
  628. if(dialogid==1 && response==1)
  629. {
  630.  
  631. switch(listitem)
  632. {
  633. case 0:
  634. {
  635. if(GetPlayerMoney(playerid) <100) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
  636. SendClientMessage(playerid,-1,"You purchased a Spraycan for $100!");
  637. GivePlayerWeapon(playerid, 41, 100);
  638. GivePlayerMoney(playerid, -100);
  639. }
  640. case 1:
  641. {
  642. if(GetPlayerMoney(playerid) <50) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
  643. SendClientMessage(playerid, -1, "You purchased a Baseball Bat for $50!");
  644. GivePlayerWeapon(playerid, 5, 1);
  645. GivePlayerMoney(playerid, -50);
  646. }
  647. case 2:
  648. {
  649. if(GetPlayerMoney(playerid) <70) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
  650. SendClientMessage(playerid, -1, "You purchased a Golf Club for $70!");
  651. GivePlayerWeapon(playerid, 2, 1);
  652. GivePlayerMoney(playerid, -70);
  653. }
  654. case 3:
  655. {
  656. if(GetPlayerMoney(playerid) <70) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
  657. SendClientMessage(playerid, -1, "You purchased a Shovel for $70!");
  658. GivePlayerWeapon(playerid, 6, 1);
  659. GivePlayerMoney(playerid, -70);
  660. }
  661. case 4:
  662. {
  663. if(GetPlayerMoney(playerid) <100) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
  664. SendClientMessage(playerid, -1, "You purchased a Katana for $100!");
  665. GivePlayerWeapon(playerid, 8, 1);
  666. GivePlayerMoney(playerid, -100);
  667. }
  668. case 5:
  669. {
  670. if(GetPlayerMoney(playerid) <60) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
  671. SendClientMessage(playerid, -1, "You purchased a Camera for $60!");
  672. GivePlayerMoney(playerid, -60);
  673. GivePlayerWeapon(playerid, 43, 100);
  674. }
  675. case 6:
  676. {
  677. if(GetPlayerMoney(playerid) <350) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
  678. SendClientMessage(playerid, -1, "You purchased a Mask for $350! ((/maskon & /maskoff))");
  679. GivePlayerMoney(playerid, -350);
  680. (HasBoughtMask[playerid] = 1);
  681. }
  682. case 7:
  683. {
  684. if(GetPlayerMoney(playerid) <10) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
  685. new Float:pHealth;
  686. GetPlayerHealth(playerid, Float:pHealth);
  687. SendClientMessage(playerid, -1, "You purchased a pack of Ruffles for $10! ((+20 HP))");
  688. ApplyAnimation(playerid,"VENDING", "vend_eat1_P",4.1,0,1,1,1,1,1);
  689. GivePlayerMoney(playerid, -10);
  690. SetPlayerHealth(playerid, pHealth+20);
  691. }
  692. case 8:
  693. {
  694. if(GetPlayerMoney(playerid) <10) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
  695. new Float:pHealth;
  696. GetPlayerHealth(playerid, Float:pHealth);
  697. SendClientMessage(playerid, -1, "You purchased a bottle of Coca-Cola for $10! ((+10 HP))");
  698. GivePlayerMoney(playerid, -10);
  699. SetPlayerHealth(playerid, pHealth+10);
  700. }
  701. case 9:
  702. {
  703. if(GetPlayerMoney(playerid) <15) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
  704. new Float:pHealth;
  705. GetPlayerHealth(playerid, Float:pHealth);
  706. SendClientMessage(playerid, -1, "You purchased a Cheese Burger for $15! ((+30 HP))");
  707. ApplyAnimation(playerid,"VENDING", "vend_eat1_P",4.1,0,1,1,1,1,1);
  708. GivePlayerMoney(playerid, -15);
  709. SetPlayerHealth(playerid, pHealth+30);
  710. }
  711. case 10:
  712. {
  713. if(GetPlayerMoney(playerid) <40) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
  714. SendClientMessage(playerid, -1, "You purchased a box of cigars for $40! ((/cigar))");
  715. GivePlayerMoney(playerid, -40);
  716. (HasBoughtCigar[playerid] = 1);
  717. }
  718. case 11:
  719. {
  720. if(GetPlayerMoney(playerid) <20) return SendClientMessage(playerid,0xAA3333AA, "You do not have enough money!");
  721. SendClientMessage(playerid, -1, "You purchased a bottle of beer for $20!");
  722. GivePlayerMoney(playerid, -20);
  723. (HasBoughtBeer[playerid] = 1);
  724. }
  725. }
  726. }
  727. return 1;
  728. }
  729.  
  730. public OnPlayerConnect(playerid)
  731. {
  732. (HasBoughtMask[playerid] = 0);
  733. (HasBoughtBeer[playerid] = 0);
  734. (HasBoughtCigar[playerid] = 0);
  735. TogPM{playerid} = 1;
  736. return true;
  737. }
  738.  
  739. public OnPlayerDisconnect(playerid, reason)
  740. {
  741. (HasBoughtMask[playerid] = 0);
  742. (HasBoughtBeer[playerid] = 0);
  743. (HasBoughtCigar[playerid] = 0);
  744. return true;
  745. }
  746.  
  747. //===============END OF PUBLICS=====================START OF STOCKS=======================================================================================//
  748.  
  749. stock NearMessageSender(playerid, Float:radius, string[], col1, col2, col3, col4, col5)
  750. {
  751. new Float:x, Float:y, Float:z;
  752. GetPlayerPos(playerid, x, y, z);
  753. new Float:ix, Float:iy, Float:iz;
  754. new Float:cx, Float:cy, Float:cz;
  755. foreach(Player, i)
  756. {
  757. if(GetPlayerInterior(playerid) == GetPlayerInterior(i) && GetPlayerVirtualWorld(playerid) == GetPlayerVirtualWorld(i))
  758. {
  759. GetPlayerPos(i, ix, iy, iz);
  760. cx = (x - ix);
  761. cy = (y - iy);
  762. cz = (z - iz);
  763. if(((cx < radius/16) && (cx > -radius/16)) && ((cy < radius/16) && (cy > -radius/16)) && ((cz < radius/16) && (cz > -radius/16)))
  764. {
  765. SendClientMessage(i, col1, string);
  766. }
  767. else if(((cx < radius/8) && (cx > -radius/8)) && ((cy < radius/8) && (cy > -radius/8)) && ((cz < radius/8) && (cz > -radius/8)))
  768. {
  769. SendClientMessage(i, col2, string);
  770. }
  771. else if(((cx < radius/4) && (cx > -radius/4)) && ((cy < radius/4) && (cy > -radius/4)) && ((cz < radius/4) && (cz > -radius/4)))
  772. {
  773. SendClientMessage(i, col3, string);
  774. }
  775. else if(((cx < radius/2) && (cx > -radius/2)) && ((cy < radius/2) && (cy > -radius/2)) && ((cz < radius/2) && (cz > -radius/2)))
  776. {
  777. SendClientMessage(i, col4, string);
  778. }
  779. else if(((cx < radius) && (cx > -radius)) && ((cy < radius) && (cy > -radius)) && ((cz < radius) && (cz > -radius)))
  780. {
  781. SendClientMessage(i, col5, string);
  782. }
  783. }
  784. }
  785. return 1;
  786. }
  787.  
  788. stock NAMEGET(playerid)
  789. {
  790. new name[MAX_PLAYER_NAME];
  791. GetPlayerName(playerid,name,sizeof(name));
  792. for(new i = 0; i < MAX_PLAYER_NAME; i++)
  793. {
  794. if(name[i] == '_') name[i] = ' ';
  795. }
  796. return name;
  797. }
  798. stock AntiAdv(playerid, text[])
  799. {
  800. new strR[255], is1=0, r=0;
  801. while(strlen(text[is1]))
  802. {
  803. if('0'<=text[is1]<='9')
  804. {
  805. new is2=is1+1, p=0;
  806. while(p==0)
  807. {
  808. if('0'<=text[is2]<='9'&&strlen(text[is2]))
  809. {
  810. is2++;
  811. }
  812. else
  813. {
  814. strmid(strR[r],text,is1,is2,255);
  815. if(strval(strR[r])<255) r++;
  816. is1=is2;
  817. p=1;
  818. }
  819. }
  820. }
  821. is1++;
  822. }
  823. if(r>=4)
  824. {
  825. new strMy[255];
  826. format(strMy, sizeof(strMy), " \"Your server name here\": %s is attempting to Server Advertise", NAMEGET(playerid));
  827. SendClientMessage(COLOR_GOVERNMENT, 1, strMy);
  828. new pr2;
  829. for(new z=0;z<r;z++)
  830. {
  831.  
  832. while((pr2=strfind(text,strR[z],true))!=-1)
  833. {
  834. for(new i=pr2,j=pr2+strlen(strR[z]);i<j;i++)
  835. {
  836. text[i]='*';
  837. }
  838. }
  839. }
  840. return 1;
  841. }
  842. return 0;
  843. }
  844.  
  845. stock IsPlayerNearPlayer(playerid, targetid, Float:radius)
  846. {
  847. new Float:x, Float:y, Float:z;
  848. GetPlayerPos(targetid, x, y, z);
  849. if(IsPlayerInRangeOfPoint(playerid, radius ,x, y, z))
  850. {
  851. return 1;
  852. }
  853. return 0;
  854. }
  855. #endif
  856. //=========================================================END OF STOCKS=====================================================================
Add Comment
Please, Sign In to add comment