Advertisement
Guest User

By iMaximus from SAMP Forums

a guest
Dec 19th, 2014
1,582
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.76 KB | None | 0 0
  1. #include <a_samp>
  2. #include <sscanf>
  3. #include <zcmd>
  4.  
  5. #define COLOR_LIGHTRED 0xFF6347AA
  6. #define COLOR_RED 0xAA3333AA
  7. #define COLOR_WHITE 0xFFFFFFAA
  8.  
  9. CMD:jetpack(playerid, params[])
  10. {
  11. if(IsPlayerAdmin(playerid))
  12. {
  13. new string[128], target;
  14. if(sscanf(params, "ds", target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /jetpack [playerid/partofname]");
  15. if(GetPlayerSpecialAction(target) == SPECIAL_ACTION_USEJETPACK) return SendClientMessage(playerid, COLOR_WHITE, "Player already have a jetpack.");
  16. if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not connected.");
  17. if(target != INVALID_PLAYER_ID)
  18. {
  19. if(IsPlayerAdmin(playerid))
  20. {
  21. SendClientMessage(target, COLOR_WHITE, "Enjoy your new jetpack!");
  22. SetPlayerSpecialAction(target, SPECIAL_ACTION_USEJETPACK);
  23. format(string,sizeof(string),"%s (%d) has received a jetpack from Administrator %s (%d).", PlayerName(target),target,PlayerName(playerid),playerid);
  24. SendClientMessageToAll(COLOR_LIGHTRED,string);
  25. }
  26. else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
  27. }
  28. else SendClientMessage(playerid, COLOR_WHITE, "Invalid player specified.");
  29. }
  30. else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
  31. return 1;
  32. }
  33.  
  34. CMD:removejetpack(playerid, params[])
  35. {
  36. if(IsPlayerAdmin(playerid))
  37. {
  38. new string[128], target;
  39. if(sscanf(params, "ds", target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /removejetpack [playerid]");
  40. if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not connected.");
  41. if(GetPlayerSpecialAction(target) == SPECIAL_ACTION_NONE) return SendClientMessage(playerid, COLOR_WHITE, "Player don't have any jetpack.");
  42. SetPlayerSpecialAction(target,SPECIAL_ACTION_NONE);
  43. format(string,sizeof(string),"Administrator %s (%d) has removed a jetpack on %s (%d).",PlayerName(playerid),playerid,PlayerName(target),target);
  44. SendClientMessageToAll(COLOR_LIGHTRED,string);
  45. }
  46. else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
  47. return 1;
  48. }
  49.  
  50. CMD:slap(playerid, params[])
  51. {
  52. if(IsPlayerAdmin(playerid))
  53. {
  54. new target,string[128];
  55. if(sscanf(params, "ds", target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /slap [playerid/partofname]");
  56. if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "Player is not connected.");
  57. new Float:slx, Float:sly, Float:slz;
  58. GetPlayerPos(target, slx, sly, slz);
  59. SetPlayerPos(target, slx, sly, slz+6);
  60. PlayerPlaySound(target, 1130, slx, sly, slz+5);
  61. format(string,sizeof(string),"Administrator %s (%d) has slapped %s (%d).",PlayerName(playerid),playerid,PlayerName(target),target);
  62. SendClientMessageToAll(COLOR_LIGHTRED,string);
  63. }
  64. else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
  65. return 1;
  66. }
  67.  
  68. CMD:akill(playerid, params[])
  69. {
  70. if(IsPlayerAdmin(playerid))
  71. {
  72. new target,string[128];
  73. if(sscanf(params, "d", target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: [playerid/partofname]");
  74. if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "Player is not connected.");
  75. SetPlayerHealth(target,0);
  76. format(string,sizeof(string),"Administrator %s (%d) has killed you.",PlayerName(playerid),playerid);
  77. SendClientMessage(target,COLOR_WHITE,string);
  78. format(string,sizeof(string),"Administrator %s (%d) has used /akill on %s (%d).",PlayerName(playerid),playerid,PlayerName(target),target);
  79. SendClientMessageToAll(COLOR_LIGHTRED,string);
  80. }
  81. else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
  82. return 1;
  83. }
  84.  
  85. CMD:givemoney(playerid, params[])
  86. {
  87. if(IsPlayerAdmin(playerid))
  88. {
  89. new target,money,string[128];
  90. if(sscanf(params, "di", target,money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givemoney [playerid/partofname][amount]");
  91. if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "Player is not connected.");
  92. GivePlayerMoney(target, money);
  93. format(string,sizeof(string),"Administrator %s (%d) has given you $%d .",PlayerName(playerid),playerid,money);
  94. SendClientMessage(target,COLOR_WHITE,string);
  95. format(string,sizeof(string),"Administrator %s (%d) has given $%d money to %s (%d).",PlayerName(playerid),playerid,money,PlayerName(target),target);
  96. SendClientMessageToAll(COLOR_LIGHTRED,string);
  97. }
  98. else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
  99. return 1;
  100. }
  101.  
  102. CMD:setmoney(playerid, params[])
  103. {
  104. if(IsPlayerAdmin(playerid))
  105. {
  106. new target,money,string[128];
  107. if(sscanf(params, "di", target,money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setmoney [playerid/partofname] [amount])");
  108. if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "Player is not connected.");
  109. ResetPlayerMoney(target);
  110. GivePlayerMoney(target, money);
  111. format(string,sizeof(string),"Administrator %s (%d) has setted your money to %d.",PlayerName(playerid),playerid,money);
  112. SendClientMessage(target,COLOR_WHITE,string);
  113. format(string,sizeof(string),"Administrator %s (%d) has setted %s (%d) money to %d.",PlayerName(playerid),playerid,PlayerName(target),target,money);
  114. SendClientMessageToAll(COLOR_LIGHTRED,string);
  115. }
  116. else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
  117. return 1;
  118. }
  119.  
  120. CMD:giveweapon(playerid, params[])
  121. {
  122. if(IsPlayerAdmin(playerid))
  123. {
  124. new target,gun,ammo,string[128];
  125. if(sscanf(params, "dii", target,gun,ammo)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /giveweapon [playerid/partofname] [weapon] [ammo]");
  126. if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "{F81414}Error: {FFFFFF}Player is not connected.");
  127. GivePlayerWeapon(target, gun,ammo);
  128. format(string,sizeof(string),"Administrator %s (%d) has given you weapon (Id: %d) (Ammo: %d).",PlayerName(playerid),playerid,gun,ammo);
  129. SendClientMessage(target,COLOR_WHITE,string);
  130. format(string,sizeof(string),"Administrator %s (%d) has given %s (%d) (Weapon ID: %d) (Ammo: %d).",PlayerName(playerid),playerid,PlayerName(target),target,gun,ammo);
  131. SendClientMessageToAll(COLOR_LIGHTRED,string);
  132. }
  133. else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
  134. return 1;
  135. }
  136.  
  137. CMD:setscore(playerid, params[])
  138. {
  139. if(IsPlayerAdmin(playerid))
  140. {
  141. new target,string[128],score;
  142. if(sscanf(params, "dd", target,score)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /setscore [playerid/partofname] [amount]");
  143. if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "Player is not connected.");
  144. format(string,sizeof(string),"Administrator %s (%d) has setted your score to %d.",PlayerName(playerid),playerid,score);
  145. SendClientMessage(target,COLOR_WHITE,string);
  146. format(string,sizeof(string),"Administrator %s (%d) has setted %s (%d) score to %d.",PlayerName(playerid),playerid,PlayerName(target),target,score);
  147. SendClientMessageToAll(COLOR_LIGHTRED,string);
  148. SetPlayerScore(target, score);
  149. }
  150. else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
  151. return 1;
  152. }
  153.  
  154. CMD:setweather(playerid, params[])
  155. {
  156. if(IsPlayerAdmin(playerid))
  157. {
  158. new string[128],weather;
  159. if(sscanf(params, "i", weather)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setweather [weatherid]");
  160. if(weather > 45 || weather < 0) return SendClientMessage(playerid, COLOR_RED, "Invalid weather ID.");
  161. format(string,sizeof(string),"Administrator %s (%d) has setted all players weather to %d.",PlayerName(playerid),playerid,weather);
  162. SendClientMessageToAll(COLOR_LIGHTRED,string);
  163. SetWeather(weather);
  164. }
  165. else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
  166. return 1;
  167. }
  168.  
  169. CMD:givescore(playerid, params[])
  170. {
  171. if(IsPlayerAdmin(playerid))
  172. {
  173. new target,score,string[128];
  174. if(sscanf(params, "di", target,score)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givescore [playerid] [amount]");
  175. if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "Player is not connected.");
  176. GivePlayerScore(target, score);
  177. format(string,sizeof(string),"Administrator %s (%d) has given you %d score.",PlayerName(playerid),playerid,score);
  178. SendClientMessage(target,COLOR_WHITE,string);
  179. format(string,sizeof(string),"Administrator %s (%d) has given %d score to %s (%d).",PlayerName(playerid),playerid, score,PlayerName(target),target);
  180. SendClientMessageToAll(COLOR_LIGHTRED,string);
  181. }
  182. else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
  183. return 1;
  184. }
  185.  
  186. CMD:disarm(playerid, params[])
  187. {
  188. if(IsPlayerAdmin(playerid))
  189. {
  190. new target,string[128];
  191. if(sscanf(params, "d",target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /disarm [playerid/partofname]");
  192. if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not connected.");
  193. format(string,sizeof(string),"Administrator %s (%d) has disarmed %s (%d).",PlayerName(playerid),playerid,PlayerName(target),target);
  194. SendClientMessageToAll(COLOR_LIGHTRED,string);
  195. ResetPlayerWeapons(target);
  196. }
  197. else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
  198. return 1;
  199. }
  200.  
  201. CMD:explode(playerid, params[])
  202. {
  203. if(IsPlayerAdmin(playerid))
  204. {
  205. new target,string[128];
  206. if(sscanf(params, "d", target)) return SendClientMessage(playerid, -1, "USAGE: /explode [playerid/partofname]");
  207. if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "Player is not connected.");
  208. ExplodePlayer(target);
  209. format(string,sizeof(string),"Administrator %s (%d) has exploded you.",PlayerName(playerid),playerid);
  210. SendClientMessage(target,COLOR_WHITE,string);
  211. format(string,sizeof(string),"Administrator %s (%d) has exploded %s (%d).",PlayerName(playerid),playerid,PlayerName(target),target);
  212. SendClientMessageToAll(COLOR_LIGHTRED,string);
  213. }
  214. else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
  215. return 1;
  216. }
  217.  
  218. CMD:freeze(playerid, params[])
  219. {
  220. if(IsPlayerAdmin(playerid))
  221. {
  222. new string[128],target;
  223. if(sscanf(params, "ds", target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /freeze [playerid/partofname]");
  224. if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not connected.");
  225. format(string,sizeof(string),"Administrator %s (%d) has freezed %s (%d).",PlayerName(playerid),playerid,PlayerName(target),target);
  226. SendClientMessageToAll(COLOR_LIGHTRED,string);
  227. TogglePlayerControllable(target, 0);
  228. GameTextForPlayer(target, "~r~Frozen!", 2000, 3);
  229. }
  230. else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
  231. return 1;
  232. }
  233.  
  234. CMD:unfreeze(playerid, params[])
  235. {
  236. if(IsPlayerAdmin(playerid))
  237. {
  238. new string[128],target;
  239. if(sscanf(params, "ds", target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /unfreeze [playerid/partofname]");
  240. if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not connected.");
  241. format(string,sizeof(string),"Administrator %s (%d) has unfreezed %s (%d).",PlayerName(playerid),playerid,PlayerName(target),target);
  242. SendClientMessageToAll(COLOR_LIGHTRED,string);
  243. TogglePlayerControllable(target, 1);
  244. GameTextForPlayer(target, "~r~Unfrozen!", 2000, 3);
  245. }
  246. else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
  247. return 1;
  248. }
  249.  
  250. CMD:setskin(playerid, params[])
  251. {
  252. if(IsPlayerAdmin(playerid))
  253. {
  254. new target,skin,string[128];
  255. if(sscanf(params, "di", target,skin)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setskin [playerid/partofname] [skinid]");
  256. if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not connected.");
  257. if(GetPlayerSkin(target) == skin) SendClientMessage(playerid, COLOR_WHITE, "Player is already wearing the skin you choose.");
  258. SetPlayerSkin(target,skin);
  259. format(string,sizeof(string),"Administrator %s (%d) has setted %s (%d) skin to %d.",PlayerName(playerid),playerid,PlayerName(target),target,skin);
  260. SendClientMessageToAll(COLOR_LIGHTRED,string);
  261. }
  262. else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
  263. return 1;
  264. }
  265.  
  266. CMD:kick(playerid, params[])
  267. {
  268. if(IsPlayerAdmin(playerid))
  269. {
  270. new string[128], target, reason[48];
  271. if(sscanf(params, "ds[48]", target, reason)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /kick [playerid/partofname] [reason]");
  272. if(!IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_WHITE, "Player is not connected.");
  273. format(string,sizeof(string),"Administrator %s (%d) has kicked %s (%d). (Reason: %s)",PlayerName(playerid),playerid,PlayerName(target),target,reason);
  274. SendClientMessageToAll(COLOR_LIGHTRED,string);
  275. SetTimerEx("KickTimer", 1000, false, "i", playerid);
  276. }
  277. else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
  278. return 1;
  279. }
  280.  
  281. CMD:get(playerid, params[])
  282. {
  283. if(IsPlayerAdmin(playerid))
  284. {
  285. new target,string[128];
  286. new Float:x,Float:y,Float:z;
  287. GetPlayerPos(playerid,x,y,z);
  288. if(!IsPlayerConnected(target)) return SendClientMessage(playerid, -1, "Player is not connected.");
  289. if(sscanf(params, "i",target)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /get [playerid/partofname]");
  290. if(target == playerid) return SendClientMessage(playerid, -1, "You cannot /get yourself.");
  291. SetPlayerPos(target, x,y,z);
  292. SetPlayerInterior(target,GetPlayerInterior(playerid));
  293. new Interior = GetPlayerInterior(target);
  294. if(IsPlayerInAnyVehicle(playerid))
  295. {
  296. new Car = GetPlayerVehicleID(playerid);
  297. SetVehiclePos(GetPlayerVehicleID(target), x+ 1, y+ 1, z);
  298. LinkVehicleToInterior(GetPlayerVehicleID(target),Interior);
  299. PutPlayerInVehicle(target, (Car), 0);
  300. }
  301. format(string,sizeof(string),"Administrator %s (%d) has teleported you to his/her position.",PlayerName(playerid),playerid);
  302. SendClientMessage(target,COLOR_WHITE,string);
  303. format(string,sizeof(string),"Administrator %s (%d) has teleported %s (%d) to his/her position.",PlayerName(playerid),playerid,PlayerName(target),target);
  304. SendClientMessageToAll(COLOR_LIGHTRED,string);
  305. }
  306. else SendClientMessage(playerid, COLOR_RED,"You're not authorized to use this command !");
  307. return 1;
  308. }
  309.  
  310. forward KickTimer(playerid);
  311. public KickTimer(playerid)
  312. {
  313. Kick(playerid);
  314. return 1;
  315. }
  316.  
  317. stock GivePlayerScore(playerid, score)
  318. {
  319. SetPlayerScore(playerid, GetPlayerScore(playerid)+score);
  320. return 1;
  321. }
  322.  
  323. stock ExplodePlayer(playerid)
  324. {
  325. new Float:Pos[3];
  326. GetPlayerPos(playerid,Pos[0], Pos[1], Pos[2]);
  327. CreateExplosion(Pos[0], Pos[1], Pos[2], 7, 10);
  328. }
  329.  
  330.  
  331. stock PlayerName(playerid)
  332. {
  333. new name[MAX_PLAYER_NAME];
  334. GetPlayerName(playerid, name, sizeof(name));
  335. return name;
  336. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement