Advertisement
Guest User

NAdmin

a guest
Oct 26th, 2012
533
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 48.74 KB | None | 0 0
  1. //Includes
  2. #include <a_samp>
  3. #include <YSI\y_ini>
  4. #include <zcmd>
  5. #include <sscanf2>
  6.  
  7. //Command Use
  8. #define dcmd(%1,%2,%3) if ((strcmp((%3)[1], #%1, true, (%2)) == 0) && ((((%3)[(%2) + 1] == 0) && (dcmd_%1(playerid, "")))||(((%3)[(%2) + 1] == 32) && (dcmd_%1(playerid, (%3)[(%2) + 2]))))) return 1
  9.  
  10.  
  11. //Login Register System
  12. #define DIALOG_REGISTER 1
  13. #define DIALOG_LOGIN 2
  14. #define DIALOG_SUCCESS_1 3
  15. #define DIALOG_SUCCESS_2 4
  16.  
  17. //Save Path
  18. #define PATH "/NAdmin/Users/%s.ini"
  19. #define reportPATH "/NAdmin/Config/ReportLog.txt" //directory for reports, in the folder "scriptfiles"
  20.  
  21. //Colors
  22. #define COL_WHITE "{FFFFFF}"
  23. #define COL_RED "{F81414}"
  24. #define COL_GREEN "{00FF22}"
  25. #define COL_LIGHTBLUE "{00CED1}"
  26.  
  27. //COLORS 2
  28. #define COLOR_GREEN 0x008000FF
  29. #define COLOR_BLUE 0x0000FFFF
  30. #define COLOR_BRIGHTRED 0xFF000AAA
  31. #define COLOR_AQUA 0x00FFFFAA
  32. #define COLOR_GREY 0xAFAFAFAA
  33. #define COLOR_BEIGE 0xFFF8DCAA
  34. #define COLOR_BLACK 0x000000AA
  35. #define COLOR_LIGHTERBLUE 0x00BFFFAA
  36. #define COLOR_BLUELIGHT 0x1E90FFAA
  37. #define COLOR_BLUEMEDIUM 0x0000CDAA
  38. #define COLOR_BLUEDARK 0x00008BAA
  39. #define COLOR_PINK 0xFF1493AA
  40. #define COLOR_PINKDARK 0xFF00FFAA
  41. #define COLOR_GREENLIGHT 0x00FF00AA
  42. #define COLOR_GREENDARK 0x006400AA
  43. #define COLOR_MAROON 0x800000AA
  44. #define COLOR_OKER 0x808000AA
  45. #define COLOR_ORANGE 0xFF4500AA
  46. #define COLOR_ORANGELIGHT 0xFF8C00AA
  47. #define COLOR_PURPLE 0x800080AA
  48. #define COLOR_VIOLETDARK 0x9400D3AA
  49. #define COLOR_INDIGO 0xAB0082AA
  50. #define COLOR_RED 0xFF0000AA
  51. #define COLOR_SAND 0xFFDEADAA
  52. #define COLOR_SILVER 0xC0C0C0AA
  53. #define COLOR_TEAL 0x008080AA
  54. #define COLOR_WHITE 0xFFFFFFAA
  55. #define COLOR_YELLOW 0xFFFF00AA
  56. #define COLOR_GOLD 0xFFD700AA
  57. #define COLOR_BROWN 0x8B4513AA
  58. #define COLOR_BROWNLIGHT 0xA0522DAA
  59. #define COLOR_GRAY 0xA9A9A9AA
  60. #define COLOR_GRAYDARK 0x696969AA
  61. #define COLOR_INVISIBLE 0xFFFFFF00
  62. #define COLOR_INDIA 0x80000096
  63. #define COLOR_PAKISTAN 0x40808096
  64. #define COLOR_NEPAL 0x8000FF96
  65. #define COLOR_BRAZIL 0xB7B70096
  66. #define COLOR_CHINA 0x80808096
  67. #define COLOR_GREECE 0x00000096
  68. #define COLOR_SINGAPORE 0x00FFFF96
  69. #define COLOR_IRAQ 0x8080C096
  70.  
  71. //Admin Command Variables
  72. #define MAX_WARNINGS 3
  73.  
  74. //Admin Level
  75.  
  76.  
  77.  
  78. //Cmd Variables
  79.  
  80. //Server Messages
  81. forward SendRandomMsgToAll();
  82.  
  83. //Vip System
  84. new vip[MAX_PLAYERS];
  85.  
  86. //Admin System
  87. new AdminLevel[MAX_PLAYERS];
  88. new Warns[MAX_PLAYERS];
  89.  
  90. enum pInfo
  91. {
  92. pPass,
  93. pCash,
  94. pAdmin,
  95. pKills,
  96. pDeaths,
  97. pScore
  98.  
  99. }
  100. new PlayerInfo[MAX_PLAYERS][pInfo];
  101.  
  102. forward LoadUser_data(playerid,name[],value[]);
  103. public LoadUser_data(playerid,name[],value[])
  104. {
  105. INI_Int("Password",PlayerInfo[playerid][pPass]);
  106. INI_Int("Cash",PlayerInfo[playerid][pCash]);
  107. INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  108. INI_Int("Kills",PlayerInfo[playerid][pKills]);
  109. INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
  110. INI_Int("Donor",vip[playerid]);
  111. INI_Int("Score",PlayerInfo[playerid][pScore]);
  112.  
  113. return 1;
  114. }
  115.  
  116. stock UserPath(playerid)
  117. {
  118. new string[128],playername[MAX_PLAYER_NAME];
  119. GetPlayerName(playerid,playername,sizeof(playername));
  120. format(string,sizeof(string),PATH,playername);
  121. return string;
  122. }
  123.  
  124. stock udb_hash(buf[]) {
  125. new length=strlen(buf);
  126. new s1 = 1;
  127. new s2 = 0;
  128. new n;
  129. for (n=0; n<length; n++)
  130. {
  131. s1 = (s1 + buf[n]) % 65521;
  132. s2 = (s2 + s1) % 65521;
  133. }
  134. return (s2 << 16) + s1;
  135. }
  136.  
  137. main()
  138. {
  139. print("\n----------------------------------");
  140. print(" Blank Gamemode by your name here");
  141. print("----------------------------------\n");
  142. }
  143. public SendRandomMsgToAll()
  144. {
  145. switch(random(4))// "switch - case" is a sort of "if - else if - else" statement (operator?)
  146. {
  147. case 1: SendClientMessageToAll(COLOR_RED, "Please Type /help To Get Help From Server");
  148. case 2: SendClientMessageToAll(COLOR_RED, "Please Type /cmds To Know Server Commands!");
  149. case 3: SendClientMessageToAll(COLOR_RED, "Please Respect Everyone In Server.");
  150. case 4: SendClientMessageToAll(COLOR_RED, "Welcome To Our Server And As You Are New These Are The Basics You Need To Know.");
  151.  
  152. }
  153.  
  154. }
  155.  
  156.  
  157.  
  158.  
  159. public OnFilterScriptInit()
  160. {
  161. print("\n--------------------------------------");
  162. print(" Nirzor's Admin System V1.5 ");
  163. print("--------------------------------------\n");
  164. SetTimer("SendRandomMsgToAll", 60 * 1000, 1);
  165. return 1;
  166. }
  167.  
  168. public OnFilterScriptExit()
  169. {
  170. return 1;
  171. }
  172.  
  173. public OnPlayerRequestClass(playerid, classid)
  174. {
  175. return 1;
  176. }
  177.  
  178. public OnPlayerConnect(playerid)
  179. {
  180. if(fexist(UserPath(playerid)))
  181. {
  182. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  183. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_WHITE"Please Type Your Desired Password To Log In.","Login","Quit");
  184. }
  185. else
  186. {
  187. ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_WHITE"Registering...",""COL_WHITE"Please Type A Password To Register An Account.","Register","Quit");
  188. }
  189. return 1;
  190. }
  191.  
  192. public OnPlayerDisconnect(playerid, reason)
  193. {
  194. new INI:File = INI_Open(UserPath(playerid));
  195. INI_SetTag(File,"data");
  196. INI_WriteInt(File,"Cash",GetPlayerMoney(playerid));
  197. INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
  198. INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
  199. INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
  200. INI_WriteInt(File,"Donor",vip[playerid]);
  201. INI_WriteInt(File,"Score",GetPlayerScore(playerid));
  202. INI_Close(File);
  203. return 1;
  204. }
  205.  
  206. public OnPlayerSpawn(playerid)
  207. {
  208. return 1;
  209. }
  210.  
  211. public OnPlayerDeath(playerid, killerid, reason)
  212. {
  213. PlayerInfo[killerid][pKills]++;
  214. PlayerInfo[playerid][pDeaths]++;
  215. return 1;
  216. }
  217.  
  218. public OnVehicleSpawn(vehicleid)
  219. {
  220. return 1;
  221. }
  222.  
  223. public OnVehicleDeath(vehicleid, killerid)
  224. {
  225. return 1;
  226. }
  227.  
  228. public OnPlayerText(playerid, text[])
  229. {
  230. return 1;
  231. }
  232.  
  233. public OnPlayerCommandText(playerid, cmdtext[])
  234. {
  235. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  236. {
  237. // Do something here
  238. return 1;
  239. }
  240. return 0;
  241. }
  242.  
  243. #if defined USE_STATS
  244. CMD:stats(playerid,params[]) {
  245. new string[256], pDeaths, player1, h, m, s,playername[MAX_PLAYER_NAME];
  246. if(isnull(params)) player1 = playerid;
  247. else player1 = strval(params);
  248.  
  249. if(IsPlayerConnected(player1)) {
  250. TotalGameTime(player1, h, m, s);
  251. GetPlayerName(player1, playername, sizeof(playername));
  252. if(PlayerInfo[player1][Deaths] == 0) pDeaths = 1; else pDeaths = PlayerInfo[player1][Deaths];
  253. format(string,sizeof(string),"{F9FF88}|-| %s's Stats |-|\n \nScores: %d\n \nKills %d\n \nDeaths %d\n \nRatio: %0.2f\n \nMoney: $%d\n \nAdmin Level: %d\n \nModerator: %d\n \nTime: %d hrs %d mins %d secs\n \nFor other information use /stats!",playername, GetPlayerScore(player1), PlayerInfo[player1][Kills], PlayerInfo[player1][Deaths], Float:PlayerInfo[player1][Kills]/Float:pDeaths, GetPlayerMoney(player1), PlayerInfo[player1][Level], PlayerInfo[player1][Helper], h, m, s);
  254. return ShowPlayerDialog(playerid, 11111,DIALOG_STYLE_MSGBOX,"{FFFF00}Player Status",string,"Close","");
  255. } else return SendClientMessage(playerid, red, "Player Not Connected!");
  256. }
  257. #endif
  258. CMD:helpme(playerid, params[])
  259. {
  260. new str[128], Name1[MAX_PLAYER_NAME];
  261. if(sscanf(params,"s", str))
  262. {
  263. SendClientMessage(playerid, COLOR_RED,"CORRECT USAGE: /helpme [text]");
  264. return 1;
  265. }
  266. GetPlayerName(playerid, Name1, sizeof(Name1));
  267. format(str, sizeof(str),"{00FFFF}[HELP MSG From %s]:{00FFF0} %s",Name1, str);
  268. MessageToTwice(COLOR_RED, str);
  269. SendClientMessage(playerid, COLOR_YELLOW,"Your Request has been sent to online Administrators.");
  270. return 1;
  271. }
  272. CMD:heal(playerid, params[])
  273. {
  274. if(PlayerInfo[playerid][pAdmin] >= 3)
  275. {
  276. SetPlayerHealth(playerid, 100); //if he's allowed, restore his health
  277. SendClientMessage(playerid, COLOR_GREEN, "Your Health Has Been Restored To 100"); // and send him the success-message
  278. CMDMessageToAdmins(playerid,"HEAL");
  279. }
  280. else
  281. {
  282. SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!"); // if not, send him only the following message
  283. }
  284. return 1;
  285. }
  286. CMD:kick(playerid, params[])
  287. {
  288. if(PlayerInfo[playerid][pAdmin] >= 1) {
  289. new PID; //define the playerid we wanna kick
  290. new reason[64]; //the reason, put into a string
  291. new str[128]; //a new message string
  292. new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; //defines the function with the playername we wanna get
  293. GetPlayerName(playerid, Adminname, sizeof(Adminname)); //defines the function with the adminname we wanna get
  294. GetPlayerName(PID, Playername, sizeof(Playername));
  295. if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /kick [playerid] [reason]"); //tell sscanf if the parameters/the syntax is written wrong to return a message (PID and the reason used here)
  296.  
  297. if(!IsPlayerConnected(PID)) // if the ID is wrong or not connected, return a message! (PID used here)
  298. return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
  299.  
  300. format(str, sizeof(str), "'%s' Has Been Kicked By Administrator '%s'. Reason: %s ", Playername, Adminname, reason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
  301. SendClientMessageToAll(COLOR_RED, str); //send that message to all
  302. CMDMessageToAdmins(playerid,"KICK");
  303. Kick(PID); //kick the playerid we've defined
  304.  
  305. }
  306. else //if he has not got the permissions
  307. {
  308. SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!"); //return this message
  309. }
  310. return 1;
  311. }
  312. CMD:ban(playerid, params[])
  313. {
  314. if(PlayerInfo[playerid][pAdmin] >= 2) {
  315. new PID; //define the playerid we wanna ban
  316. new reason[64]; //the reason, put into a string
  317. new str[128]; //a new message string
  318. new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME]; //defines the function with the playername we wanna get
  319. GetPlayerName(playerid, Adminname, sizeof(Adminname)); //defines the function with the adminname we wanna get
  320. GetPlayerName(PID, Playername, sizeof(Playername));
  321. if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, COLOR_GREY, "USAGE: /ban [playerid] [reason]"); //tell sscanf if the parameters/the syntax is written wrong to return a message (PID and the reason used here)
  322.  
  323. if(!IsPlayerConnected(PID)) // if the ID is wrong or not connected, return a message! (PID used here)
  324. return SendClientMessage(playerid, COLOR_GREY, "Player is not connected!");
  325.  
  326. format(str, sizeof(str), "'%s' Has Been Banned By Administrator '%s'. Reason: %s ", Playername, Adminname, reason); //format the string we've defined to send the message, playername and adminname are used to receive the information about the names
  327. SendClientMessageToAll(COLOR_RED, str); //send that message to all
  328. CMDMessageToAdmins(playerid,"BAN");
  329. Ban(PID); //Ban the playerid we've defined
  330.  
  331. }
  332. else //if he has not got the permissions
  333. {
  334. SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!"); //return this message
  335. }
  336. return 1;
  337. }
  338. COMMAND:freeze(playerid,params[])
  339. {
  340. if(PlayerInfo[playerid][pAdmin] >= 3)
  341. {
  342. new Target; //defines the playerid we wanna freeze
  343. if(sscanf(params, "u", Target)) SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /freeze [playerid]"); //tell sscanf again if the parameters/syntax is wrong to return a special message
  344. if(!IsPlayerConnected(Target)) //if the ID doesn't exist, return an error-message
  345. return SendClientMessage(playerid, COLOR_RED, "ERROR:Player Is Not Connected!");
  346. if(!sscanf(params, "u", Target))
  347. {
  348. new tname[MAX_PLAYER_NAME]; //define the new target-name of the playerid
  349. GetPlayerName(Target,tname,sizeof(tname)); //get the playername with this function
  350. new pname[MAX_PLAYER_NAME]; //define the adminname
  351. GetPlayerName(playerid,pname,sizeof(pname)); //get the adminname with this function
  352. new tstring[128]; //define the string for the player (victim)
  353. new pstring[128];// define the string for the admin which is performing
  354. new astring[128];//define the string for all the players which are online
  355. format(tstring,sizeof(tstring),"You have been frozen by administrator %s! You cant move!",pname); //this is formatting the player-string, while it's also getting the adminname
  356. format(pstring,sizeof(pstring),"You have frozen player %s(%d)!",tname,Target); //this is formatting the adminname-string, while it's also getting the playername and his ID(target)
  357. format(astring,sizeof(astring),"Administrator %s has frozen %s!",pname,tname); //this is formatting the all-string, while it's sending this message to everybody and is getting admin- and playername
  358. SendClientMessage(Target,COLOR_GOLD,tstring);//sends the message to the victim
  359. SendClientMessage(playerid,COLOR_GREEN,pstring);//sends the message to the admin
  360. SendClientMessageToAll(COLOR_BLUE,astring);//sends the message to everybody
  361. TogglePlayerControllable(Target,0); //with that function, the player won't be able to mov, while we're using the variable "Target" as the playerid
  362. CMDMessageToAdmins(playerid,"FREEZE");
  363. }
  364.  
  365. }
  366.  
  367. // if he doesn't have permissions, return that message!
  368. else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-3 Administrator to use this command!");
  369. return 1;
  370. }
  371.  
  372. COMMAND:car(playerid,params[])
  373. {
  374. if(PlayerInfo[playerid][pAdmin] >=2)
  375. {
  376. new car;
  377. if(IsPlayerInAnyVehicle(playerid)) return 1;
  378. if(sscanf(params, "i", car)) return SendClientMessage(playerid, COLOR_ORANGE, "USE: /v(ehicle) [id_vehicle]");
  379. if(strval(params) >611 || strval(params) <400) return SendClientMessage(playerid, COLOR_GREY, "That id doesn't exist!");
  380. new Float:x, Float:y, Float:z, Float:a;
  381. GetPlayerPos(playerid, x,y,z);
  382. GetPlayerFacingAngle(playerid, a);
  383. car = CreateVehicle(strval(params), x, y, z,a, -1, -1, 60);
  384. PutPlayerInVehicle(playerid, car, 0);
  385. CMDMessageToAdmins(playerid,"CAR");
  386. }
  387. else
  388. {
  389. Error2(playerid);
  390. }
  391. return 1;
  392. }
  393.  
  394. COMMAND:fix(playerid,params[])
  395. {
  396. if(PlayerInfo[playerid][pAdmin] >=1)
  397. {
  398. new pla;
  399. if(sscanf(params,"u",pla)) return SendClientMessage(playerid, COLOR_ORANGE, "USE: /repair [ID]");
  400. RepairVehicle(GetPlayerVehicleID(playerid));
  401. SendClientMessage(playerid, COLOR_GREY, "Your car is fixed!");
  402. CMDMessageToAdmins(playerid,"FIX");
  403. }
  404. else
  405. {
  406. Error1(playerid);
  407. }
  408. return 1;
  409. }
  410.  
  411. COMMAND:admins(playerid,params[])
  412. {
  413. if(IsPlayerConnected(playerid))
  414. {
  415. SendClientMessage(playerid, COLOR_ORANGE, " ");
  416. SendClientMessage(playerid, COLOR_ORANGE, "-| ADMINS |-");
  417. for(new i = 0; i < MAX_PLAYERS; i++)
  418. {
  419. if(IsPlayerConnected(i))
  420. {
  421. if(PlayerInfo[i][pAdmin] >= 1 && PlayerInfo[i][pAdmin] < 1341)
  422. {
  423. new admtext[64];
  424. new sendername[MAX_PLAYER_NAME];
  425. new string[256];
  426. if(PlayerInfo[i][pAdmin] == 1) { admtext = "Level-1 Trial Admin"; }
  427. else if(PlayerInfo[i][pAdmin] == 2) { admtext = "Level-2 Moderator"; }
  428. else if(PlayerInfo[i][pAdmin] == 3) { admtext = "Level-3 Lead Moderator"; }
  429. else if(PlayerInfo[i][pAdmin] == 4) { admtext = "Level-4 Senior Administrator"; }
  430. else if(PlayerInfo[i][pAdmin] == 5) { admtext = "Level-5 Master Administrator"; }
  431. else if(PlayerInfo[i][pAdmin] == 6) { admtext = "Level-6 Global Administrator"; }
  432. else if(PlayerInfo[i][pAdmin] == 7) { admtext = "Level-7 Co-Owner"; }
  433. else if(PlayerInfo[i][pAdmin] == 8) { admtext = "level-8 Owner"; }
  434. else { admtext = "Gamemoderator"; }
  435. GetPlayerName(i, sendername, sizeof(sendername));
  436. format(string, 256, "%s ( %s )", sendername, admtext);
  437. SendClientMessage(playerid, COLOR_GREEN, string);
  438. }
  439. }
  440. }
  441. }
  442. return 1;
  443. }
  444.  
  445. COMMAND:unfreeze(playerid,params[])
  446. {
  447. if(PlayerInfo[playerid][pAdmin] >= 3)
  448. {
  449. new Target; //defines the playerid we wanna unfreeze
  450. if(sscanf(params, "u", Target)) SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /unfreeze [playerid]"); //tell sscanf again if the parameters/syntax is wrong to return a special message
  451. if(!IsPlayerConnected(Target)) //if the ID doesn't exist, return an error-message
  452. return SendClientMessage(playerid, COLOR_GREY, "ERROR:Player is not connected!");
  453. if(!sscanf(params, "u", Target))
  454. {
  455. new tname[MAX_PLAYER_NAME]; //define the new target-name of the playerid
  456. GetPlayerName(Target,tname,sizeof(tname)); //get the playername with this function
  457. new pname[MAX_PLAYER_NAME]; //define the adminname
  458. GetPlayerName(playerid,pname,sizeof(pname)); //get the adminname with this function
  459. new tstring[128]; //define the string for the player (victim)
  460. new pstring[128];// define the string for the admin which is performing
  461. new astring[128];//define the string for all the players which are online
  462. format(tstring,sizeof(tstring),"You have been unfrozen by administrator %s! You cant move!",pname); //this is formatting the player-string, while it's also getting the adminname
  463. format(pstring,sizeof(pstring),"You have unfrozen player %s(%d)!",tname,Target); //this is formatting the adminname-string, while it's also getting the playername and his ID(target)
  464. format(astring,sizeof(astring),"Administrator %s has unfrozen %s!",pname,tname); //this is formatting the all-string, while it's sending this message to everybody and is getting admin- and playername
  465. SendClientMessage(Target,COLOR_GOLD,tstring);//sends the message to the victim
  466. SendClientMessage(playerid,COLOR_GREEN,pstring);//sends the message to the admin
  467. SendClientMessageToAll(COLOR_BLUE,astring);//sends the message to everybody
  468. TogglePlayerControllable(Target,1); //with that function, the player will be able to move again, while we're using the variable "Target" as playerid again
  469. CMDMessageToAdmins(playerid,"UNFREEZE");
  470. }
  471. else
  472. {
  473. Error3(playerid);
  474. }
  475.  
  476. }
  477.  
  478. // if he doesn't have permissions, return that message!
  479.  
  480. else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-3 Administrator to use this command!");
  481. return 1;
  482. }
  483. COMMAND:clearchat(playerid,params[])
  484. {
  485. if( PlayerInfo[ playerid ][ pAdmin ] < 1 ) return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-1 Administrator to use this command!");
  486. {
  487. for( new i = 0; i <= 100; i ++ ) SendClientMessageToAll( COLOR_BLUE,"Main Chat Has Been Cleared" );
  488. }
  489. return 1;
  490. }
  491. CMD:pm(playerid, params[])
  492. {
  493. new str[256], str2[256], id, Name1[MAX_PLAYER_NAME], Name2[MAX_PLAYER_NAME];
  494. if(sscanf(params, "us", id, str2))
  495. {
  496. SendClientMessage(playerid, 0xFF0000FF, "Usage: /pm <id> <message>");
  497. return 1;
  498. }
  499. if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: Player not connected");
  500. if(playerid == id) return SendClientMessage(playerid, 0xFF0000FF, "ERROR: You cannot pm yourself!");
  501. {
  502. GetPlayerName(playerid, Name1, sizeof(Name1));
  503. GetPlayerName(id, Name2, sizeof(Name2));
  504. format(str, sizeof(str), "PM To %s(ID %d): %s", Name2, id, str2);
  505. SendClientMessage(playerid, 0xFF0000FF, str);
  506. format(str, sizeof(str), "PM From %s(ID %d): %s", Name1, playerid, str2);
  507. SendClientMessage(id, 0xFF0000FF, str);
  508. }
  509. return 1;
  510. }
  511. COMMAND:report(playerid,params[])
  512. {
  513.  
  514. new Target; //define the target's name
  515. new Reason[128];//the report-reason
  516. if(!sscanf(params, "us[32]",Target, Reason))
  517. {
  518. if(Target == playerid) return SendClientMessage(playerid, COLOR_RED, "SERVER: Cant perform this command on yourself!"); //comment this line if you want to try this cmd on yourself
  519. if(!IsPlayerConnected(Target)) //if the ID is invalid
  520. return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected!"); //send the player a message, that the ID doesn't exist
  521.  
  522. new tname[MAX_PLAYER_NAME]; //the name of player one (reporting)
  523. new pname[MAX_PLAYER_NAME]; //the name of player two (the reported)
  524. GetPlayerName(Target,tname,sizeof(tname)); //get (receive) the player's name for the first
  525. GetPlayerName(playerid,pname,sizeof(pname)); //get (receive) the player's name for the second
  526.  
  527. new rstring[256]; //the report-string
  528. format(rstring,sizeof(rstring),"* Player %s(%d) reported %s(%d)! (Reason: %s)", pname,playerid,tname,Target,Reason); //only admins will receive this message! a specific player with a reason got reported, here we'll use all variables created
  529. SendMessageToAdmins(COLOR_WHITE,rstring); //we'll talk about that later
  530.  
  531. //NOW HERE, we'll open the reportpath and WRITE into it
  532. new File:Log = fopen(reportPATH, io_append); //here you're opening the path defined
  533. new logData[128]; //create the logdata we wanna write in
  534. new name[MAX_PLAYER_NAME]; //define the name again
  535. GetPlayerName(Target,name,sizeof(name)); //receive the name again
  536. new fTime[6]; //create the specific time for the report
  537. getdate(fTime[0], fTime[1], fTime[2]); //get the report's date
  538. gettime(fTime[3], fTime[4], fTime[5]); //get the report's time
  539. format(logData, sizeof logData, "[%02d/%02d/%04d || %02d:%02d:%02d]%s got reported by %s! (Reason: %s)\r\n", fTime[2], fTime[1], fTime[0], fTime[3], fTime[4], fTime[5], tname, pname, Reason); //this will write everything (name,reason,time,date etc.) into the logdata
  540. fwrite(Log, logData); //write it into the path
  541. fclose(Log); //close the log, finished!
  542. }
  543. else return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /report <playerid> <reason>"); //detects the wrong params from sscanf and send the client this message
  544.  
  545. return 1;
  546. }
  547. forward SendMessageToAdmins(color,const string[]);
  548. public SendMessageToAdmins(color,const string[]) //create the callback, including color and string
  549. {
  550. for(new i = 0; i < MAX_PLAYERS; i++) //set a for-loop and loop through all the admins
  551. {
  552. if(IsPlayerConnected(i) == 1) //the admin gotta be connected
  553. if(PlayerInfo[i][pAdmin] >= 1) //and his level gotta be at least 1 (or higher)
  554. SendClientMessage(i, color, string); //send this message now to every admin online, with color + string!
  555. }
  556. return 1;
  557. }
  558. CMD:acar(playerid, params[])
  559. {
  560. if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!");
  561. //here, you'll have to put in again the variables of your enum of the playerinfo, to check the required adminlevel
  562.  
  563. new Float:x, Float:y, Float:z, Float:angle; //create the position of the player, which can be anywhere
  564. GetPlayerPos(playerid, x, y, z); //get the player's position, to know where the car should be put
  565. GetPlayerFacingAngle(playerid, angle); //get the player's angle, to put the car in the right angle
  566. new veh = CreateVehicle(429, x, y, z, angle, 0, 0, 60); //in the variable "veh", you're storing and creating a vehicle now!
  567. //429 is the ID of the car, "0" is the color (black)! change it simply later, I'mma give you a link
  568. PutPlayerInVehicle(playerid, veh, 0); //this function will put the player into the created vehicle
  569. ChangeVehicleColor(429, 0, 1); //this will change the vehicle color to black (and white), surely!
  570. CMDMessageToAdmins(playerid,"ACAR");
  571. return 1;
  572. }
  573. CMD:fakechat(playerid,params[])
  574. {
  575. if(PlayerInfo[playerid][pAdmin] >= 5) //put your admin-variable from your on enum of the playerinfo here again!
  576. {
  577. new Target; //the player which'll get "blamed"
  578. new Msg[128]; //the string for the message
  579. if(sscanf(params, "us[50]", Target,Msg)) SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /fakechat [playerid] [message]"); //returns the right params if you've written it wrong
  580. if(!IsPlayerConnected(Target)) //check if the ID is valid, if not
  581. return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected!"); //send the player such a message
  582.  
  583. if(!sscanf(params, "us[50]", Target,Msg)) //if the params are written correctly, do the following! (target "u" and message "s" used here, with the size "50")
  584. {
  585. new PName[MAX_PLAYER_NAME]; //a new name for the player
  586. GetPlayerName(Target,PName,sizeof PName); //receive the player's name
  587. new textstring[400];//the string for the message
  588.  
  589. format(textstring, sizeof(textstring), "{FFFFFF}(%i): {FFFFFF}%s", Target, Msg); //format the message with the string we've created, Target for the player, Msg for the message
  590. SendPlayerMessageToAll(Target, textstring); //of course everyone should see the message
  591. format(textstring,sizeof(textstring),"You have sent a fakechat message for %s(%d)! (Message: %s)",PName,Target,Msg); //you don't have to, but you CAN add it! It sends you the success-message that you've sent the fakemessage
  592. SendClientMessage(playerid,COLOR_GREEN,textstring); //this message should only appear to the one which is performing the command
  593. CMDMessageToAdmins(playerid,"FAKECHAT");
  594. }
  595. }
  596. else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-5 Administrator to use this command!");
  597.  
  598. return 1;
  599. }
  600. COMMAND:givescore(playerid,params[])
  601. {
  602. if(PlayerInfo[playerid][pAdmin] >= 2)
  603. {
  604. new Target;
  605. new Ammount;
  606. if(!sscanf(params, "ui", Target, Ammount))
  607. {
  608. if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"ERROR: Wrong player ID");
  609. if(Ammount > 100000) return SendClientMessage(playerid,COLOR_RED,"ERROR: Score Amount Is From 0 To 100000");
  610. SetPlayerScore(Target,GetPlayerScore(Target)+Ammount);
  611. new tname[MAX_PLAYER_NAME];
  612. GetPlayerName(Target,tname,sizeof(tname));
  613. new pname[MAX_PLAYER_NAME];
  614. GetPlayerName(playerid,pname,sizeof(pname));
  615. new tstring[256];
  616. new pstring[256];
  617. format(tstring,sizeof(tstring),"You Have Been Given %d Score By Administrator %s",Ammount,pname);
  618. format(pstring,sizeof(pstring),"You have given %d score to %s(%d)",Ammount,tname,Target);
  619. SendClientMessage(Target,COLOR_BLUE,tstring);
  620. SendClientMessage(playerid,COLOR_BLUE,pstring);
  621. CMDMessageToAdmins(playerid,"GIVESCORE");
  622. }
  623. else SendClientMessage(playerid,COLOR_ORANGE,"USAGE: /givescore <playerid> <ammount>");
  624.  
  625.  
  626. }
  627. else SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!");
  628. return 1;
  629. }
  630. COMMAND:force(playerid,params[])
  631. {
  632. if(PlayerInfo[playerid][pAdmin] >= 3)
  633. {
  634. new Target;
  635. if(!sscanf(params, "u", Target))
  636. {
  637. if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"ERROR: Wrong player ID");
  638. ForceClassSelection(Target);
  639. new tname[MAX_PLAYER_NAME];
  640. GetPlayerName(Target,tname,sizeof(tname));
  641. new pname[MAX_PLAYER_NAME];
  642. GetPlayerName(playerid,pname,sizeof(pname));
  643. new tstring[256];
  644. new pstring[256];
  645. format(tstring,sizeof(tstring),"You Have Been Forced To Class Selection By %s",pname);
  646. format(pstring,sizeof(pstring),"You Have Forced %s(%d) Into Class Selection",tname);
  647. SendClientMessage(Target,COLOR_BLUE,tstring);
  648. SendClientMessage(playerid,COLOR_BLUE,pstring);
  649. CMDMessageToAdmins(playerid,"FORCE");
  650. }
  651. else SendClientMessage(playerid,COLOR_ORANGE,"USAGE: /force <playerid>");
  652.  
  653.  
  654. }
  655. else SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-3 Administrator to use this command!");
  656. return 1;
  657. }
  658. COMMAND:spawn(playerid,params[])
  659. {
  660. if(PlayerInfo[playerid][pAdmin] >= 3)
  661. {
  662. new Target;
  663. if(!sscanf(params, "u", Target))
  664. {
  665. if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"ERROR: Wrong player ID");
  666. if(PlayerInfo[Target][pAdmin] >= PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid,COLOR_RED,"ERROR:You Can't Use This Command On This Admin!");
  667. SpawnPlayer(Target);
  668. new tname[MAX_PLAYER_NAME];
  669. GetPlayerName(Target,tname,sizeof(tname));
  670. new pname[MAX_PLAYER_NAME];
  671. GetPlayerName(playerid,pname,sizeof(pname));
  672. new tstring[256];
  673. new pstring[256];
  674. format(tstring,sizeof(tstring),"You Have Been Spawned %s",pname);
  675. format(pstring,sizeof(pstring),"You Have Spawned %s(%d)",tname);
  676. SendClientMessage(Target,COLOR_BLUE,tstring);
  677. SendClientMessage(playerid,COLOR_BLUE,pstring);
  678. CMDMessageToAdmins(playerid,"SPAWN");
  679. }
  680. else SendClientMessage(playerid,COLOR_ORANGE,"USAGE: /spawn <playerid>");
  681. }
  682. else SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-3 Administrator to use this command!");
  683. return 1;
  684. }
  685. COMMAND:mute(playerid,params[])
  686. {
  687. if(PlayerInfo[playerid][pAdmin] >= 1)
  688. {
  689.  
  690. new Target;
  691. if(!sscanf(params, "u", Target))
  692. {
  693. if(Target == playerid) return SendClientMessage(playerid, COLOR_RED, "SERVER: Cant perform this command on yourself!" );
  694. if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"ERROR: Wrong player ID");
  695. if(PlayerInfo[Target][pAdmin] >= PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid,COLOR_RED,"ERROR: You Can't Use This Command On This Admin!");
  696. new tname[MAX_PLAYER_NAME];
  697. GetPlayerName(Target,tname,sizeof(tname));
  698. new pname[MAX_PLAYER_NAME];
  699. GetPlayerName(playerid,pname,sizeof(pname));
  700. new tstring[256];
  701. new pstring[256];
  702. format(tstring,sizeof(tstring),"You Have Been Muted By %s! You Can't Talk!",pname);
  703. format(pstring,sizeof(pstring),"You Have Muted %s(%d)",tname,Target);
  704. SendClientMessage(Target,COLOR_RED,tstring);
  705. SendClientMessage(playerid,COLOR_GREEN,pstring);
  706. CMDMessageToAdmins(playerid,"MUTE");
  707.  
  708. }
  709. else SendClientMessage(playerid,COLOR_ORANGE,"USAGE: /mute <playerid>");
  710. }
  711. else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-1 Administrator to use this command!");
  712.  
  713. return 1;
  714.  
  715. }
  716. COMMAND:unmute(playerid,params[])
  717. {
  718. if(PlayerInfo[playerid][pAdmin] >= 1)
  719. {
  720.  
  721. new Target;
  722. if(!sscanf(params, "u", Target))
  723. {
  724. if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"ERROR: Wrong player ID");
  725. if(PlayerInfo[Target][pAdmin] >= PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid,COLOR_RED,"ERROR: You Can't Use This Command On This Admin!");
  726. new tname[MAX_PLAYER_NAME];
  727. GetPlayerName(Target,tname,sizeof(tname));
  728. new pname[MAX_PLAYER_NAME];
  729. GetPlayerName(playerid,pname,sizeof(pname));
  730. new tstring[256];
  731. new pstring[256];
  732. format(tstring,sizeof(tstring),"You Have Been UnMuted By %s! You Can Talk Now!",pname);
  733. format(pstring,sizeof(pstring),"You Have Muted Player %s(%d)",tname,Target);
  734. SendClientMessage(Target,COLOR_RED,tstring);
  735. SendClientMessage(playerid,COLOR_GREEN,pstring);
  736. CMDMessageToAdmins(playerid,"UNMUTE");
  737. }
  738. else SendClientMessage(playerid,COLOR_ORANGE,"USAGE: /unmute <playerid>");
  739. }
  740. else SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-1 Administrator to use this command!");
  741. return 1;
  742. }
  743. COMMAND:givecash(playerid, params[])
  744. {
  745. if(PlayerInfo[playerid][pAdmin] >= 2)
  746. {
  747. new
  748. toplayerid, // the player we want to give money to
  749. amount;
  750. // extracting player's ID and amount from params
  751. if (!sscanf(params, "ii", toplayerid, amount))
  752. {
  753. if (toplayerid != INVALID_PLAYER_ID)
  754. {
  755. new
  756. message[40];
  757. GivePlayerMoney(toplayerid, amount);
  758. format(message, sizeof(message), "You Got $%d From Administrator!", amount);
  759. SendClientMessage(toplayerid, COLOR_RED, message);
  760. CMDMessageToAdmins(playerid,"GIVECASH");
  761. }
  762. else SendClientMessage(playerid, COLOR_RED, "That player is not connected");
  763. }
  764. else SendClientMessage(playerid, COLOR_ORANGE, "Usage: /givemoney <playerid> <amount>");
  765. }
  766. else SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!");
  767. return 1;
  768. }
  769. COMMAND:god(playerid,params[])
  770. {
  771. if(PlayerInfo[playerid][pAdmin] >= 2)
  772. {
  773. SetPlayerHealth(playerid, 99999);
  774. SendClientMessage(playerid, COLOR_GREEN,"You Are Now On God Mod");
  775. CMDMessageToAdmins(playerid,"GOD");
  776.  
  777. }
  778. else SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!");
  779. return 1;
  780. }
  781. COMMAND:offgod(playerid,params[])
  782. {
  783. if(PlayerInfo[playerid][pAdmin] >= 2)
  784. {
  785. SetPlayerHealth(playerid, 100);
  786. SendClientMessage(playerid, COLOR_GREEN,"You Have Turned Off God Mode");
  787. CMDMessageToAdmins(playerid,"OFFGOD");
  788. }
  789. else SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!");
  790. return 1;
  791. }
  792.  
  793. COMMAND:jail(playerid, params[])
  794. {
  795. new id;
  796. if(IsPlayerConnected(id))
  797. {
  798. if(PlayerInfo[playerid][pAdmin] >= 1)
  799. {
  800. if(!sscanf(params, "u", id))
  801. {
  802. new string[900];
  803. new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
  804. GetPlayerName(playerid, name, sizeof(name));
  805. GetPlayerName(id, PlayerName, sizeof(PlayerName));
  806. format(string, sizeof(string), "Administrator %s jailed you for %s", name,params);
  807. SendClientMessage(id, COLOR_RED, string);
  808. format(string, sizeof(string), "You jailed %s", PlayerName);
  809. SendClientMessage(playerid, COLOR_WHITE, string);
  810. format(string, sizeof(string), "Administrator %s jailed %s",name,PlayerName);
  811. SendClientMessageToAll(COLOR_WHITE, string);
  812. SetPlayerPos(id, 264.6288,77.5742,1001.0391);
  813. SetPlayerInterior(id, 1);
  814. CMDMessageToAdmins(playerid,"JAIL");
  815. return 1;
  816. }
  817. else return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /jail [PlayerId/PartOfName][Reason]");
  818. }
  819. else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-1 Administrator to use this command!");
  820. }
  821. else return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
  822. }
  823.  
  824. COMMAND:unjail(playerid, params[])
  825. {
  826. new id;
  827. if(IsPlayerConnected(id))
  828. {
  829. if(PlayerInfo[playerid][pAdmin] >=1)
  830. {
  831. if(!sscanf(params, "u", id))
  832. {
  833. new string[900];
  834. new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
  835. GetPlayerName(playerid, name, sizeof(name));
  836. GetPlayerName(id, PlayerName, sizeof(PlayerName));
  837. format(string, sizeof(string), "Administrator %s Has Unjailed You", name);
  838. SendClientMessage(id, COLOR_RED, string);
  839. format(string, sizeof(string), "You unjailed %s", PlayerName);
  840. SendClientMessage(playerid, COLOR_WHITE, string);
  841. format(string, sizeof(string), "Administrator %s Has Unjailed %s",name,PlayerName);
  842. SetPlayerPos(id, 1555.097900, -1675.848754, 16.195312);
  843. SetPlayerInterior(id, 0);
  844. CMDMessageToAdmins(playerid,"UNJAIL");
  845. return 1;
  846. }
  847. else return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /unjail [PlayerId/PartOfName]");
  848. }
  849. else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-1 Administrator to use this command!");
  850. }
  851. else return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
  852. }
  853. COMMAND:setscore(playerid, params[])
  854. {
  855. new id;
  856. new score;
  857. if(IsPlayerConnected(id))
  858. {
  859. if(PlayerInfo[playerid][pAdmin] >= 4)
  860. {
  861. if(!sscanf(params, "ui", id, score))
  862. {
  863. if(score <= 999999999)
  864. {
  865. new string[64];
  866. new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
  867. GetPlayerName(playerid, name, sizeof(name));
  868. GetPlayerName(id, PlayerName, sizeof(PlayerName));
  869. format(string, sizeof(string), "Administrator %s Set Your Score To %d", name, score);
  870. SendClientMessage(id, COLOR_RED, string);
  871. format(string, sizeof(string), "You reseted %s's score to %d", PlayerName, score);
  872. SendClientMessage(playerid, COLOR_WHITE, string);
  873. SetPlayerScore(id, score);
  874. CMDMessageToAdmins(playerid,"SETSCORE");
  875.  
  876. return 1;
  877. }
  878. else return SendClientMessage(playerid, COLOR_RED, "You can't set more than $999.999.999");
  879. }
  880. else return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /setscore [PlayerId/PartOfName] [Score]");
  881. }
  882. else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-4 Administrator to use this command!");
  883. }
  884. else return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
  885. }
  886. COMMAND:goto(playerid, params[])
  887. {
  888. new id;
  889. if(IsPlayerConnected(id))
  890. {
  891. if(PlayerInfo[playerid][pAdmin] >= 2)
  892. {
  893. if(!sscanf(params, "ui", id))
  894. {
  895. new string[300];
  896. new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
  897. new Float:x, Float:y, Float:z; GetPlayerPos(id,x,y,z); SetPlayerInterior(playerid,GetPlayerInterior(id));
  898. GetPlayerName(playerid, name, sizeof(name));
  899. GetPlayerName(id, PlayerName, sizeof(PlayerName));
  900. format(string, sizeof(string), "Administrator %s Has Been Teleported To Your Position", name);
  901. SendClientMessage(id, COLOR_RED, string);
  902. format(string, sizeof(string), "You Went To Player %s", PlayerName);
  903. SendClientMessage(playerid, COLOR_BLUE, string);
  904. SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
  905. SetPlayerPos(playerid,x+2,y,z);
  906. CMDMessageToAdmins(playerid,"GOTO");
  907. return 1;
  908. }
  909. else return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /goto [PlayerId/PartOfName]");
  910. }
  911. else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!");
  912. }
  913. else return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
  914. }
  915.  
  916. COMMAND:get(playerid, params[])
  917. {
  918. new id;
  919. if(IsPlayerConnected(id))
  920. {
  921. if(PlayerInfo[playerid][pAdmin] >= 3)
  922. {
  923. if(!sscanf(params, "ui", id))
  924. {
  925. new string[300];
  926. new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
  927. new Float:x, Float:y, Float:z; GetPlayerPos(playerid,x,y,z); SetPlayerInterior(id,GetPlayerInterior(playerid));
  928. GetPlayerName(playerid, name, sizeof(name));
  929. GetPlayerName(id, PlayerName, sizeof(PlayerName));
  930. format(string, sizeof(string), "Administrator %s Teleported You To His Position", name);
  931. SendClientMessage(id,COLOR_RED, string);
  932. format(string, sizeof(string), "You Have Teleported %s To Your Position", PlayerName);
  933. SendClientMessage(playerid,COLOR_BLUE, string);
  934. SetPlayerVirtualWorld(id,GetPlayerVirtualWorld(playerid));
  935. SetPlayerPos(id,x+2,y,z);
  936. CMDMessageToAdmins(playerid,"GET");
  937. return 1;
  938. }
  939. else return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /gethere[PlayerId/PartOfName]");
  940. }
  941. else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-3 Administrator to use this command!");
  942. }
  943. else return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
  944. }
  945. COMMAND:akill(playerid, params[])
  946. {
  947. new id;
  948. if(IsPlayerConnected(id))
  949. {
  950. if(PlayerInfo[playerid][pAdmin] >= 3)
  951. {
  952. if(!sscanf(params, "u", id))
  953. {
  954. new string[100];
  955. new name[MAX_PLAYER_NAME], PlayerName[MAX_PLAYER_NAME];
  956. GetPlayerName(playerid, name, sizeof(name));
  957. GetPlayerName(id, PlayerName, sizeof(PlayerName));
  958. format(string, sizeof(string), "Administrator %s Has Killed You", name);
  959. SendClientMessage(id, COLOR_RED, string);
  960. format(string, sizeof(string), "You Have Killed %s", PlayerName);
  961. SendClientMessage(playerid, COLOR_BLUE, string);
  962. SetPlayerHealth(id, 0);
  963. CMDMessageToAdmins(playerid,"AKILL");
  964. return 1;
  965. }
  966. else return SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /akill [PlayerId/PartOfName]");
  967. }
  968. else return SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-3 Administrator to use this command!");
  969. }
  970. else return SendClientMessage(playerid, COLOR_RED, "Player is not connected.");
  971. }
  972.  
  973. COMMAND:acmds(playerid,params[])
  974. {
  975. if(PlayerInfo[playerid][pAdmin] >= 1)
  976. {
  977. SendClientMessage(playerid, COLOR_GREEN,"==============================");
  978. SendClientMessage(playerid, COLOR_GREEN,"========Admin-Commands========");
  979. SendClientMessage(playerid, COLOR_GREEN,"/heal,/kick,/ban,/freeze,/unfreeze");
  980. SendClientMessage(playerid, COLOR_GREEN,"/clearchat,/jail,/unjail,/acar");
  981. SendClientMessage(playerid, COLOR_GREEN,"/fakechat,/givescore,/force");
  982. SendClientMessage(playerid, COLOR_GREEN,"/spawn,/mute,/unmute,/fix,/car");
  983. SendClientMessage(playerid, COLOR_GREEN,"/givecash,/god,/offgod,/setlevel");
  984. SendClientMessage(playerid, COLOR_GREEN,"/setscore,/akill,/get,/goto");
  985. SendClientMessage(playerid, COLOR_GREEN,"===============================");
  986. CMDMessageToAdmins(playerid,"ACMDS");
  987.  
  988. }
  989. else SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-1 Administrator to use this command!");
  990. return 1;
  991. }
  992. CMD:warn(playerid,params[])
  993. {
  994. if(AdminLevel[playerid] >= 1)
  995. {
  996. new Target;
  997. new Reason[50];
  998. if(sscanf(params, "us[50]", Target, Reason)) return SendClientMessage(playerid,COLOR_RED,"Usage: /warn [playerid] [reason]");
  999. if(Target == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Invaild ID");
  1000. Warns[Target]++;
  1001. new tname[MAX_PLAYER_NAME];
  1002. GetPlayerName(Target,tname,sizeof(tname));
  1003. new pname[MAX_PLAYER_NAME];
  1004. GetPlayerName(playerid,pname,sizeof(pname));
  1005. new String[256];
  1006. format(String,sizeof String, "Administrator %s warned %s [Reason: %s %d/%d]", pname, tname, Reason, Warns[Target], MAX_WARNINGS);
  1007. SendClientMessage(playerid, COLOR_RED, String);
  1008. if(Warns[Target] == MAX_WARNINGS)
  1009. {
  1010. new str[256];
  1011. new name[MAX_PLAYER_NAME];
  1012. GetPlayerName(Target,name,sizeof(name));
  1013. format(str,sizeof(str),"%s has been kicked by Server [Reason: Max Warnings]", name, Target);
  1014. SendClientMessageToAll(COLOR_RED, str);
  1015. Warns[Target] = 0;
  1016. Kick(Target);
  1017. }
  1018. }
  1019. else SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be level 1 Administrator to use this command!");
  1020. return 1;
  1021. }
  1022.  
  1023.  
  1024. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  1025. {
  1026. return 1;
  1027. }
  1028.  
  1029. public OnPlayerExitVehicle(playerid, vehicleid)
  1030. {
  1031. return 1;
  1032. }
  1033.  
  1034. public OnPlayerStateChange(playerid, newstate, oldstate)
  1035. {
  1036. return 1;
  1037. }
  1038.  
  1039. public OnPlayerEnterCheckpoint(playerid)
  1040. {
  1041. return 1;
  1042. }
  1043.  
  1044. public OnPlayerLeaveCheckpoint(playerid)
  1045. {
  1046. return 1;
  1047. }
  1048.  
  1049. public OnPlayerEnterRaceCheckpoint(playerid)
  1050. {
  1051. return 1;
  1052. }
  1053.  
  1054. public OnPlayerLeaveRaceCheckpoint(playerid)
  1055. {
  1056. return 1;
  1057. }
  1058.  
  1059. public OnRconCommand(cmd[])
  1060. {
  1061. return 1;
  1062. }
  1063.  
  1064. public OnPlayerRequestSpawn(playerid)
  1065. {
  1066. return 1;
  1067. }
  1068.  
  1069. public OnObjectMoved(objectid)
  1070. {
  1071. return 1;
  1072. }
  1073.  
  1074. public OnPlayerObjectMoved(playerid, objectid)
  1075. {
  1076. return 1;
  1077. }
  1078.  
  1079. public OnPlayerPickUpPickup(playerid, pickupid)
  1080. {
  1081. return 1;
  1082. }
  1083.  
  1084. public OnVehicleMod(playerid, vehicleid, componentid)
  1085. {
  1086. return 1;
  1087. }
  1088.  
  1089. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  1090. {
  1091. return 1;
  1092. }
  1093.  
  1094. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  1095. {
  1096. return 1;
  1097. }
  1098.  
  1099. public OnPlayerSelectedMenuRow(playerid, row)
  1100. {
  1101. return 1;
  1102. }
  1103.  
  1104. public OnPlayerExitedMenu(playerid)
  1105. {
  1106. return 1;
  1107. }
  1108.  
  1109. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  1110. {
  1111. return 1;
  1112. }
  1113.  
  1114. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  1115. {
  1116. return 1;
  1117. }
  1118.  
  1119. public OnRconLoginAttempt(ip[], password[], success)
  1120. {
  1121. return 1;
  1122. }
  1123.  
  1124. public OnPlayerUpdate(playerid)
  1125. {
  1126. return 1;
  1127. }
  1128.  
  1129. public OnPlayerStreamIn(playerid, forplayerid)
  1130. {
  1131. return 1;
  1132. }
  1133.  
  1134. public OnPlayerStreamOut(playerid, forplayerid)
  1135. {
  1136. return 1;
  1137. }
  1138.  
  1139. public OnVehicleStreamIn(vehicleid, forplayerid)
  1140. {
  1141. return 1;
  1142. }
  1143.  
  1144. public OnVehicleStreamOut(vehicleid, forplayerid)
  1145. {
  1146. return 1;
  1147. }
  1148.  
  1149. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1150. {
  1151. switch( dialogid )
  1152. {
  1153. case DIALOG_REGISTER:
  1154. {
  1155. if (!response) return Kick(playerid);
  1156. if(response)
  1157. {
  1158. if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_WHITE"Registering...",""COL_RED"You have entered an invalid password.\n"COL_WHITE"Type your password below to register a new account.","Register","Quit");
  1159. new INI:File = INI_Open(UserPath(playerid));
  1160. INI_SetTag(File,"data");
  1161. INI_WriteInt(File,"Password",udb_hash(inputtext));
  1162. INI_WriteInt(File,"Cash",0);
  1163. INI_WriteInt(File,"Admin",0);
  1164. INI_WriteInt(File,"Kills",0);
  1165. INI_WriteInt(File,"Deaths",0);
  1166. INI_WriteInt(File,"Donor",0);
  1167. INI_WriteInt(File,"Score",0);
  1168. INI_WriteInt(File,"Helperator",0);
  1169. INI_Close(File);
  1170. SendClientMessage(playerid, COLOR_WHITE,"Your now registered!");
  1171. }
  1172. }
  1173.  
  1174. case DIALOG_LOGIN:
  1175. {
  1176. if ( !response ) return Kick ( playerid );
  1177. if( response )
  1178. {
  1179. if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  1180. {
  1181. INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  1182. GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
  1183. SetPlayerScore(playerid, GetPlayerScore(playerid));
  1184. ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_WHITE"Success!",""COL_GREEN"Congratulations You Have Been Succesfully Logged In!","Ok","");
  1185. }
  1186. else
  1187. {
  1188. ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_WHITE"Login",""COL_RED"You Have Entered An Incorrect Password And This Is Not The Password Of This Account.\n"COL_WHITE"Type your password below to login.","Login","Quit");
  1189. }
  1190. return 1;
  1191. }
  1192. }
  1193. }
  1194. return 1;
  1195. }
  1196.  
  1197. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  1198. {
  1199. return 1;
  1200. }
  1201. forward Error1(playerid);
  1202. public Error1(playerid)
  1203. {
  1204. SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-1 Administrator to use this command!");
  1205. return 1;
  1206. }
  1207. forward Error2(playerid);
  1208. public Error2(playerid)
  1209. {
  1210. SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-2 Administrator to use this command!");
  1211. return 1;
  1212. }
  1213. forward Error3(playerid);
  1214. public Error3(playerid)
  1215. {
  1216. SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-3 Administrator to use this command!");
  1217. return 1;
  1218. }
  1219. forward Error4(playerid);
  1220. public Error4(playerid)
  1221. {
  1222. SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-4 Administrator to use this command!");
  1223. return 1;
  1224. }
  1225. forward Error5(playerid);
  1226. public Error5(playerid)
  1227. {
  1228. SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-5 Administrator to use this command!");
  1229. return 1;
  1230. }
  1231. forward Error6(playerid);
  1232. public Error6(playerid)
  1233. {
  1234. SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-6 Administrator to use this command!");
  1235. return 1;
  1236. }
  1237. forward Error7(playerid);
  1238. public Error7(playerid)
  1239. {
  1240. SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-7 Administrator to use this command!");
  1241. return 1;
  1242. }
  1243. forward Error8(playerid);
  1244. public Error8(playerid)
  1245. {
  1246. SendClientMessage(playerid,COLOR_RED,"ERROR: You need to be Level-8 Administrator to use this command!");
  1247. return 1;
  1248. }
  1249. forward MessageToTwice(color,const string[]);
  1250. public MessageToTwice(color,const string[])
  1251. {
  1252. for(new i = 0; i < MAX_PLAYERS; i++)
  1253. {
  1254. if(IsPlayerConnected(i) == 1) if (PlayerInfo[i][pAdmin] >= 1) SendClientMessage(i, color, string);
  1255. }
  1256. return 1;
  1257. }
  1258. stock CMDMessageToAdmins(playerid,command[])
  1259. {
  1260. new string[128]; GetPlayerName(playerid,string,sizeof(string));
  1261. format(string,sizeof(string),"[INFO]Administrator %s has used %s",string,command);
  1262. return MessageToTwice(COLOR_PINK,string);
  1263. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement