Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 10.24 KB | None | 0 0
  1. CMD:set(playerid, params[])
  2. {
  3. new id, item[25], value, str1[256], name[25], name2[25], admwarn[100];
  4. if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi prima data.");
  5. if(PlayerInfo[playerid][pAdmin] < 3)return SCM(playerid, -1, AdminOnly);
  6. if(PlayerInfo[playerid][pBlocked] == 1)return SCM(playerid, COLOR_RED, "Your account is blocked");
  7. if(sscanf(params, "us[10]i", id, item, value))
  8. {
  9. SCM(playerid, COLOR_FADE2, "Syntax: /set <playerid> <item> <value>");
  10. SCM(playerid, COLOR_FADE2, "Avabile items: Skin, Group, Rank, Money, BankMoney, PP, Premium, Level, Hours, FP, Age, Team,");
  11. SCM(playerid, COLOR_FADE2, "RP, RobPoints, VIP, Health, Armor, VW, Int, Materials");
  12. }
  13. GetPlayerName(playerid, name, 25);
  14. GetPlayerName(id, name2, 25);
  15. format(admwarn, sizeof(admwarn), "%s[user: %d]'s %s was set to %d (( Admin %s[admin: %d] ))", name2, PlayerInfo[id][pSQLID], item, value, name, PlayerInfo[playerid][pSQLID]);
  16. if(strfind(item, "Skin", true) == 0)
  17. {
  18. if(PlayerInfo[playerid][pAdmin] < 3)return SCM(playerid, -1, AdminOnly);
  19. if(IsPlayerConnected(id))
  20. {
  21. PlayerInfo[id][pModel] = value;
  22. PlayerTextDrawSetPreviewModel(id, SkinPreview[id], PlayerInfo[id][pModel]);
  23. PlayerTextDrawShow(id, SkinPreview[id]);
  24. mysql_format(SQL,str1,sizeof(str1),"UPDATE users SET `Model`='%d' WHERE `name`='%s'", value, name2);
  25. mysql_tquery(SQL,str1,"","");
  26. SetPlayerSkin(id, value);
  27. if(!isnull(item))
  28. {
  29. ABroadCast(COLOR_ORANGE, admwarn, 1);
  30. }
  31. }
  32. else
  33. {
  34. SCM(playerid, -1, "This player is not online.");
  35. }
  36. }
  37. else if(strfind(item , "Group", true) == 0)
  38. {
  39. if(PlayerInfo[playerid][pAdmin] < 4)return SCM(playerid, -1, AdminOnly);
  40. if(IsPlayerConnected(id))
  41. {
  42. PlayerInfo[id][pMember] = value;
  43. mysql_format(SQL,str1,sizeof(str1),"UPDATE users SET `Member`='%d' WHERE `name`='%s'", value, name2);
  44. mysql_tquery(SQL,str1,"","");
  45. if(!isnull(item))
  46. {
  47. ABroadCast(COLOR_ORANGE, admwarn, 1);
  48. }
  49. }
  50. else
  51. {
  52. SCM(playerid, -1, "This player is not online.");
  53. }
  54. }
  55. else if(strfind(item, "Rank", true) == 0)
  56. {
  57. if(PlayerInfo[playerid][pAdmin] < 4)return SCM(playerid, -1, AdminOnly);
  58. if(value < 0 || value > 6)return SCM(playerid, COLOR_FADE2, "Maxim rank is 6");
  59. if(IsPlayerConnected(id))
  60. {
  61. PlayerInfo[id][pRank] = value;
  62. mysql_format(SQL,str1,sizeof(str1),"UPDATE users SET `Rank`='%d' WHERE `name`='%s'", value, name2);
  63. mysql_tquery(SQL,str1,"","");
  64. if(!isnull(item))
  65. {
  66. ABroadCast(COLOR_ORANGE, admwarn, 1);
  67. }
  68. }
  69. else
  70. {
  71. SCM(playerid, -1, "This player is not online.");
  72. }
  73. }
  74. else if(strfind(item, "Money", true) == 0)
  75. {
  76. if(PlayerInfo[playerid][pAdmin] < 5)return SCM(playerid, -1, AdminOnly);
  77. if(IsPlayerConnected(id))
  78. {
  79. ResetPlayerCash(id);
  80. GivePlayerCash(id, value);
  81. PlayerInfo[id][pCash] = value;
  82. Update(id, pCashx);
  83. if(!isnull(item))
  84. {
  85. ABroadCast(COLOR_ORANGE, admwarn, 1);
  86. }
  87. }
  88. else
  89. {
  90. SCM(playerid, -1, "This player is not online.");
  91. }
  92. }
  93. else if(strfind(item, "BankMoney", true) == 0)
  94. {
  95. if(PlayerInfo[playerid][pAdmin] < 5)return SCM(playerid, -1, AdminOnly);
  96. if(IsPlayerConnected(id))
  97. {
  98. PlayerInfo[id][pAccount] = value;
  99. Update(id, pBank);
  100. if(!isnull(item))
  101. {
  102. ABroadCast(COLOR_ORANGE, admwarn, 1);
  103. }
  104. }
  105. else
  106. {
  107. SCM(playerid, -1, "This player is not online.");
  108. }
  109. }
  110. else if(strfind(item, "PP", true) == 0)
  111. {
  112. if(PlayerInfo[playerid][pAdmin] < 5)return SCM(playerid, -1, AdminOnly);
  113. if(IsPlayerConnected(id))
  114. {
  115. PlayerInfo[id][pPremiumPoints] = value;
  116. Update(id, pPremiumPointsx);
  117. PlayerInfo[id][pTotalPP] += value;
  118. Update(id, pTotalPPx);
  119. if(PlayerInfo[id][pTotalPP] >= 200 && PlayerInfo[id][pVIP] == 0)
  120. {
  121. SCM(id, COLOR_ORANGE, "In contul tau s-au acumulat un total de 200 PP iar acum esti un VIP User.");
  122. PlayerInfo[id][pVIP] = 1;
  123. Update(id, pVIPx);
  124. }
  125. if(!isnull(item))
  126. {
  127. ABroadCast(COLOR_ORANGE, admwarn, 1);
  128.  
  129. }
  130. }
  131. else
  132. {
  133. SCM(playerid, -1, "This player is not online.");
  134. }
  135. }
  136. else if(strfind(item, "Premium", true) == 0)
  137. {
  138. if(PlayerInfo[playerid][pAdmin] < 5)return SCM(playerid, -1, AdminOnly);
  139. if(IsPlayerConnected(id))
  140. {
  141. PlayerInfo[id][pPremiumAccount] = value;
  142. Update(id, pPremiumAccountx);
  143. if(!isnull(item))
  144. {
  145. ABroadCast(COLOR_ORANGE, admwarn, 1);
  146. }
  147. }
  148. else
  149. {
  150. SCM(playerid, -1, "This player is not online.");
  151. }
  152. }
  153. else if(strfind(item, "Level", true) == 0)
  154. {
  155. if(PlayerInfo[playerid][pAdmin] < 6)return SCM(playerid, -1, AdminOnly);
  156. if(IsPlayerConnected(id))
  157. {
  158. PlayerInfo[id][pLevel] = value;
  159. Update(id, pLevelx);
  160. SetPlayerScore(id, value);
  161. if(!isnull(item))
  162. {
  163. ABroadCast(COLOR_ORANGE, admwarn, 1);
  164. }
  165. }
  166. else
  167. {
  168. SCM(playerid, -1, "This player is not online.");
  169. }
  170. }
  171. else if(strfind(item, "Hours", true) == 0)
  172. {
  173. if(PlayerInfo[playerid][pAdmin] < 6)return SCM(playerid, -1, AdminOnly);
  174. if(IsPlayerConnected(id))
  175. {
  176. PlayerInfo[id][pConnectTime] = value;
  177. Update(id, pConnectTimex);
  178. if(!isnull(item))
  179. {
  180. ABroadCast(COLOR_ORANGE, admwarn, 1);
  181. }
  182. }
  183. else
  184. {
  185. SCM(playerid, -1, "This player is not online.");
  186. }
  187. }
  188. else if(strfind(item, "FP", true) == 0)
  189. {
  190. if(PlayerInfo[playerid][pAdmin] < 3)return SCM(playerid, -1, AdminOnly);
  191. if(IsPlayerConnected(id))
  192. {
  193. PlayerInfo[id][pFpunish] = value;
  194. Update(id, pFpunishx);
  195. if(!isnull(item))
  196. {
  197. ABroadCast(COLOR_ORANGE, admwarn, 1);
  198. }
  199. }
  200. else
  201. {
  202. SCM(playerid, -1, "This player is not online.");
  203. }
  204. }
  205. else if(strfind(item, "Age", true) == 0)
  206. {
  207. if(PlayerInfo[playerid][pAdmin] < 3)return SCM(playerid, -1, AdminOnly);
  208. if(IsPlayerConnected(id))
  209. {
  210. PlayerInfo[id][pAge] = value;
  211. mysql_format(SQL,str1,sizeof(str1),"UPDATE users SET `Age`='%d' WHERE `name`='%s'", value, name2);
  212. mysql_tquery(SQL,str1,"","");
  213. if(!isnull(item))
  214. {
  215. ABroadCast(COLOR_ORANGE, admwarn, 1);
  216. }
  217. }
  218. else
  219. {
  220. SCM(playerid, -1, "This player is not online.");
  221. }
  222. }
  223. else if(strfind(item, "Mats", true) == 0)
  224. {
  225. if(PlayerInfo[playerid][pAdmin] < 4)return SCM(playerid, -1, AdminOnly);
  226. if(IsPlayerConnected(id))
  227. {
  228. PlayerInfo[id][pMats] = value;
  229. mysql_format(SQL,str1,sizeof(str1),"UPDATE users SET `Mats`='%d' WHERE `name`='%s'", value, name2);
  230. mysql_tquery(SQL,str1,"","");
  231. if(!isnull(item))
  232. {
  233. ABroadCast(COLOR_ORANGE, admwarn, 1);
  234. }
  235. }
  236. else
  237. {
  238. SCM(playerid, -1, "This player is not online.");
  239. }
  240. }
  241. else if(strfind(item, "Team", true) == 0)
  242. {
  243. if(PlayerInfo[playerid][pAdmin] < 4)return SCM(playerid, -1, AdminOnly);
  244. if(IsPlayerConnected(id))
  245. {
  246. PlayerInfo[id][pTeam] = value;
  247. mysql_format(SQL,str1,sizeof(str1),"UPDATE users SET `Team`='%d' WHERE `name`='%s'", value, name2);
  248. mysql_tquery(SQL,str1,"","");
  249. if(!isnull(item))
  250. {
  251. ABroadCast(COLOR_ORANGE, admwarn, 1);
  252. }
  253. }
  254. else
  255. {
  256. SCM(playerid, -1, "This player is not online.");
  257. }
  258. }
  259. else if(strfind(item, "RP", true) == 0)
  260. {
  261. if(PlayerInfo[playerid][pAdmin] < 5)return SCM(playerid, -1, AdminOnly);
  262. if(IsPlayerConnected(id))
  263. {
  264. PlayerInfo[id][pExp] = value;
  265. Update(id, pRP);
  266. if(!isnull(item))
  267. {
  268. ABroadCast(COLOR_ORANGE, admwarn, 1);
  269. }
  270. }
  271. else
  272. {
  273. SCM(playerid, -1, "This player is not online.");
  274. }
  275. }
  276. else if(strfind(item, "RobPoints", true) == 0)
  277. {
  278. if(PlayerInfo[playerid][pAdmin] < 4)return SCM(playerid, -1, AdminOnly);
  279. if(IsPlayerConnected(id))
  280. {
  281. PlayerInfo[id][pRob] = value;
  282. Update(id, pRobx);
  283. if(!isnull(item))
  284. {
  285. ABroadCast(COLOR_ORANGE, admwarn, 1);
  286. }
  287. }
  288. else
  289. {
  290. SCM(playerid, -1, "This player is not online.");
  291. }
  292. }
  293. else if(strfind(item, "VIP", true) == 0)
  294. {
  295. if(PlayerInfo[playerid][pAdmin] < 5)return SCM(playerid, -1, AdminOnly);
  296. if(IsPlayerConnected(id))
  297. {
  298. PlayerInfo[id][pVIP] = value;
  299. Update(id, pVIPx);
  300. if(!isnull(item))
  301. {
  302. ABroadCast(COLOR_ORANGE, admwarn, 1);
  303. }
  304. }
  305. else
  306. {
  307. SCM(playerid, -1, "This player is not online.");
  308. }
  309. }
  310. else if(strfind(item, "Health", true) == 0)
  311. {
  312. if(PlayerInfo[playerid][pAdmin] < 3)return SCM(playerid, -1, AdminOnly);
  313. if(IsPlayerConnected(id))
  314. {
  315. SetPlayerHealthEx(id, value);
  316. if(!isnull(item))
  317. {
  318. ABroadCast(COLOR_ORANGE, admwarn, 1);
  319. }
  320. }
  321. else
  322. {
  323. SCM(playerid, -1, "This player is not online.");
  324. }
  325. }
  326. else if(strfind(item, "Armor", true) == 0)
  327. {
  328. if(PlayerInfo[playerid][pAdmin] < 3)return SCM(playerid, -1, AdminOnly);
  329. if(IsPlayerConnected(id))
  330. {
  331. SetPlayerArmourEx(id, value);
  332. if(!isnull(item))
  333. {
  334. ABroadCast(COLOR_ORANGE, admwarn, 1);
  335. }
  336. }
  337. else
  338. {
  339. SCM(playerid, -1, "This player is not online.");
  340. }
  341. }
  342. else if(strfind(item, "VW", true) == 0)
  343. {
  344. if(PlayerInfo[playerid][pAdmin] < 3)return SCM(playerid, -1, AdminOnly);
  345. if(IsPlayerConnected(id))
  346. {
  347. SetPlayerVirtualWorld(id, value);
  348. }
  349. if(!isnull(item))
  350. {
  351. ABroadCast(COLOR_ORANGE, admwarn, 1);
  352. }
  353. else
  354. {
  355. SCM(playerid, -1, "This player is not online.");
  356. }
  357. }
  358. else if(strfind(item, "Int", true) == 0)
  359. {
  360. if(PlayerInfo[playerid][pAdmin] < 3)return SCM(playerid, -1, AdminOnly);
  361. if(IsPlayerConnected(id))
  362. {
  363. SetPlayerInterior(id,value);
  364. PlayerInfo[id][pInt] = value;
  365. }
  366. if(!isnull(item))
  367. {
  368. ABroadCast(COLOR_ORANGE, admwarn, 1);
  369. }
  370. else
  371. {
  372. SCM(playerid, -1, "This player is not online.");
  373. }
  374. }
  375. return 1;
  376. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement