Advertisement
Guest User

SCRIPT

a guest
Nov 30th, 2013
783
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.64 KB | None | 0 0
  1. /*
  2. Scripted by High Killa
  3. Please do NOT remove the credits, i've spend time on this.
  4. ##########################################################
  5. Script version: 1.0
  6. */
  7.  
  8. #include <a_samp>
  9. #include <sscanf2>
  10. #include <SII>
  11. #include <zcmd>
  12. #include <foreach>
  13. #include <streamer>
  14.  
  15.  
  16. #if defined FILTERSCRIPT
  17.  
  18. public OnFilterScriptInit()
  19. {
  20. print("\n--------------------------------------");
  21. print(" HK's Admin System");
  22. print("--------------------------------------\n");
  23. return 1;
  24. }
  25.  
  26. public OnFilterScriptExit()
  27. {
  28. return 1;
  29. }
  30.  
  31. #else
  32.  
  33. new PlayerText:welcomeText[MAX_PLAYERS];
  34.  
  35. // Some enums to get defined.
  36.  
  37. enum PlayerInfo
  38. {
  39. Logged,
  40. miniadmin,
  41. Level,
  42. Duty,
  43. Cash,
  44. pGD,
  45. pTS,
  46. pVip,
  47. pCop,
  48. pAmmo,
  49. pGuns,
  50. Banned,
  51. }
  52. new PInfo[MAX_PLAYERS][PlayerInfo];
  53.  
  54. /////////// -- COLORS //////////
  55.  
  56.  
  57. forward MoneyTimer(playerid, amount);
  58.  
  59. // Colors
  60. #define COLOR_RED 0xFF0000FF
  61. #define COLOR_GREEN 0x008040FF
  62.  
  63.  
  64. ///////////////////////////////////////////////////////////
  65.  
  66. public OnPlayerDisconnect(playerid, reason)
  67. {
  68.  
  69. PInfo[playerid][Logged] = 0;
  70. new pname[MAX_PLAYER_NAME], string[120 + MAX_PLAYER_NAME];
  71. GetPlayerName(playerid, pname, sizeof(pname));
  72. switch(reason)
  73. {
  74. case 0: format(string, sizeof(string), "† %s has left The Streetz of Los Santos ( Leaving )", pname);
  75. }
  76. SendClientMessageToAll(0x3FA63CFF, string);
  77. return 1;
  78. }
  79.  
  80. public OnPlayerRequestSpawn(playerid)
  81. {
  82. if(PInfo[playerid][Logged] == 0) // your variable for logged players if(PInfo[playerid][Logged] == 1)
  83. {
  84. SendClientMessage(playerid,0x3FA63CFF,"†. Sorry homie, but you're not logged in, so you can't spawn.");
  85. return 0;
  86. }
  87. return 1;
  88. }
  89.  
  90. public OnPlayerConnect(playerid)
  91. {
  92.  
  93. // First, create the textdraw
  94.  
  95.  
  96. // Now show it
  97. PlayerTextDrawShow(playerid, welcomeText[playerid]);
  98.  
  99.  
  100. /// Adding an feature which got deleted on SOLS, you can just disable it here if you wish.
  101.  
  102. new pname[MAX_PLAYER_NAME], string[120 + MAX_PLAYER_NAME];
  103. GetPlayerName(playerid, pname, sizeof(pname));
  104. format(string, sizeof(string), "† %s has joined the Server( Joining )", pname);
  105. SendClientMessageToAll(0x3FA63CFF, string);
  106.  
  107. ///
  108.  
  109. new file[64],PlayerName[25];//Creating a variable where we can store the file path, and the variable to store the player's name.
  110. GetPlayerName(playerid,PlayerName,sizeof PlayerName);//Storing the players name in the PlayerName variable.
  111. format(file,sizeof file,"Admin/%s.ini",PlayerName);//Storing the file path with the players name.
  112. if(!fexist(file))//Checking if the file exists
  113. {//Here goes the stuff you want to do if the user is not registered.
  114. SendClientMessage(playerid,-1,"SERVER: You're not registered, use /register [password] for begin playing.");
  115. }
  116. else
  117. {//Here goes the stuff you want to do if the user is registered.
  118. SendClientMessage(playerid,-4,"SERVER: Welcome back! Use /login [password] to access your account.");
  119. }
  120. return 1;
  121. }
  122.  
  123. CMD:login(playerid, params[])
  124. {
  125. if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,COLOR_RED,"†. You are already logged in!");//Checking if the player is logged in, if he is, it won't allow him to login
  126. new password[23],password2[23];//Creating a variable to store the password, and another one to store the password from the user's file.
  127. if(sscanf(params,"s[23]",password)) return SendClientMessage(playerid,COLOR_RED,"†. USAGE: /login [password]");//Here we're checking if the player inputs any password, if not, it will return to him a message saying the proper usage.
  128. new file[64],PlayerName[24];//Creating a variable to store the file path, and a variable to store the players name.
  129. GetPlayerName(playerid,PlayerName,sizeof PlayerName);
  130. format(file,sizeof file,"Admin/%s.ini",PlayerName);
  131. if(!fexist(file)) return SendClientMessage(playerid,COLOR_RED,"†. Please use /register");//Checking if the player is not registered, again....
  132. INI_Open(file);//Opening the file with SII include
  133. INI_ReadString(password2,"Password");
  134. if(strcmp(password,password2) != 0) return SendClientMessage(playerid,COLOR_RED,"†. Wrong password!"),INI_Close();//Checking if he inputted the correct password, if not, retrieve him a message and closing the file;
  135. PInfo[playerid][Level] = INI_ReadInt("Level");
  136. PInfo[playerid][Cash] = INI_ReadInt("Cash");
  137. PInfo[playerid][pVip] = INI_ReadInt("pVip");
  138. PInfo[playerid][pGD] = INI_ReadInt("pGD");
  139. PInfo[playerid][pTS] = INI_ReadInt("pTS");//Setting the admin level variable, to the one thats in his file.
  140. INI_Close();//"Closing the file", that means that we're not using it anymore :P
  141. SendClientMessage(playerid,COLOR_GREEN,"†. You've been succesfully logged in. †");
  142. PInfo[playerid][Logged] = 1;//Setting the logged in variable to 1
  143. return 1;
  144. }
  145.  
  146. CMD:register(playerid, params[])
  147. {
  148. if(PInfo[playerid][Logged] == 1) return SendClientMessage(playerid,COLOR_RED,"†. You are already logged in!");//Checking if the player is logged in, if he is, it won't allow him to re-register
  149. new password[23];//Creating a variable to store the password
  150. if(sscanf(params,"s[23]",password)) return SendClientMessage(playerid,COLOR_RED,"†. USAGE: /register [password]");//Here we're checking if the player inputs any password, if not, it will return to him a message saying the proper usage.
  151. new file[64],PlayerName[24];//Creating a variable to store the file path, and a variable to store the players name.
  152. GetPlayerName(playerid,PlayerName,sizeof PlayerName);
  153. format(file,sizeof file,"Admin/%s.ini",PlayerName);
  154. if(fexist(file)) return SendClientMessage(playerid,COLOR_RED,"†. Somehow you're already registered!");//Checking if the player is already registered, again....
  155. INI_Open(file);//Opening the file with SII include (with this function, if the file is not created, it will automatically create the file.)
  156. INI_WriteString("Password",password);//Writing in the file the password the player has inputted.
  157. INI_WriteInt("Level",PInfo[playerid][Level]);
  158. INI_WriteInt("Cash",PInfo[playerid][Cash]);
  159. INI_WriteInt("pGD",PInfo[playerid][pGD]);
  160. INI_WriteInt("pTS",PInfo[playerid][pTS]);
  161. INI_WriteInt("pVip",PInfo[playerid][pVip]);//Writing in the file, the variable of the admin level.
  162. INI_Save();//After we write something to the file, we already have to use this to save the information in the player's file.
  163. INI_Close();//"Closing the file", that means that we're not using it anymore :P
  164. SendClientMessage(playerid,COLOR_GREEN,"†. You have successfully registered.");
  165. PInfo[playerid][Logged] = 1;//Setting the logged in variable to 1
  166. return 1;
  167. }
  168.  
  169. CMD:duty(playerid, params[])
  170. {
  171. if(PInfo[playerid][Level] < 1) return SendClientMessage(playerid,COLOR_RED,"You are not admin level 1.");
  172. SendClientMessage(playerid, COLOR_GREEN, "SERVER: You're now on AdminDuty. /ahelp");
  173. PInfo[playerid][Duty] = 1;
  174. return 1;
  175. }
  176.  
  177. CMD:dutyoff(playerid, params[])
  178. {
  179. if(PInfo[playerid][Level] < 1) return SendClientMessage(playerid,COLOR_RED,"You are not admin level 1.");
  180. SendClientMessage(playerid, COLOR_RED, "SERVER: You're now off AdminDuty, feel free to RP.");
  181. PInfo[playerid][Duty] = 0;
  182. return 1;
  183. }
  184.  
  185. CMD:makeadmin(playerid,params[])
  186. {
  187. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-4,"You're not an RCON admin.");//Checking if the player is rcon admin to set an admin level
  188. new id, level;//Creating the id variable to store the selected id and a level variable for the chosen admin level.
  189. if(sscanf(params,"ui",id,level)) return SendClientMessage(playerid,-1,"USAGE: /setlevel <id> <level>");//Check if the player inputted a username or id and a admin level.
  190. if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-4,"That player is not connected!");//Checking if the selected user is connected or not.
  191. new file[64],PlayerName[24];//Creating a variable to store the file path, and a variable to store the players name.
  192. GetPlayerName(id,PlayerName,sizeof PlayerName);//Retrieving the selected id's name,
  193. format(file,sizeof file,"Admin/%s.ini",PlayerName);
  194. if(!fexist(file)) return SendClientMessage(playerid,-4,"That player is not registered");//Checking if the player is not registered
  195. INI_Open(file);//Opening the file with SII include
  196. INI_WriteInt("Level",level);//Writing the line "Level" the selected admin level.
  197. INI_Save();//Saving the file
  198. INI_Close();//Closing the file
  199. PInfo[id][Level] = level;
  200. SendClientMessage(playerid,-1,"You have changed the selected user's admin level");
  201. SendClientMessage(id,COLOR_GREEN,"You've been made an Admin, use /ac to chat with other admins.");
  202. return 1;
  203. }
  204.  
  205. CMD:makevip(playerid,params[])
  206. {
  207. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-4,"You're not an RCON admin.");//Checking if the player is rcon admin to set an admin level
  208. new id, level;//Creating the id variable to store the selected id and a level variable for the chosen admin level.
  209. if(sscanf(params,"ui",id,level)) return SendClientMessage(playerid,-1,"USAGE: /makevip <id> <level>");//Check if the player inputted a username or id and a admin level.
  210. if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-4,"That player is not connected!");//Checking if the selected user is connected or not.
  211. new file[64],PlayerName[24];//Creating a variable to store the file path, and a variable to store the players name.
  212. GetPlayerName(id,PlayerName,sizeof PlayerName);//Retrieving the selected id's name,
  213. format(file,sizeof file,"Admin/%s.ini",PlayerName);
  214. if(!fexist(file)) return SendClientMessage(playerid,-4,"That player is not registered");//Checking if the player is not registered
  215. INI_Open(file);//Opening the file with SII include
  216. INI_WriteInt("pVip",level);//Writing the line "Level" the selected admin level.
  217. INI_Save();//Saving the file
  218. INI_Close();//Closing the file
  219. PInfo[id][pVip] = level;
  220. SendClientMessage(playerid,-1,"You have changed the selected user's VIP level");
  221. SendClientMessage(id,COLOR_GREEN,"You've been made an VIP, use /vc to chat with other VIP's.");
  222. return 1;
  223. }
  224.  
  225. CMD:makeminiadmin(playerid,params[])
  226. {
  227. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-4,"nigga who you think you are?");//Checking if the player is rcon admin to set an admin level
  228. new id, level;//Creating the id variable to store the selected id and a level variable for the chosen admin level.
  229. if(sscanf(params,"ui",id,level)) return SendClientMessage(playerid,-1,"USAGE: /setlevel <id> <level>");//Check if the player inputted a username or id and a admin level.
  230. if(!IsPlayerConnected(id)) return SendClientMessage(playerid,-4,"That player is not connected!");//Checking if the selected user is connected or not.
  231. new file[64],PlayerName[24];//Creating a variable to store the file path, and a variable to store the players name.
  232. GetPlayerName(id,PlayerName,sizeof PlayerName);//Retrieving the selected id's name,
  233. format(file,sizeof file,"Admin/%s.ini",PlayerName);
  234. if(!fexist(file)) return SendClientMessage(playerid,-4,"That player is not registered");//Checking if the player is not registered
  235. INI_Open(file);//Opening the file with SII include
  236. INI_WriteInt("miniadmin",level);//Writing the line "Level" the selected admin level.
  237. INI_Save();//Saving the file
  238. INI_Close();//Closing the file
  239. PInfo[id][miniadmin] = level;
  240. SendClientMessage(playerid,-1,"You have changed the selected user's miniadmin level");
  241. SendClientMessage(id,COLOR_GREEN,"You've been made an Mini-Admin, use /ac to chat with other admins.");
  242. return 1;
  243. }
  244.  
  245. CMD:a(playerid, params[])
  246. {
  247. if(PInfo[playerid][Level] == 1)
  248. {
  249. new text[124], string[124], pname[MAX_PLAYER_NAME];
  250. if(sscanf(params, "s[124]", text)) return SendClientMessage(playerid, -1, "/a [text]");
  251. GetPlayerName(playerid, pname, MAX_PLAYER_NAME);
  252. format(string, sizeof(string),"[%s] %s: %s",aLevel(playerid), pname, text);
  253. SendAdminMessage(-1, string);
  254. }
  255. return 1;
  256. }
  257.  
  258. CMD:vc(playerid, params[])
  259. {
  260. if(PInfo[playerid][pVip] >= 1) return SendClientMessage(playerid,COLOR_RED,"You are not an VIP level 1.");
  261. new string[128];
  262. if(sscanf(params, "s[80]", params)) return SendClientMessage(playerid, -1, "USAGE: /vc [text]");
  263. if(!PInfo[playerid][Level]) return SendClientMessage(playerid, COLOR_RED, "VIP's only!");
  264. new name[24];
  265. GetPlayerName(playerid, name, sizeof(name));
  266. format(string,sizeof(string), "%s %s: %s",aLevel(playerid), name,params);
  267. foreach(Player, i)
  268. {
  269. if(PInfo[i][pVip])
  270. {
  271. SendClientMessage(i, 0xFF8000FF, string);
  272. }
  273. }
  274. return 1;
  275. }
  276.  
  277. CMD:ac(playerid, params[])
  278. {
  279. if(PInfo[playerid][Level] >= 1) return SendClientMessage(playerid,COLOR_RED,"You are not admin level 1.");
  280. new string[128];
  281. if(sscanf(params, "s[80]", params)) return SendClientMessage(playerid, -1, "USAGE: /ac [text]");
  282. if(!PInfo[playerid][Level]) return SendClientMessage(playerid, COLOR_RED, "Admins only!");
  283. new name[24];
  284. GetPlayerName(playerid, name, sizeof(name));
  285. format(string,sizeof(string), "%s %s: %s",aLevel(playerid), name,params);
  286. foreach(Player, i)
  287. {
  288. if(PInfo[i][Level])
  289. {
  290. SendClientMessage(i, 0xFF8000FF, string);
  291. }
  292. }
  293. return 1;
  294. }
  295.  
  296. CMD:admins(playerid, params[])
  297. {
  298. if(IsPlayerConnected(playerid))
  299. {
  300. SendClientMessage(playerid,0xC0C0C0FF,"Admins Online:");
  301. for(new i = 0; i < MAX_PLAYERS; i++)
  302. {
  303. if(IsPlayerConnected(i))
  304. {
  305. new duty = PInfo[i][Duty];
  306. new string[128];
  307. if(PInfo[i][Level] >= 1)
  308. {
  309. new name[MAX_PLAYER_NAME];
  310. GetPlayerName(i,name,sizeof(name));
  311. if(duty == 0)
  312. {
  313. format(string,sizeof(string),"%s | %s (ID: %d) Adminduty: No",aLevel(playerid),name,i);
  314. SendClientMessage(playerid,0xC0C0C0FF,string);
  315. }
  316. if(duty == 1)
  317. {
  318. format(string,sizeof(string),"%s | %s (ID: %d) Adminduty: Yes",aLevel(playerid),name,i);
  319. SendClientMessage(playerid,0x28BA18FF,string);
  320. }
  321. }
  322. }
  323. }
  324. }
  325. return 1;
  326. }
  327.  
  328. /// NEW ADMIN CMDS ///
  329.  
  330. CMD:kick(playerid, params[])
  331. {
  332. if(PInfo[playerid][Level] >= 1) {
  333. new PID; //define the playerid we wanna kick
  334. new reason[64]; //the reason, put into a string
  335. new str[128]; //a new message string
  336. new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; //defines the function with the playername we wanna get
  337. GetPlayerName(playerid, Adminname, sizeof(Adminname)); //defines the function with the adminname we wanna get
  338. GetPlayerName(PID, Playername, sizeof(Playername));
  339. if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /kick [playerid] [reason]"); //tell sscanf if the parameters/the syntax is written wrong to return a message (PID and the reason used here)
  340.  
  341. if(!IsPlayerConnected(PID)) // if the ID is wrong or not connected, return a message! (PID used here)
  342. return SendClientMessage(playerid, COLOR_RED, "Player is not connected!");
  343.  
  344. format(str, sizeof(str), "%s has been kicked by %s %s [reason: %s] ", Playername, aLevel(playerid), Adminname, reason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
  345. SendClientMessageToAll(COLOR_RED, str); //send that message to all
  346. Kick(PID); //kick the playerid we've defined
  347.  
  348. }
  349. else //if he has not got the permissions
  350. {
  351. SendClientMessage(playerid, COLOR_RED, "You are not admin level 1."); //return this message
  352. }
  353. return 1;
  354. }
  355.  
  356. CMD:slap(playerid,params[])
  357. {
  358. if(PInfo[playerid][Level] >= 2) {
  359. new OtherPlayer, Msg[128], Name[24], Message[128], OtherPlayerName[24], Float:x, Float:y, Float:z;
  360. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "[ERROR]: You don't have access!");
  361. else if(sscanf(params, "rs[128]", OtherPlayer, Message)) return SendClientMessage(playerid,COLOR_RED, "USAGE: /slap [playerid] [reason]");
  362. GetPlayerName(playerid, Name, sizeof(Name));
  363. GetPlayerName(OtherPlayer, OtherPlayerName, sizeof(OtherPlayerName));
  364. format(Msg, sizeof(Msg), "%s has been slapped by %s %s [Reason: %s]", Name, aLevel(playerid), OtherPlayerName, Message);
  365. SendClientMessageToAll(COLOR_RED, Msg);
  366. GetPlayerPos(OtherPlayer, x, y, z);
  367. SetPlayerPos(OtherPlayer, x, y, z+5);
  368.  
  369. }
  370. else //if he has not got the permissions
  371. {
  372. SendClientMessage(playerid, COLOR_RED, "You are not admin level 2."); //return this message
  373. }
  374.  
  375. return 1;
  376. }
  377.  
  378. CMD:bitchslap(playerid,params[])
  379. {
  380. if(PInfo[playerid][Level] >= 11) {
  381. new OtherPlayer, Msg[128], Name[24], Message[128], OtherPlayerName[24], Float:x, Float:y, Float:z;
  382. if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid, 0xFFFFFFFF, "[ERROR]: You don't have access!");
  383. else if(sscanf(params, "rs[128]", OtherPlayer, Message)) return SendClientMessage(playerid,COLOR_RED, "USAGE: /bitchslap [playerid] [reason]");
  384. GetPlayerName(playerid, Name, sizeof(Name));
  385. GetPlayerName(OtherPlayer, OtherPlayerName, sizeof(OtherPlayerName));
  386. format(Msg, sizeof(Msg), "%s has been bitch slapped by %s %s [Reason: %s]", Name, aLevel(playerid), OtherPlayerName, Message);
  387. SendClientMessageToAll(COLOR_RED, Msg);
  388. GetPlayerPos(OtherPlayer, x, y, z);
  389. SetPlayerPos(OtherPlayer, x, y, z+30);
  390.  
  391. }
  392. else //if he has not got the permissions
  393. {
  394. SendClientMessage(playerid, COLOR_RED, "You are not admin level 11."); //return this message
  395. }
  396.  
  397. return 1;
  398. }
  399.  
  400. CMD:setskin(playerid, params[])
  401. {
  402. if(PInfo[playerid][Level] >= 11) {
  403. new name[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME], id, skinid, string[128];
  404. if(!IsPlayerAdmin(playerid)) return 0;
  405. if(sscanf(params, "ui", id, skinid)) return SendClientMessage(playerid, -1, "USAGE: /setskin [playerid] [skinid]");
  406. GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  407. GetPlayerName(id, targetname, MAX_PLAYER_NAME);
  408. if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Player not connected!");
  409. SetPlayerSkin(id, skinid);
  410. format(string, 128, "Admin %s(%d) has set your skinid to %i", name, playerid, skinid);
  411. SendClientMessage(id, -1, string);
  412. format(string, 128, "You set %s(%d) skin to skinid %i", targetname, id, skinid);
  413. SendClientMessage(playerid, -1, string);
  414.  
  415. }
  416. else //if he has not got the permissions
  417. {
  418. SendClientMessage(playerid, COLOR_RED, "You are not admin level 11."); //return this message
  419. }
  420.  
  421. return 1;
  422. }
  423.  
  424. CMD:warn(playerid, params[])
  425. {
  426. if(PInfo[playerid][Level] >= 1) {
  427. {
  428. new name[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME],string[128],id,reason[64];
  429. if(sscanf(params,"uds[64]",id,reason)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /warn [playerid] [reason]");
  430. GetPlayerName(id,name, sizeof(name));
  431. GetPlayerName(id,name2, sizeof(name2));
  432. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED, "SERVER: User is not connected.");
  433. format(string, sizeof(string), "%s has been warned by %s %s [Reason: %s]",name2, aLevel(playerid), name, reason);
  434. SendClientMessageToAll(COLOR_RED,string);
  435. SendClientMessage(id, COLOR_RED, "SERVER: You warned by %s, keep on your thing and you'll be punished harder.", name);
  436. }
  437.  
  438. }
  439. else
  440. {
  441. SendClientMessage(playerid, COLOR_RED, "You are not admin level 1.");
  442. }
  443. return 1;
  444. }
  445.  
  446. CMD:ajail(playerid, params[])
  447. {
  448. if(PInfo[playerid][Level] >= 5) {
  449. {
  450. new name[MAX_PLAYER_NAME],name2[MAX_PLAYER_NAME],string[128],id,reason[64],time;
  451. if(sscanf(params,"uds[64]",id,time,reason)) return SendClientMessage(playerid,COLOR_RED,"USAGE: /ajail [playerid] [minutes] [reason]");
  452. GetPlayerName(playerid,name, sizeof(name));
  453. GetPlayerName(id,name2, sizeof(name2));
  454. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_RED,"CMD: Invalid playerid.");
  455. format(string, sizeof(string), "%s has been ajailed by %s %s for %d minutes [Reason: %s]", name2, aLevel(playerid), name,time,reason);
  456. SendClientMessageToAll(COLOR_RED,string);
  457. SetPlayerPos(id,198.5924,161.7369,1003.0300,182.9884);
  458. } // Administrator Noles2197 admin jailed Noles2197 minutes for 60 dm."
  459.  
  460. }
  461. else //if he has not got the permissions
  462. {
  463. SendClientMessage(playerid, COLOR_RED, "You are not admin level 5."); //return this message
  464. }
  465. return 1;
  466. }
  467.  
  468. CMD:setcash(playerid, params[])
  469. {
  470. new pID, cash;
  471. if(PInfo[playerid][Level] >= 7) {
  472. {
  473. if(sscanf(params, "ud", pID, cash)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /setcash [playerid] [amount of money]");
  474. if(!IsPlayerConnected(pID)) return SendClientMessage(playerid, COLOR_RED, "This player is not connected");
  475. ResetPlayerMoney(pID);
  476. return GivePlayerMoney(pID,cash);
  477. }
  478.  
  479. }
  480. else //if he has not got the permissions
  481. {
  482. SendClientMessage(playerid, COLOR_RED, "You are not admin level 7."); //return this message
  483. }
  484.  
  485. return 1;
  486. }
  487.  
  488.  
  489. CMD:ban(playerid, params[])
  490. {
  491. if(PInfo[playerid][Level] >= 4) {
  492. new PID; //define the playerid we wanna ban
  493. new reason[64]; //the reason, put into a string
  494. new str[128]; //a new message string
  495. new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; //defines the function with the playername we wanna get
  496. GetPlayerName(playerid, Adminname, sizeof(Adminname)); //defines the function with the adminname we wanna get
  497. GetPlayerName(PID, Playername, sizeof(Playername));
  498. if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, COLOR_RED, "USAGE: /ban [playerid] [reason]"); //tell sscanf if the parameters/the syntax is written wrong to return a message (PID and the reason used here)
  499.  
  500. if(!IsPlayerConnected(PID)) // if the ID is wrong or not connected, return a message! (PID used here)
  501. return SendClientMessage(playerid, COLOR_RED, "Player is not connected!");
  502.  
  503. format(str, sizeof(str), "%s has been banned by %s %s [reason: %s] ", Playername, aLevel(playerid), Adminname, reason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
  504. SendClientMessageToAll(COLOR_RED, str); //send that message to all
  505. Ban(PID); //Ban the playerid we've defined
  506.  
  507. }
  508. else //if he has not got the permissions
  509. {
  510. SendClientMessage(playerid, COLOR_RED, "You are not admin level 4."); //return this message
  511. }
  512. return 1;
  513. }
  514.  
  515.  
  516. /// END OF NEW ADMIN CMDS ///
  517.  
  518. //// STOCKS AND STRINGS /////
  519.  
  520.  
  521. SendAdminMessage(color, const string[])
  522. {
  523. new playerid;
  524. foreach(Player, i)
  525. {
  526. if(PInfo[playerid][Level])
  527. {
  528. SendClientMessage(i, color, string);
  529. }
  530. }
  531. return 1;
  532. }
  533.  
  534. stock aLevel(playerid)
  535. {
  536. new svString[120];
  537.  
  538. switch (PInfo[playerid][Level])
  539. {
  540. case 1: svString = "Trial Admin";
  541. case 2: svString = "Junior Admin";
  542. case 3: svString = "Low Admin";
  543. case 4: svString = "Admin";
  544. case 5: svString = "High Admin";
  545. case 6: svString = "Experienced Admin";
  546. case 7: svString = "Senior Admin";
  547. case 8: svString = "Top Admin";
  548. case 9: svString = "Lead Admin";
  549. case 10: svString = "Head Admin";
  550. case 11: svString = "Server Owner";
  551. }
  552. return svString;
  553. }
  554.  
  555. stock vLevel(playerid)
  556. {
  557. new svString[120];
  558.  
  559. switch (PInfo[playerid][pVip])
  560. {
  561. case 1: svString = "Bronze VIP";
  562. case 2: svString = "Silver VIP";
  563. case 3: svString = "Gold VIP";
  564. }
  565. return svString;
  566. }
  567.  
  568. stock mLevel(playerid)
  569. {
  570. new svString[120];
  571.  
  572. switch (PInfo[playerid][miniadmin])
  573. {
  574. case 1: svString = "Mini Admin";
  575. case 2: svString = "Low Mini Admin";
  576. case 3: svString = "Head Mini Admin";
  577. }
  578. return svString;
  579. }
  580.  
  581. stock SendToAdmins(COLOR,message[])
  582. {
  583. new string[128];
  584. for(new i = 0; < MAX_PLAYERS; i++)
  585. if(PInfo[i][Level] > 1)
  586. {
  587. SendClientMessage(i,COLOR,message);
  588. }
  589. return 0;
  590. }
  591.  
  592. public OnPlayerUpdate(playerid)
  593. {
  594. SetPlayerScore(playerid, GetPlayerMoney(playerid));
  595. return 1;
  596. }
  597.  
  598. ///
  599.  
  600. #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement