Guest User

Untitled

a guest
Jun 4th, 2013
208
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 56.77 KB | None | 0 0
  1. /*------------------------------------------------------------------------------
  2. ________________________________________________________________________________
  3.  
  4. © Copyright FunnyBear 2013. All rights reserved
  5. ________________________________________________________________________________
  6.  
  7. Users Directory: Scriptfiles -> fbAdmin -> Users
  8. ________________________________________________________________________________
  9.  
  10. VERSION: v1.0
  11. DEVELOPER: FunnyBear
  12. BETA TESTERS: Greentarch
  13.  
  14. INFORMATION: This filterscript is owned by Funnybear, you may not re-release
  15. it without my permission.
  16.  
  17. © Copyright 2013. All rights reserved. Do not steal this filterscript, if you're
  18. using it, leave the credits on.
  19. ________________________________________________________________________________
  20. */
  21.  
  22. //--[INCLUDES]--
  23. #include <a_samp>
  24. #include <zcmd>
  25. #include <YSI\y_ini>
  26. #include <sscanf>
  27.  
  28. //-----[FORWARDS]-----
  29. forward loadaccount_user(playerid, name[], value[]);
  30. forward Unjail(playerid);
  31.  
  32. //-----[NATIVES]-----
  33. native WP_Hash(buffer[],len,const str[]);
  34.  
  35. //-----[ADMIN DEFINES]-----
  36. #define dregister 1
  37. #define dlogin 2
  38. #define cmds 3
  39. #define acmds 4
  40. #define credits 5
  41.  
  42. #define MAX_PLAYER_NAME 24
  43.  
  44. #define UserPath "fAdmin/Users/%s.ini"
  45.  
  46. //-----[COLOR DEFINES FOR ADMIN/REG SYSTEM]-----
  47. #define COL_RULES "{FA0A36}"
  48. #define COL_WHITE "{FFFFFF}"
  49. #define COL_RED "{F81414}"
  50. #define COL_GREEN "{00FF22}"
  51. #define COL_LIGHTBLUE "{00CED1}"
  52.  
  53. //----[OTHER COLOR DEFINES]-----
  54. #define COL_RED "{F81414}"
  55. #define COL_GREEN "{00FF22}"
  56. #define COL_LIGHTBLUE "{00CED1}"
  57. #define GREY 0xAFAFAFAA
  58. #define GREEN 0x33AA33AA
  59. #define COLOR_WHITE 0xFFFFFFAA
  60. #define COLOR_RBLUE 0x4169FFAA
  61. #define YELLOW 0xFFFF00AA
  62. #define WHITE 0xFFFFFFAA
  63. #define LIGHTBLUE 0x33CCFFAA
  64. #define ORANGE 0xFF9900AA
  65. #define RED 0xFF0000FF
  66. #define COLOR_ERROR 0xFF6A6AFF
  67. #define COLOR_BOMB 0x96BD6AFF
  68. #define COL_WHITE "{FFFFFF}"
  69. #define COL_RED "{F81414}"
  70. #define COL_GREEN "{00FF22}"
  71. #define COL_LIGHTBLUE "{00CED1}"
  72. #define GREY 0xAFAFAFAA
  73. #define GREEN 0x33AA33AA
  74. #define COLOR_YELLOW 0xFFFF00AA
  75. #define YELLOW 0xFFFF00AA
  76. #define WHITE 0xFFFFFFAA
  77. #define COLOR_WHITE 0xFFFFFFAA
  78. #define LIGHTBLUE 0x33CCFFAA
  79. #define ORANGE 0xFF9900AA
  80. #define RED 0xFF0000FF
  81. #define BLUE 0x000060FF
  82. #define BLUE2 0x005F60FF
  83. #define Grey 0xC0C0C0FF
  84. #define COLOR_GRAD1 0xB4B5B7FF
  85. #define ROB 0xFF9500FF
  86. #define INFO 0x008080FF
  87.  
  88. //-----[ENUMS]-----
  89. enum PlayerInfo
  90. {
  91. Pass[129],
  92. Adminlevel,
  93. VIPlevel,
  94. Money,
  95. Scores,
  96. Kills,
  97. Deaths,
  98. Warnings,
  99. }
  100. new pInfo[MAX_PLAYERS][PlayerInfo];
  101.  
  102. //-----[FILTER]-----
  103.  
  104. new Filter[][] =
  105. {
  106. "MotherFu",
  107. "puss",
  108. "bit",
  109. "Asshole",
  110. "Dic",
  111. "codw",
  112. "s0beit",
  113. "sobeit",
  114. "hack",
  115. "cheat",
  116. "h@ck",
  117. "/rcon login",
  118. ".rcon login",
  119. "&rcon login",
  120. "7rcon login"
  121. };
  122.  
  123. //-----[VARIABLES]-----
  124. new
  125. bool:QuestionAsked[ MAX_PLAYERS ];
  126.  
  127. new
  128. JailTimer[ MAX_PLAYERS ];
  129. new
  130. Jailed[ MAX_PLAYERS ];
  131.  
  132. new
  133. hide[ MAX_PLAYERS ];
  134.  
  135. new
  136. Question[ MAX_PLAYERS ][ 256 ];
  137.  
  138. new
  139. bool: playerMuted[ MAX_PLAYERS char ];
  140. new
  141. bool: playerFrozen[ MAX_PLAYERS char ];
  142. new
  143. bool: playerGod[ MAX_PLAYERS ];
  144. new
  145. bool: playerAsked[ MAX_PLAYERS char ];
  146.  
  147. new
  148. ChatDisabled;
  149.  
  150.  
  151.  
  152.  
  153.  
  154. #if defined FILTERSCRIPT
  155.  
  156. public OnFilterScriptInit()
  157. {
  158. print("\n--------------------------------------");
  159. print(" Admin Filterscript by FunnyBear loaded");
  160. print("--------------------------------------\n");
  161. return 1;
  162. }
  163.  
  164. public OnFilterScriptExit()
  165. {
  166. return 1;
  167. }
  168.  
  169. #else
  170.  
  171. main()
  172. {
  173. print("\n----------------------------------");
  174. print(" Blank Gamemode by your name here");
  175. print("----------------------------------\n");
  176. }
  177.  
  178. #endif
  179.  
  180.  
  181. public OnPlayerRequestClass(playerid, classid)
  182. {
  183. SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
  184. SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
  185. SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
  186. return 1;
  187. }
  188.  
  189. public OnPlayerConnect(playerid)
  190. {
  191. new name[MAX_PLAYER_NAME];
  192. GetPlayerName(playerid,name,sizeof(name));
  193. if(fexist(Path(playerid)))
  194. {
  195. INI_ParseFile(Path(playerid),"loadaccount_%s", .bExtra = true, .extra = playerid);
  196. ShowPlayerDialog(playerid,dlogin, DIALOG_STYLE_PASSWORD,""COL_GREEN"Login",""COL_WHITE"This account is {00FF22}already registered.\n{FFFFFF}Please login by entering your password in below","Login","Quit");
  197. }
  198. else
  199. {
  200. ShowPlayerDialog(playerid,dregister, DIALOG_STYLE_PASSWORD,""COL_RED"Register",""COL_WHITE"This account is{F81414} not yet registered \n{FFFFFF}Please create an account by typing your desired password below","Register","Quit");
  201. return 1;
  202. }
  203. return 1;
  204. }
  205.  
  206. public OnPlayerDisconnect(playerid, reason)
  207. {
  208. KillTimer(JailTimer[playerid]);
  209. QuestionAsked[playerid] = false;
  210. format(Question[playerid], 256, " ");
  211.  
  212. if(fexist(Path(playerid)))
  213. {
  214. new INI:file = INI_Open(Path(playerid));
  215. INI_SetTag(file,"Player Data");
  216. INI_WriteInt(file,"AdminLevel",pInfo[playerid][Adminlevel]);
  217. INI_WriteInt(file,"VIPLevel",pInfo[playerid][VIPlevel]);
  218. INI_WriteInt(file,"Money",GetPlayerMoney(playerid));
  219. INI_WriteInt(file,"Scores",GetPlayerScore(playerid));
  220. INI_WriteInt(file,"Kills",pInfo[playerid][Kills]);
  221. INI_WriteInt(file,"Deaths",pInfo[playerid][Deaths]);
  222. INI_WriteInt(file,"Warnings",pInfo[playerid][Warnings]);
  223.  
  224. INI_Close(file);
  225. return 1;
  226. }
  227. return 1;
  228. }
  229.  
  230. stock SendMessageToAdmins(color,const msg[])
  231. {
  232. for (new i=0; i<MAX_PLAYERS; i++)
  233. {
  234. if(IsPlayerConnected(i)) if(pInfo[i][Adminlevel] > 1) SendClientMessage(i,color,msg);
  235. }
  236. }
  237.  
  238. stock GetName(playerid)
  239. {
  240. new
  241. name[24];
  242. GetPlayerName(playerid, name, sizeof(name));
  243. return name;
  244. }
  245.  
  246. stock StartPlayerSpec(playerid, otherid)
  247. {
  248. TogglePlayerSpectating(playerid, 1);
  249. PlayerSpectatePlayer(playerid, otherid);
  250. SetPlayerInterior(playerid,GetPlayerInterior(otherid));
  251. SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(otherid));
  252. return 1;
  253. }
  254.  
  255. stock StopPlayerSpec(playerid)
  256. {
  257. TogglePlayerSpectating(playerid, 0);
  258. SetCameraBehindPlayer(playerid);
  259. return 1;
  260. }
  261.  
  262. stock PlayerName(playerid)
  263. {
  264. new Name[MAX_PLAYER_NAME + 1];
  265. GetPlayerName(playerid, Name, MAX_PLAYER_NAME + 1);
  266. return Name;
  267. }
  268.  
  269. stock Path(playerid)
  270. {
  271. new str[128],name[MAX_PLAYER_NAME];
  272. GetPlayerName(playerid,name,sizeof(name));
  273. format(str,sizeof(str),UserPath,name);
  274. return str;
  275. }
  276.  
  277. stock SendUsageError( playerid, const usage[ ] )
  278. {
  279. new
  280. str[ 128 ];
  281. format( str, sizeof ( str ), "USAGE: {FFFFFF}%s", usage );
  282. SendClientMessage( playerid, RED, str );
  283. return 1;
  284. }
  285.  
  286. stock InvalidPlayerError( playerid )
  287. return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} Player is not connected to the server." );
  288.  
  289. stock PlayerIsNotAdmin( playerid )
  290. return SendClientMessage(playerid, RED, "You are not authorised to use this command");
  291.  
  292. public loadaccount_user(playerid, name[], value[])
  293. {
  294. INI_String("Password", pInfo[playerid][Pass],129);
  295. INI_Int("AdminLevel",pInfo[playerid][Adminlevel]);
  296. INI_Int("VIPLevel",pInfo[playerid][VIPlevel]);
  297. INI_Int("Money",pInfo[playerid][Money]);
  298. INI_Int("Scores",pInfo[playerid][Scores]);
  299. INI_Int("Kills",pInfo[playerid][Kills]);
  300. INI_Int("Deaths",pInfo[playerid][Deaths]);
  301. INI_Int("Warnings",pInfo[playerid][Warnings]);
  302. return 1;
  303. }
  304.  
  305.  
  306. public OnPlayerDeath(playerid, killerid, reason)
  307. {
  308. SendDeathMessage(killerid, playerid, reason);
  309. if ( killerid != INVALID_PLAYER_ID )
  310. pInfo[killerid][Kills]++;
  311.  
  312. pInfo[playerid][Deaths]++;
  313. return 1;
  314. }
  315.  
  316. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  317. {
  318. new
  319. str[ 1024 ], title[ 128 ], name[ 24 ];
  320.  
  321. GetPlayerName( clickedplayerid, name, 24 );
  322. format( title, sizeof ( title ), "{FFFFFF}%s's Status", name );
  323.  
  324. format( str, sizeof ( str ),
  325. "{FFFFFF}Admin Level: {33FF33}%d \n\
  326. {FFFFFF}VIP Level: {33FF33}%d \n\
  327. {FFFFFF}Total warnings: {33FF33}%d \n\
  328. {FFFFFF}Money: {33FF33}$%d \n\
  329. {FFFFFF}Score: {33FF33}%d \n\
  330. {FFFFFF}Kills: {33FF33}%d \n\
  331. {FFFFFF}Deaths: {33FF33}%d",
  332. pInfo[ clickedplayerid ][ Adminlevel ], pInfo[ clickedplayerid ][ VIPlevel ], pInfo[ clickedplayerid ][ Warnings ], GetPlayerMoney( clickedplayerid ), GetPlayerScore( clickedplayerid ), pInfo[ clickedplayerid ][ Kills ], pInfo[ clickedplayerid ][ Deaths ] );
  333. ShowPlayerDialog( playerid, 1337, DIALOG_STYLE_MSGBOX, title,
  334. str, "Okay", "" );
  335. return 1;
  336. }
  337.  
  338.  
  339. IsPlayerSpawned(playerid){
  340. new statex = GetPlayerState(playerid);
  341. if(statex != PLAYER_STATE_NONE && statex != PLAYER_STATE_WASTED && statex != PLAYER_STATE_SPAWNED) return true;
  342. return false;
  343. }
  344.  
  345. public OnPlayerText(playerid, text[])
  346. {
  347. if ( !IsPlayerConnected( playerid ) )
  348. return 0;
  349.  
  350. if ( !IsPlayerSpawned( playerid ) )
  351. return SendClientMessage( playerid, RED, "You must be spawned to talk!"), 0;
  352.  
  353. if ( ChatDisabled == 1 )
  354. {
  355. if( pInfo[playerid][Adminlevel] == 0)
  356. return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} Chat is disabled, only Administrators can talk!"), 0;
  357. }
  358.  
  359. if ( playerMuted{ playerid } )
  360. return SendClientMessage( playerid, RED, "You are muted, you cannot talk!"), 0;
  361.  
  362. if ( text[ 0 ] == '!' && pInfo[ playerid ][ Adminlevel ] > 0 )
  363. {
  364. new str[ 128 ], pName[ MAX_PLAYER_NAME ];
  365. GetPlayerName( playerid, pName, sizeof ( pName ) );
  366. format( str, sizeof ( str ), "[AdminChat] %s [%d] : %s", pName, playerid, text[ 1 ] );
  367. SendMessageToAdmins(-1, str );
  368. return 0;
  369. }
  370. for(new d; d<sizeof(Filter); d++)
  371. if(strfind(text,Filter[d],true) != -1)
  372. {
  373. SendClientMessage(playerid,RED,"ERROR:{FFFFFF} Censored word!");
  374. return 0;
  375. }
  376. new string[128];
  377. format(string, sizeof(string), "%s[%d]: {FFFFFF}%s", GetName( playerid ), playerid, text);
  378. SendClientMessageToAll( GetPlayerColor( playerid ), string );
  379.  
  380. return 0;
  381. }
  382.  
  383. public OnPlayerCommandText(playerid, cmdtext[])
  384. {
  385. if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  386. {
  387. // Do something here
  388. return 1;
  389. }
  390. return 0;
  391. }
  392.  
  393. public OnPlayerUpdate(playerid)
  394. {
  395. if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK)
  396. {
  397. if((pInfo[playerid][VIPlevel] == 0 || pInfo[playerid][Adminlevel] == 0))
  398. {
  399. for(new i = 0; i < 50; i++) SendClientMessage(playerid, COLOR_WHITE," ");
  400. new str[128],
  401. name[MAX_PLAYER_NAME];
  402. GetPlayerName(playerid,name,MAX_PLAYER_NAME);
  403. format(str, sizeof (str), "[AUTO - BAN] %s has been automatically banned from the server. Reason: Spawning a jetpack!", name);
  404. SendClientMessageToAll(RED, str);
  405. SendClientMessage(playerid,RED, "------------------------------------------------------------------------------------");
  406. SendClientMessage(playerid,RED, "You were banned from the server due to spawning a jetpack!");
  407. SendClientMessage(playerid,RED, "If you think you were banned unfairly, you can make an unban appeal at our forums");
  408. SendClientMessage(playerid,RED, "We do not unban hackers, and we do not unban players who lie in their unban appeal.");
  409. SendClientMessage(playerid,RED, "------------------------------------------------------------------------------------");
  410. SetTimerEx( "BanPlayerJetpack",100, false, "i", playerid);
  411. SetTimerEx( "KickPlayer",100, false, "i", playerid);
  412. }
  413. }
  414. return 1;
  415. }
  416.  
  417. forward BanPlayerJetpack( playerid );
  418. public BanPlayerJetpack( playerid )
  419. return BanEx( playerid, "Jetpack Hack" );
  420.  
  421. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  422. {
  423. if(dialogid == dregister)
  424. {
  425. if(!response) return Kick(playerid);
  426. if(response)
  427. {
  428. if(!strlen(inputtext))
  429. {
  430. ShowPlayerDialog(playerid,dregister,DIALOG_STYLE_INPUT,"Register","Welcome! This account is not registered.\nEnter your own password to create a new account.\nPlease enter the password!","Register","Quit");
  431. return 1;
  432. }
  433.  
  434. new hashpass[129];
  435. WP_Hash(hashpass,sizeof(hashpass),inputtext);
  436. new INI:file = INI_Open(Path(playerid));
  437. INI_SetTag(file,"Player's Data");
  438. INI_WriteString(file,"Password",hashpass);
  439. INI_WriteInt(file,"AdminLevel",0);
  440. INI_WriteInt(file,"VIPLevel",0);
  441. INI_WriteInt(file,"Money",0);
  442. INI_WriteInt(file,"Scores",0);
  443. INI_WriteInt(file,"Kills",0);
  444. INI_WriteInt(file,"Deaths",0);
  445. INI_WriteInt(file,"Warnings",0);
  446. INI_Close(file);
  447. SendClientMessage(playerid, GREEN ,"You successfuly created an account!");
  448.  
  449. new
  450. str[ 128 ];
  451.  
  452. format(str, sizeof(str), "[NEW ACCOUNT] Player %s has registered a new account!", GetName(playerid));
  453. SendClientMessageToAll(GREEN, str);
  454. return 1;
  455. }
  456. }
  457. if(dialogid == dlogin)
  458. {
  459. if(!response) return Kick(playerid);
  460. if(response)
  461. {
  462. new hashpass[129];
  463. WP_Hash(hashpass,sizeof(hashpass),inputtext);
  464. if(!strcmp(hashpass,pInfo[playerid][Pass]))
  465. {
  466. INI_ParseFile(Path(playerid),"loadaccount_%s",.bExtra = true, .extra = playerid);
  467. SetPlayerScore(playerid,pInfo[playerid][Scores]);
  468. GivePlayerMoney(playerid,pInfo[playerid][Money]);
  469. SendClientMessage(playerid, GREEN,"You have successfully logged in");
  470. new str[ 128 ], name[ MAX_PLAYER_NAME ]; GetPlayerName( playerid, name, MAX_PLAYER_NAME );
  471. if ( pInfo[ playerid ][ Adminlevel ] > 0 )
  472. {
  473. format( str, sizeof ( str ), "Administrator %s has logged in!", name );
  474. SendClientMessageToAll( 0xFF9500FF, str);
  475. }
  476. }
  477. else
  478. {
  479. ShowPlayerDialog(playerid,dlogin, DIALOG_STYLE_PASSWORD,""COL_GREEN"Login",""COL_RED"You have entered an{F81414} incorrect password.\n"COL_WHITE"Please try again","Login","Quit");
  480. return 1;
  481. }
  482. }
  483. }
  484. return 1;
  485. }
  486.  
  487. /*___________________________________________________ ADMINISTRATOR COMMANDS___________________________ */
  488.  
  489. CMD:acmds(playerid,params[])
  490. {
  491. if(pInfo[playerid][Adminlevel] < 1)
  492. return PlayerIsNotAdmin( playerid );
  493. ShowPlayerDialog(playerid,acmds,DIALOG_STYLE_MSGBOX,"{FFD000}Admin Commands"," Level 1: /answer, /announce, /slap, /ahide, /adisarm \n Level 2: /pgoto, /cc, /healme, /armourme, /fixme\n Level 3: /respawncars, /freeze, /unfreeze, /pget, /pheal, /parmour, /akill, /kick, /pget \n Level 4: /setmoney, /spec, /specoff, /jail, /unjail, /mute, /unmute, /ban, /godon, /godoff, /setscore, /givemoney \n Level 5: /warn, /setvip, /enablechat, /disablechat\n Level 6: /restart\n Level 7: /setlevel","Ok","");
  494. return 1;
  495. }
  496.  
  497. CMD:announce(playerid,params[])
  498. {
  499. if ( pInfo[playerid][Adminlevel] < 1)
  500. return PlayerIsNotAdmin( playerid );
  501.  
  502. new
  503. text[128];
  504.  
  505. if(sscanf(params, "s", text))
  506. return SendUsageError( playerid, "/announce [Message]" );
  507.  
  508. new
  509. Text1[128];
  510. format(Text1, sizeof(Text1), "%s",text);
  511. GameTextForAll(Text1,10000, 3);
  512. return 1;
  513. }
  514.  
  515. CMD:answer( playerid, params[] )
  516. {
  517. if ( pInfo [ playerid ][ Adminlevel ] < 1 || pInfo [ playerid ] [ VIPlevel ] < 1 )
  518. return PlayerIsNotAdmin( playerid );
  519.  
  520. new
  521. id,
  522. answer[ 128 ];
  523.  
  524. if ( sscanf( params, "us", id, answer ) )
  525. return SendUsageError(playerid, "/answer [Name/ID] [Answer]");
  526.  
  527. if ( id == INVALID_PLAYER_ID )
  528. return InvalidPlayerError( playerid );
  529.  
  530. if ( id == playerid )
  531. return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} You cannot answer your own question!");
  532.  
  533. if ( !playerAsked{ id } )
  534. return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} That player hasn't asked a question yet!" );
  535.  
  536. new
  537. str[ 128 ], pRank[ 128 ], pName[ MAX_PLAYER_NAME ];
  538. GetPlayerName( playerid, pName, MAX_PLAYER_NAME );
  539.  
  540. if ( pInfo[ playerid ][ Adminlevel ] > 0 && pInfo[ playerid ][ VIPlevel ] < 1 )
  541. format( pRank, sizeof ( pRank ), "Admin %s has answered your question!", pName );
  542.  
  543. else if ( pInfo[ playerid ][ VIPlevel ] > 0 && pInfo[ playerid ][ VIPlevel ] < 1 )
  544. format( pRank, sizeof ( pRank ), "VIP %s has answered your question!", pName );
  545.  
  546. else if ( pInfo[ playerid ][ Adminlevel ] > 0 && pInfo[ playerid ][ VIPlevel ] > 0 )
  547. format( pRank, sizeof ( pRank ), "Admin %s has answered your question!", pName );
  548.  
  549. SendClientMessage( id, RED, pRank );
  550.  
  551. format( str, sizeof ( str ), "Answer: %s", answer );
  552. SendClientMessage( id, 0x0DE011FF, str );
  553. SendClientMessage( playerid, 0xFF9500FF, "Your answer has been sent!" );
  554.  
  555. playerAsked{ id } = false;
  556.  
  557. return 1;
  558. }
  559.  
  560. CMD:slap(playerid,params[])
  561. {
  562. if( pInfo[playerid][Adminlevel] < 1)
  563. return PlayerIsNotAdmin( playerid );
  564.  
  565. new id,
  566. reason[128];
  567.  
  568.  
  569. if( sscanf(params,"us",id, reason))
  570. return SendUsageError( playerid, "/slap [ID] [Reason]" );
  571.  
  572. if( playerid == id)
  573. return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot slap yourself!");
  574.  
  575. new str[128],
  576. name1[MAX_PLAYER_NAME],
  577. name[MAX_PLAYER_NAME];
  578.  
  579. GetPlayerName(playerid,name1,MAX_PLAYER_NAME);
  580. GetPlayerName(id,name,MAX_PLAYER_NAME);
  581.  
  582. format(str, sizeof(str), "[SLAP] Administrator %s has slapped %s. Reason: %s", name1, name, reason);
  583. SendClientMessageToAll(RED,str);
  584. print(str);
  585.  
  586. new Float:Pos[3];
  587. GetPlayerPos(id,Pos[0],Pos[1],Pos[2]);
  588. SetPlayerPos(id,Pos[0],Pos[1],Pos[2]+05.0);
  589. PlayerPlaySound(id,1130,Pos[0],Pos[1],Pos[2]+03.0);
  590. return 1;
  591. }
  592.  
  593. CMD:adisarm(playerid, params[])
  594. {
  595. if( pInfo[playerid][Adminlevel] < 1)
  596. return PlayerIsNotAdmin( playerid );
  597.  
  598. new id;
  599.  
  600. if(sscanf(params, "u", id) )
  601. return SendUsageError( playerid, "/adisarm [ID]" );
  602.  
  603. if ( id == INVALID_PLAYER_ID )
  604. return InvalidPlayerError( playerid );
  605.  
  606. if(playerid == id)
  607. return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot disarm yourself!");
  608.  
  609. new str[128],
  610. aname[MAX_PLAYER_NAME],
  611. name[MAX_PLAYER_NAME];
  612.  
  613. ResetPlayerWeapons(id);
  614.  
  615. GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
  616. GetPlayerName(id,name,MAX_PLAYER_NAME);
  617.  
  618. format(str, sizeof (str), "[DISARM] You have sucesfully disarmed %s!", name);
  619. SendClientMessage(playerid, 0x008080FF, str);
  620.  
  621. format(str, sizeof (str), "[DISARM] You have been disarmed by Administrator %s!", aname);
  622. SendClientMessage(id, 0x008080FF, str);
  623. return 1;
  624. }
  625.  
  626. CMD:ahide(playerid,params[])
  627. {
  628. if ( pInfo[playerid][Adminlevel] < 1)
  629. return PlayerIsNotAdmin( playerid );
  630. {
  631. if(hide[playerid]== 0)
  632. {
  633. hide[playerid] = 1;
  634. return SendClientMessage(playerid, 0x008080FF,"[HIDDEN] You are now hidden in the list of Online Admins.");
  635. }
  636. else if(hide[playerid] == 1)
  637. {
  638. hide[playerid] = 0;
  639. return SendClientMessage(playerid,0x008080FF,"[VISIBLE] You are now in visible in the list of online Admins.");
  640. }
  641. }
  642. return 1;
  643. }
  644.  
  645. /*_____________________________________________________________________________*/
  646.  
  647. CMD:pgoto(playerid, params[])
  648. {
  649. if(pInfo[playerid][Adminlevel] < 2)
  650. return PlayerIsNotAdmin( playerid );
  651.  
  652. new ID,
  653. pn[ MAX_PLAYER_NAME ],
  654. an[ MAX_PLAYER_NAME ],
  655. str[ 128 ];
  656.  
  657. if(sscanf(params, "u", ID))
  658. return SendUsageError( playerid, "/pgoto [Name/ID]" );
  659.  
  660. if ( ID == INVALID_PLAYER_ID )
  661. return InvalidPlayerError( playerid );
  662.  
  663. if( ID == playerid)
  664. return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot teleport to yourself!");
  665.  
  666. GetPlayerName(playerid, an, MAX_PLAYER_NAME);
  667. GetPlayerName(ID, pn, MAX_PLAYER_NAME);
  668.  
  669. new Float:x;
  670. new Float:y;
  671. new Float:z;
  672. GetPlayerPos(ID, x, y, z);
  673.  
  674. SetPlayerPos(playerid, x+1, y+1, z);
  675.  
  676. format(str, sizeof(str), "[TELEPORT] You have been teleported to %s", pn);
  677. SendClientMessage(playerid, 0x008080FF, str);
  678. format(str, sizeof(str), "[TELEPORT] Administrator %s has teleported to your location", an);
  679. SendClientMessage(ID, 0x008080FF, str);
  680.  
  681. if(IsPlayerInAnyVehicle(playerid))
  682. {
  683. GetPlayerPos(ID, x, y, z);
  684. SetVehiclePos(playerid, x+1, y+1, z);
  685. }
  686. return 1;
  687. }
  688.  
  689. CMD:cc(playerid, params[])
  690. {
  691. if(pInfo[playerid][Adminlevel] < 2)
  692. return PlayerIsNotAdmin( playerid );
  693.  
  694. else
  695. {
  696.  
  697. for(new i = 0; i < 50; i++) SendClientMessageToAll(COLOR_WHITE," ");
  698. new string[64], pName[MAX_PLAYER_NAME];
  699. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  700. format(string,sizeof string,"*Admin %s has cleared the chat!",pName);
  701. SendClientMessageToAll(0xFF9500FF,string);
  702.  
  703. }
  704. return 1;
  705. }
  706.  
  707. CMD:healme(playerid, params[])
  708. {
  709. if(pInfo[playerid][Adminlevel] < 2)
  710. return PlayerIsNotAdmin( playerid );
  711.  
  712. SetPlayerHealth(playerid, 100);
  713. SendClientMessage(playerid, 0x008080FF, "[HEAL] You have healed yourself");
  714. return 1;
  715. }
  716.  
  717. CMD:armourme(playerid, params[])
  718. {
  719. if(pInfo[playerid][Adminlevel] < 2)
  720. return PlayerIsNotAdmin( playerid );
  721.  
  722. SetPlayerArmour(playerid, 100);
  723. SendClientMessage(playerid, 0x008080FF, "[ARMOUR] You have given yourself armour!");
  724. return 1;
  725. }
  726.  
  727. CMD:fixme(playerid, params[])
  728. {
  729. if(pInfo[playerid][Adminlevel] < 2)
  730. return PlayerIsNotAdmin( playerid );
  731.  
  732. if(!IsPlayerInAnyVehicle(playerid))
  733. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You are not inside a vehicle!");
  734.  
  735. SetVehicleHealth(playerid, 1000);
  736. RepairVehicle(GetPlayerVehicleID(playerid));
  737. SendClientMessage(playerid, 0x008080FF, "[VEHICLE FIXED] You have successfully repaired your vehicle!");
  738. return 1;
  739. }
  740.  
  741. /*______________________________________________________________________________*/
  742.  
  743. CMD:akill(playerid, params[])
  744. {
  745. new id,
  746. reason[128];
  747.  
  748. if( pInfo[playerid][Adminlevel] < 3)
  749. return PlayerIsNotAdmin( playerid );
  750.  
  751. if( sscanf(params, "us", id, reason) )
  752. return SendUsageError( playerid, "/akill [ID] [Reason]" );
  753.  
  754. if ( id == INVALID_PLAYER_ID )
  755. return InvalidPlayerError( playerid );
  756.  
  757. if( playerid == id)
  758. return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot kill yourself!");
  759.  
  760. SetPlayerHealth(id, 0);
  761.  
  762. new str[128],
  763. name1[MAX_PLAYER_NAME],
  764. name[MAX_PLAYER_NAME];
  765.  
  766. GetPlayerName(playerid,name1,MAX_PLAYER_NAME);
  767. GetPlayerName(id,name,MAX_PLAYER_NAME);
  768.  
  769. format(str, sizeof(str), "[KILL] Administrator %s has killed %s. Reason: %s", name1, name, reason);
  770. SendClientMessageToAll(RED, str);
  771. return 1;
  772. }
  773.  
  774. CMD:freeze( playerid, params[] )
  775. {
  776. if ( pInfo[ playerid ][ Adminlevel ] < 3 )
  777. return SendClientMessage( playerid, RED, "You are not authorised to use this command" );
  778.  
  779. new
  780. id,
  781. minutes,
  782. reason[ 128 ];
  783.  
  784. if ( sscanf( params, "uis", id, minutes, reason ) )
  785. return SendUsageError( playerid, "/freeze [Name/ID] [Minutes] [Reason]" );
  786.  
  787. if ( id == INVALID_PLAYER_ID )
  788. return InvalidPlayerError( playerid );
  789.  
  790. if ( playerFrozen{ id } )
  791. return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} Player is already frozen!" );
  792.  
  793. new
  794. time = ( minutes * 60000 );
  795.  
  796. SetTimerEx( "FreezeTimer", time, false, "i", id );
  797.  
  798. new
  799. str[ 128 ];
  800. format( str, sizeof ( str ), "[FREEZE] Administrator %s has frozen %s for %i minutes. Reason: %s",
  801. GetName( playerid ), GetName( id ), minutes, reason );
  802.  
  803. SendClientMessageToAll( RED, str );
  804.  
  805. playerFrozen{ id } = true;
  806.  
  807. TogglePlayerControllable(id,0);
  808.  
  809. return 1;
  810. }
  811.  
  812. forward FreezeTimer( playerid );
  813. public FreezeTimer( playerid )
  814. {
  815. if ( !playerFrozen{ playerid } )
  816. return 1;
  817.  
  818. new
  819. str[ 128 ];
  820. format( str, sizeof ( str ), "[AUTO - UNFREEZE] %s has been automatically unfrozen.", GetName( playerid ) );
  821. SendClientMessageToAll(RED, str);
  822. playerFrozen{ playerid } = false;
  823. TogglePlayerControllable(playerid,1);
  824. return 1;
  825. }
  826.  
  827. CMD:unfreeze( playerid, params[ ] )
  828. {
  829. if ( pInfo[ playerid ][ Adminlevel ] < 3 )
  830. return PlayerIsNotAdmin( playerid );
  831. new
  832. id;
  833.  
  834. if ( sscanf( params, "u", id ) )
  835. return SendUsageError( playerid, "/unmute [Name/ID]" );
  836.  
  837. if ( id == INVALID_PLAYER_ID )
  838. return InvalidPlayerError( playerid );
  839. if ( !playerFrozen{ id } )
  840. return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} Player is not frozen!" );
  841.  
  842. new
  843. str6[ 128 ];
  844. format( str6, sizeof ( str6 ), "[UNFREEZE] Administrator %s has unfrozen %s.", GetName( playerid ), GetName( id ) );
  845. SendClientMessageToAll( RED, str6 );
  846.  
  847. playerFrozen{ id } = false;
  848.  
  849. TogglePlayerControllable(id, 1);
  850.  
  851. return 1;
  852. }
  853.  
  854. CMD:pget(playerid,params[])
  855. {
  856. if(pInfo[playerid][Adminlevel] < 3)
  857. return PlayerIsNotAdmin( playerid );
  858.  
  859. new
  860. targetid,
  861. Float:x,
  862. Float:y,
  863. Float:z;
  864.  
  865. if(sscanf(params, "u", targetid))
  866. return SendUsageError( playerid, "/pget [Name/ID]" );
  867.  
  868. if ( targetid == INVALID_PLAYER_ID )
  869. return InvalidPlayerError( playerid );
  870.  
  871. if( targetid == playerid)
  872. return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot teleport to yourself!");
  873.  
  874. GetPlayerPos(playerid, x, y, z);
  875. SetPlayerPos(targetid, x+1, y+1, z);
  876.  
  877. new str[128],
  878. aname[MAX_PLAYER_NAME],
  879. name[MAX_PLAYER_NAME];
  880.  
  881. GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
  882. GetPlayerName(targetid, name, MAX_PLAYER_NAME);
  883.  
  884. format(str, sizeof (str), "[TELEPORT] You have teleported %s to your current location!", name);
  885. SendClientMessage(playerid, 0x008080FF, str);
  886. format(str, sizeof (str), "[TELEPORT] Administrator %s has teleported you to his location!", aname);
  887. SendClientMessage(targetid, 0x008080FF, str);
  888. return 1;
  889. }
  890.  
  891. CMD:respawncars(playerid, params[])
  892. {
  893. if(pInfo[playerid][Adminlevel] < 3)
  894. return PlayerIsNotAdmin( playerid );
  895. {
  896. for(new i = 0; i < MAX_VEHICLES; i++)
  897. {
  898. SetVehicleToRespawn(i);
  899. }
  900. new string[64], pName[MAX_PLAYER_NAME];
  901. GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
  902. format(string,sizeof string,"*Admin %s has re-spawned all vehicles!",pName);
  903. SendClientMessageToAll(0xFF9500FF,string);
  904. return 1;
  905. }
  906. }
  907.  
  908.  
  909. CMD:pheal(playerid, params[])
  910. {
  911. if(pInfo[playerid][Adminlevel] < 3)
  912. return PlayerIsNotAdmin( playerid );
  913.  
  914. new
  915. playertoheal;
  916.  
  917. if( sscanf(params, "u", playertoheal ) )
  918. return SendUsageError( playerid, "/pheal [ID]" );
  919.  
  920. if( playertoheal == playerid )
  921. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot heal yourself using this command, please use /heal!");
  922.  
  923. else if ( playertoheal == INVALID_PLAYER_ID )
  924. return InvalidPlayerError( playerid );
  925.  
  926. SetPlayerHealth(playertoheal, 100);
  927.  
  928. new
  929. str[128],
  930. aname[MAX_PLAYER_NAME],
  931. name[MAX_PLAYER_NAME];
  932.  
  933. GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
  934. GetPlayerName(playertoheal,name,MAX_PLAYER_NAME);
  935.  
  936. format( str, sizeof (str), "[HEAL] You have healed %s!", name);
  937. SendClientMessage(playerid, 0x008080FF, str);
  938. format( str, sizeof (str), "[HEALED] You have been healed by Administrator %s",aname);
  939. SendClientMessage(playertoheal, 0x008080FF, str);
  940. return 1;
  941.  
  942. }
  943.  
  944. CMD:parmour(playerid, params[])
  945. {
  946. if(pInfo[playerid][Adminlevel] < 3)
  947. return PlayerIsNotAdmin( playerid );
  948.  
  949. new
  950. playertoarmour;
  951.  
  952. if(sscanf(params, "u", playertoarmour ) )
  953. return SendUsageError( playerid, "/parmour [ID]" );
  954.  
  955. if( playertoarmour == playerid )
  956. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot give yourself armour using this command, please use /armour");
  957.  
  958. else if ( playertoarmour == INVALID_PLAYER_ID )
  959. return InvalidPlayerError( playerid );
  960.  
  961. SetPlayerArmour(playertoarmour, 100);
  962.  
  963. new str[128],
  964. aname[MAX_PLAYER_NAME],
  965. name[MAX_PLAYER_NAME];
  966.  
  967. GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
  968. GetPlayerName(playertoarmour,name,MAX_PLAYER_NAME);
  969.  
  970. format( str, sizeof (str), "[ARMOUR] You have given %s full armour!", name);
  971. SendClientMessage(playerid, 0x008080FF, str);
  972. format( str, sizeof (str), "[ARMOUR] You were given full armour by Administrator %s",aname);
  973. SendClientMessage(playertoarmour, 0x008080FF, str);
  974. return 1;
  975.  
  976. }
  977.  
  978.  
  979. CMD:kick(playerid, params[])
  980. {
  981. if(pInfo[playerid][Adminlevel] < 3)
  982. return PlayerIsNotAdmin( playerid );
  983.  
  984. new id,
  985. reason[128];
  986.  
  987. if( sscanf(params, "us", id, reason))
  988. return SendUsageError( playerid, "/kick [Name/ID] [Reason]" );
  989.  
  990. if( id == playerid)
  991. return SendClientMessage( playerid, RED, "ERROR: {FFFFFF}You cannot kick yourself" );
  992.  
  993. if(id == INVALID_PLAYER_ID)
  994. return InvalidPlayerError( playerid );
  995.  
  996. new
  997. name1[MAX_PLAYER_NAME],
  998. name[MAX_PLAYER_NAME],
  999. str[128];
  1000.  
  1001. GetPlayerName(playerid,name1,MAX_PLAYER_NAME);
  1002. GetPlayerName(id,name,MAX_PLAYER_NAME);
  1003.  
  1004. format(str, sizeof (str), "[KICK] Administrator %s has kicked %s. Reason: %s", name1, name, reason);
  1005. SendClientMessageToAll(RED, str);
  1006. SetTimerEx( "KickPlayer",100, false, "i", id);
  1007. return 1;
  1008. }
  1009.  
  1010. forward KickPlayer( playerid );
  1011. public KickPlayer( playerid )
  1012. return Kick( playerid );
  1013.  
  1014. /*_____________________________________________________________________________*/
  1015.  
  1016.  
  1017. CMD:jail(playerid,params[])
  1018. {
  1019. if(pInfo[playerid][Adminlevel] < 4)
  1020. return PlayerIsNotAdmin( playerid );
  1021.  
  1022. new
  1023. id,
  1024. time,
  1025. reason[100],
  1026. plname[MAX_PLAYER_NAME],
  1027. GPlayerName[MAX_PLAYER_NAME],
  1028. szString[128];
  1029.  
  1030. if( sscanf(params,"dds",id,time,reason))
  1031. return SendUsageError(playerid, "/jail [Name/ID] [Minutes] [Reason]");
  1032.  
  1033. if( playerid == id )
  1034. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot jail yourself!");
  1035.  
  1036. if( playerid == INVALID_PLAYER_ID )
  1037. return InvalidPlayerError(playerid);
  1038.  
  1039. if( Jailed[id] == 1 )
  1040. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} This player is already jailed!");
  1041.  
  1042. GetPlayerName(id, plname, sizeof(plname));
  1043. GetPlayerName(playerid, GPlayerName, sizeof(GPlayerName));
  1044.  
  1045. format(szString, sizeof(szString), "[JAIL] Administrator %s(%d) has jailed %s(%d) for %d minute(s). Reason: %s", GetName(playerid), playerid, plname, id, time, reason);
  1046. SendClientMessageToAll(RED, szString);
  1047.  
  1048. SetPlayerInterior(id, 3);
  1049. SetPlayerVirtualWorld(id, 10);
  1050. SetPlayerFacingAngle(id, 360.0);
  1051. SetPlayerPos(id, 197.5662, 175.4800, 1004.0);
  1052. SetPlayerHealth(id, 9999999999.0);
  1053.  
  1054. ResetPlayerWeapons(id);
  1055.  
  1056. Jailed[id] = 1;
  1057. JailTimer[id] = SetTimerEx("Unjail",time*60000, false, "i", id);
  1058. return 1;
  1059. }
  1060.  
  1061. CMD:unjail(playerid,params[])
  1062. {
  1063. if(pInfo[playerid][Adminlevel] < 4)
  1064. return PlayerIsNotAdmin( playerid );
  1065.  
  1066. new id;
  1067.  
  1068. if( sscanf(params,"u",id))
  1069. return SendUsageError(playerid, "/unjail [Name/ID]");
  1070.  
  1071. if( playerid == id )
  1072. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot jail yourself!");
  1073.  
  1074. if( playerid == INVALID_PLAYER_ID )
  1075. return InvalidPlayerError(playerid);
  1076.  
  1077. if( Jailed[id] == 0)
  1078. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} This player is not jailed!");
  1079.  
  1080. new name[MAX_PLAYER_NAME],
  1081. aname[MAX_PLAYER_NAME],
  1082. str[ 128 ];
  1083.  
  1084. GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
  1085. GetPlayerName(id,name,MAX_PLAYER_NAME);
  1086.  
  1087. format(str, sizeof ( str ), "[UNJAIL] Administrator %s(d) has unjailed %s{%d)", aname, playerid, name, id);
  1088. SendClientMessageToAll(RED, str);
  1089.  
  1090. Jailed[id] = 0;
  1091. SetPlayerInterior(id, 0);
  1092. SetPlayerVirtualWorld(id, 0);
  1093. SpawnPlayer(id);
  1094. SetPlayerHealth(id, 100);
  1095. KillTimer(JailTimer[id]);
  1096. return 1;
  1097. }
  1098.  
  1099. public Unjail(playerid)
  1100. {
  1101. if(Jailed[playerid] == 0)
  1102. return 0;
  1103.  
  1104. new
  1105. playerName[24],
  1106. String[128];
  1107.  
  1108. GetPlayerName(playerid, playerName, sizeof(playerName));
  1109.  
  1110. format(String, sizeof(String), "[AUTO - UNJAIL] %s(%d) has been automatically released from jail.", playerName);
  1111. SendClientMessageToAll(RED, String);
  1112. Jailed[playerid] = 0;
  1113. SetPlayerInterior(playerid, 0);
  1114. SetPlayerVirtualWorld(playerid, 0);
  1115. SpawnPlayer(playerid);
  1116. SetPlayerHealth(playerid, 100);
  1117. KillTimer(JailTimer[playerid]);
  1118. return 1;
  1119. }
  1120.  
  1121. forward BanPlayer( playerid, reason[] );
  1122. public BanPlayer( playerid, reason[] )
  1123. return BanEx(playerid, reason);
  1124.  
  1125. CMD:ban(playerid, params[])
  1126. {
  1127. new
  1128. id,
  1129. reason[ 50 ];
  1130.  
  1131. if(pInfo[playerid][Adminlevel] < 4)
  1132. return PlayerIsNotAdmin( playerid );
  1133.  
  1134. if(sscanf(params, "us", id, reason))
  1135. return SendUsageError( playerid, "/ban [Name/ID] [Reason]" );
  1136.  
  1137. if( playerid == id )
  1138. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot ban yourself");
  1139.  
  1140. if( playerid == INVALID_PLAYER_ID )
  1141. return InvalidPlayerError(playerid);
  1142.  
  1143. new str[128],
  1144. aname[MAX_PLAYER_NAME],
  1145. name[MAX_PLAYER_NAME];
  1146.  
  1147. GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
  1148. GetPlayerName(id,name,MAX_PLAYER_NAME);
  1149.  
  1150. for(new i = 0; i < 50; i++) SendClientMessage(id, COLOR_WHITE," ");
  1151. format(str, sizeof (str), "[BAN] Administrator %s has banned %s. Reason: %s", aname, name, reason);
  1152. SendClientMessageToAll(RED, str);
  1153. new str1[128],
  1154. str2[128];
  1155. SendClientMessage(id,RED, "------------------------------------------------------------------------------------");
  1156. format(str1, sizeof (str1), "You were banned from the server by Administrator %s!", aname);
  1157. SendClientMessage(id, RED, str1);
  1158. format(str2, sizeof (str2), "Reason: %s", reason);
  1159. SendClientMessage(id, RED, str2);
  1160. SendClientMessage(id,RED, "If you think you were banned unfairly, you can make an unban appeal at our forums");
  1161. SendClientMessage(id,RED, "We do not unban hackers, and we do not unban players who lie in their unban appeal.");
  1162. SendClientMessage(id,RED, "------------------------------------------------------------------------------------");
  1163. SetTimerEx( "BanPlayer",100, false, "is[50]", id, reason);
  1164. SetTimerEx( "KickPlayer",100, false, "i", id);
  1165. return 1;
  1166. }
  1167.  
  1168. CMD:godon( playerid, params[] )
  1169. {
  1170. if ( pInfo[ playerid ][ Adminlevel ] < 4 )
  1171. return PlayerIsNotAdmin( playerid );
  1172.  
  1173. if ( playerGod{ playerid } )
  1174. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You already have god mode turned on!");
  1175.  
  1176. SetPlayerHealth(playerid, 9999999999.0);
  1177. SetPlayerArmour(playerid, 9999999999.0);
  1178.  
  1179. new
  1180. str[ 128 ];
  1181. format( str, sizeof ( str ), "[GODMODE - ON] Administrator %s has turned on Godmode.", GetName( playerid ) );
  1182. SendClientMessageToAll(RED, str);
  1183.  
  1184. playerGod{ playerid } = true;
  1185. return 1;
  1186. }
  1187.  
  1188. CMD:godoff( playerid, params[] )
  1189. {
  1190. if ( pInfo[ playerid ][ Adminlevel ] < 4 )
  1191. return PlayerIsNotAdmin( playerid );
  1192.  
  1193. if ( !playerGod{ playerid } )
  1194. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You already have god mode turned off!");
  1195.  
  1196. SetPlayerHealth(playerid, 100);
  1197. SetPlayerArmour(playerid, 100);
  1198.  
  1199. new
  1200. str[ 128 ];
  1201. format( str, sizeof ( str ), "[GODMODE - OFF] Administrator %s has turned off his Godmode.", GetName( playerid ) );
  1202. SendClientMessageToAll(RED, str);
  1203.  
  1204. playerGod{ playerid } = false;
  1205. return 1;
  1206. }
  1207.  
  1208. CMD:setscore(playerid, params[])
  1209. {
  1210. if(pInfo[playerid][Adminlevel] < 4)
  1211. return PlayerIsNotAdmin( playerid );
  1212.  
  1213. new id,
  1214. score;
  1215.  
  1216. if(sscanf(params, "ud", id, score))
  1217. return SendUsageError( playerid, "/setscore [Name/ID] [Score]" );
  1218.  
  1219. if( id == playerid )
  1220. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot set your own score!");
  1221.  
  1222. if ( id == INVALID_PLAYER_ID )
  1223. return InvalidPlayerError( playerid );
  1224.  
  1225. SetPlayerScore(id, score);
  1226.  
  1227. new str[128],
  1228. aname[MAX_PLAYER_NAME],
  1229. name[MAX_PLAYER_NAME];
  1230.  
  1231. GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
  1232. GetPlayerName(id,name,MAX_PLAYER_NAME);
  1233.  
  1234. format(str, sizeof (str), "[SCORE] You have set %s's score to %i", name, score);
  1235. SendClientMessage(playerid, 0x008080FF, str);
  1236. format(str, sizeof (str), "[SCORE] Administrator %s has set your score to %i", aname, score);
  1237. SendClientMessage(id, 0x008080FF, str);
  1238. return 1;
  1239. }
  1240.  
  1241. CMD:setmoney(playerid, params[])
  1242. {
  1243. if(pInfo[playerid][Adminlevel] < 4)
  1244. return PlayerIsNotAdmin( playerid );
  1245.  
  1246. new id,
  1247. amount;
  1248.  
  1249. if( sscanf(params, "ui", id, amount))
  1250. return SendUsageError( playerid, "/setmoney [Name/ID] [Cash]" );
  1251.  
  1252. if( id == playerid)
  1253. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot set your own cash!");
  1254.  
  1255. if ( id == INVALID_PLAYER_ID )
  1256. return InvalidPlayerError( playerid );
  1257.  
  1258. new str[128],
  1259. aname[MAX_PLAYER_NAME],
  1260. name[MAX_PLAYER_NAME];
  1261.  
  1262. GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
  1263. GetPlayerName(id,name,MAX_PLAYER_NAME);
  1264.  
  1265. format(str, sizeof (str), "[MONEY] You have set %s's cash to $%i", name, amount);
  1266. SendClientMessage(playerid, 0x008080FF, str);
  1267. format(str, sizeof (str), "[MONEY] Administrator %s has set your cash to $%i", aname, amount);
  1268. SendClientMessage(id, 0x008080FF, str);
  1269. GivePlayerMoney( id, - GetPlayerMoney( id ) + amount );
  1270. return 1;
  1271.  
  1272. }
  1273.  
  1274. CMD:givemoney(playerid, params[])
  1275. {
  1276. if(pInfo[playerid][Adminlevel] < 4)
  1277. return PlayerIsNotAdmin( playerid );
  1278.  
  1279. new
  1280. id,
  1281. amount;
  1282.  
  1283. if( sscanf(params, "ui", id, amount))
  1284. return SendUsageError( playerid, "/givemoney [Name/ID] [Amount]" );
  1285.  
  1286. if( id == playerid )
  1287. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot give yourself money!");
  1288.  
  1289. if ( id == INVALID_PLAYER_ID )
  1290. return InvalidPlayerError( playerid );
  1291.  
  1292. GivePlayerMoney(id, amount);
  1293.  
  1294. new str[128],
  1295. aname[MAX_PLAYER_NAME],
  1296. name[MAX_PLAYER_NAME];
  1297.  
  1298. GetPlayerName(playerid,aname,MAX_PLAYER_NAME);
  1299. GetPlayerName(id,name,MAX_PLAYER_NAME);
  1300.  
  1301. format(str, sizeof (str), "[MONEY] You have given %s, $%i", name, amount);
  1302. SendClientMessage(playerid, 0x008080FF, str);
  1303. format(str, sizeof (str), "[MONEY] Administrator %s, has given you $%i", aname, amount);
  1304. SendClientMessage(id, 0x008080FF, str);
  1305. return 1;
  1306.  
  1307. }
  1308.  
  1309. CMD:mute( playerid, params[] )
  1310. {
  1311. if ( pInfo[ playerid ][ Adminlevel ] < 4 )
  1312. return PlayerIsNotAdmin( playerid );
  1313.  
  1314. new
  1315. id,
  1316. minutes,
  1317. reason[ 128 ];
  1318.  
  1319. if ( sscanf( params, "uis", id, minutes, reason ) )
  1320. return SendUsageError(playerid, "/mute [Name/ID] [Minutes] [Reason]");
  1321.  
  1322. if ( id == playerid )
  1323. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot mute yourself!");
  1324.  
  1325. if ( id == INVALID_PLAYER_ID )
  1326. return InvalidPlayerError(playerid);
  1327.  
  1328. if ( playerMuted{ id } )
  1329. return SendClientMessage( playerid, RED, "ERROR{FFFFFF} Player is already muted." );
  1330.  
  1331. new
  1332. time = ( minutes * 60000 );
  1333.  
  1334. SetTimerEx( "MuteTimer", time, false, "i", id );
  1335.  
  1336. new
  1337. str[ 128 ];
  1338. format( str, sizeof ( str ), "[MUTE] Administrator %s has muted %s for %i minutes. Reason: %s",
  1339. GetName( playerid ), GetName( id ), minutes, reason );
  1340.  
  1341. SendClientMessageToAll( RED, str );
  1342.  
  1343. playerMuted{ id } = true;
  1344.  
  1345.  
  1346. return 1;
  1347. }
  1348.  
  1349. forward MuteTimer( playerid );
  1350. public MuteTimer( playerid )
  1351. {
  1352. if ( !playerMuted{ playerid } )
  1353. return 1;
  1354.  
  1355. new
  1356. str[ 128 ];
  1357. format( str, sizeof ( str ), "[AUTO - UNMUTE] %s has been automatically unmuted.", GetName( playerid ) );
  1358. SendClientMessageToAll(RED, str);
  1359. playerMuted{ playerid } = false;
  1360. return 1;
  1361. }
  1362.  
  1363.  
  1364. CMD:unmute( playerid, params[ ] )
  1365. {
  1366. if ( pInfo[ playerid ][ Adminlevel ] < 4 )
  1367. return PlayerIsNotAdmin( playerid );
  1368. new
  1369. id;
  1370.  
  1371. if ( sscanf( params, "u", id ) )
  1372. return SendClientMessage( playerid, RED, "USAGE : /unmute [id/name]" );
  1373.  
  1374. if ( id == playerid )
  1375. return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} You cannot unmute yourself." );
  1376.  
  1377. if ( id == INVALID_PLAYER_ID )
  1378. return InvalidPlayerError(playerid);
  1379.  
  1380. if ( !playerMuted{ id } )
  1381. return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} Player is not muted." );
  1382.  
  1383. new
  1384. str6[ 128 ];
  1385. format( str6, sizeof ( str6 ), "[UNMUTE] Administrator %s has unmuted %s.", GetName( playerid ), GetName( id ) );
  1386. SendClientMessageToAll( RED, str6 );
  1387.  
  1388. playerMuted{ id } = false;
  1389.  
  1390. return 1;
  1391. }
  1392.  
  1393. CMD:spec(playerid, params[])
  1394. {
  1395. if(pInfo[playerid][Adminlevel] < 4)
  1396. return PlayerIsNotAdmin( playerid );
  1397.  
  1398. new
  1399. pid;
  1400.  
  1401. if( sscanf(params,"d",pid))
  1402. return SendUsageError( playerid, "/spec [ID]" );
  1403.  
  1404. if ( pid == INVALID_PLAYER_ID )
  1405. return InvalidPlayerError( playerid );
  1406.  
  1407. if( pid == playerid)
  1408. return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot spectate yourself!");
  1409.  
  1410. if(GetPVarInt(playerid, "Spectating") == 1)
  1411. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You are already spectating. (/specoff)");
  1412.  
  1413. SetPVarInt(playerid, "Spectating", 1);
  1414. StartPlayerSpec(playerid, pid);
  1415.  
  1416. new str[128],
  1417. name[MAX_PLAYER_NAME];
  1418. GetPlayerName(pid,name,MAX_PLAYER_NAME);
  1419.  
  1420. format(str, sizeof (str), "[SPECTATING] You are now spectating %s!", name);
  1421. SendClientMessage(playerid, 0x008080FF, str);
  1422. return 1;
  1423. }
  1424.  
  1425. CMD:specoff(playerid, params[])
  1426. {
  1427. if(pInfo[playerid][Adminlevel] < 4)
  1428. return PlayerIsNotAdmin( playerid );
  1429.  
  1430. if(GetPVarInt(playerid, "Spectating") == 0)
  1431. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You are not spectating anyone.");
  1432.  
  1433. DeletePVar(playerid, "Spectating");
  1434. StopPlayerSpec(playerid);
  1435. SendClientMessage(playerid, 0x008080FF, "[SPECTATE] You have stopped spectating!");
  1436. return 1;
  1437. }
  1438.  
  1439. /*______________________________________________________________________________*/
  1440.  
  1441. CMD:warn( playerid, params[ ] )
  1442. {
  1443. if ( pInfo[ playerid ][ Adminlevel ] < 5)
  1444. return PlayerIsNotAdmin( playerid );
  1445.  
  1446. new
  1447. id,
  1448. reason[ 128 ];
  1449.  
  1450. if ( sscanf( params, "us", id, reason ) )
  1451. return SendClientMessage( playerid, RED, "USAGE: /warn [id/name] [reason]" );
  1452.  
  1453. if ( id == INVALID_PLAYER_ID )
  1454. return SendClientMessage( playerid, RED, "That player is not connected." );
  1455.  
  1456. if ( id == playerid )
  1457. return SendClientMessage( playerid, RED, "ERROR: You cannot warn yourself!" );
  1458.  
  1459. pInfo[ id ][ Warnings ] ++;
  1460.  
  1461. new
  1462. str[ 128 ];
  1463. format( str, sizeof ( str ), "[WARN] Administrator %s has warned %s. Reason: %s (Warning %i / 3)",
  1464. GetName( playerid ), GetName( id ), reason, pInfo[ id ][ Warnings ] );
  1465.  
  1466. SendClientMessageToAll( RED, str );
  1467.  
  1468. if ( pInfo[ id ][ Warnings ] == 3 )
  1469. {
  1470. format( str, sizeof ( str ), "[AUTO - KICK] %s has been kicked due to having a total of 3 warnings.", GetName( id ) );
  1471. SendClientMessageToAll( RED, str );
  1472. pInfo[ id ][ Warnings ] = 0;
  1473. SetTimerEx( "KickPlayer", 100, false, "i", id );
  1474. }
  1475.  
  1476. return 1;
  1477. }
  1478.  
  1479. CMD:setvip( playerid, params[ ] )
  1480. {
  1481. new
  1482. targetid,
  1483. level;
  1484.  
  1485. if ( pInfo[ playerid ][ Adminlevel ] < 5 )
  1486. return PlayerIsNotAdmin( playerid );
  1487.  
  1488. if ( sscanf( params, "ui", targetid, level ) )
  1489. return SendUsageError( playerid, "/setvip [Name/ID] [Level]" );
  1490.  
  1491. if ( targetid == INVALID_PLAYER_ID )
  1492. return InvalidPlayerError( playerid );
  1493.  
  1494. if ( targetid == playerid )
  1495. return SendClientMessage( playerid, RED, "ERROR: {FFFFFF}You cannot set your own V.I.P level" );
  1496.  
  1497. if ( level < 0 || level > 3 )
  1498. return SendClientMessage ( playerid, RED, "ERROR: {FFFFFF}Invalid V.I.P level");
  1499.  
  1500. new str[ 128 ];
  1501. format( str, 128, "Your V.I.P level has been set to %i", level );
  1502. SendClientMessage(targetid,RED, str );
  1503. pInfo[ targetid ][ VIPlevel ] = level;
  1504. format( str, sizeof ( str ), "%s's V.I.P level has been set to %i", GetName( targetid ), level );
  1505. SendMessageToAdmins( RED, str );
  1506. return 1;
  1507. }
  1508.  
  1509. CMD:disablechat(playerid, params[])
  1510. {
  1511. if ( pInfo[ playerid ][ Adminlevel ] < 5 )
  1512. return PlayerIsNotAdmin( playerid );
  1513.  
  1514. if ( ChatDisabled == 1 )
  1515. return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} Chat is already disabled!");
  1516.  
  1517. ChatDisabled = 1;
  1518.  
  1519. SendClientMessage(playerid, INFO, "[CHAT DISABLED] You have sucesfully disabled the chat!");
  1520.  
  1521. new
  1522. str[128];
  1523.  
  1524. format(str, sizeof(str), "[CHAT DISABLED] Administrator %s has disabled the chat, only Administrators can now talk!", GetName(playerid));
  1525. SendClientMessageToAll(RED, str);
  1526. return 1;
  1527. }
  1528.  
  1529. CMD:enablechat(playerid, params[])
  1530. {
  1531. if ( pInfo[ playerid ][ Adminlevel ] < 5 )
  1532. return PlayerIsNotAdmin( playerid );
  1533.  
  1534. if ( ChatDisabled == 0 )
  1535. return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} Chat is already enabled!");
  1536.  
  1537. ChatDisabled = 0;
  1538.  
  1539. SendClientMessage(playerid, INFO, "[CHAT ENABLED] You have sucesfully enabled the chat!");
  1540.  
  1541. new
  1542. str[128];
  1543.  
  1544. format(str, sizeof(str), "[CHAT ENABLED] Administrator %s has enabled the chat, everyone can now talk!", GetName(playerid));
  1545. SendClientMessageToAll(RED, str);
  1546. return 1;
  1547. }
  1548.  
  1549. /*_____________________________________________________________________________*/
  1550.  
  1551. CMD:restart(playerid, params[])
  1552. {
  1553. if(pInfo[playerid][Adminlevel] < 6)
  1554. return PlayerIsNotAdmin( playerid );
  1555.  
  1556. GameTextForAll("~r~THE SERVER IS RESTARTING",10000,5);
  1557. for(new i = 0; i < 50; i++) SendClientMessageToAll(COLOR_WHITE," ");
  1558. SendRconCommand("gmx");
  1559. return 1;
  1560. }
  1561.  
  1562.  
  1563. /*_____________________________________________________________________________*/
  1564.  
  1565. CMD:setlevel( playerid, params[ ] )
  1566. {
  1567. new
  1568. targetid,
  1569. level;
  1570.  
  1571. if ( pInfo[ playerid ][ Adminlevel ] < 7 )
  1572. return PlayerIsNotAdmin( playerid );
  1573.  
  1574. if ( sscanf( params, "ui", targetid, level ) )
  1575. return SendUsageError( playerid, "/setlevel [Name/ID] [Level]" );
  1576.  
  1577. if ( targetid == playerid )
  1578. return SendClientMessage( playerid, RED, "ERROR: {FFFFFF}You cannot set your own Admin level" );
  1579.  
  1580. if ( targetid == INVALID_PLAYER_ID )
  1581. return InvalidPlayerError( playerid );
  1582.  
  1583. if ( level < 0 || level > 6 )
  1584. return SendClientMessage ( playerid, RED, "ERROR: {FFFFFF}Invalid Admin level");
  1585.  
  1586. new str[ 128 ];
  1587. format( str, 128, "[ADMIN LEVEL] Head Administrator %s has set %s's Admin status to %i", GetName ( playerid ), GetName ( targetid ), level );
  1588. SendClientMessage(targetid,RED, str );
  1589. pInfo[ targetid ][ Adminlevel ] = level;
  1590. format( str, sizeof ( str ), "[ADMINS] %s changed %s's Admin level to %i", GetName ( playerid ), GetName ( targetid ), level );
  1591. SendMessageToAdmins( RED, str );
  1592. return 1;
  1593. }
  1594.  
  1595.  
  1596.  
  1597. /*_____________________________________________________________________________*/
  1598.  
  1599. /*__________________________VIP COMMANDS___________________________________*/
  1600.  
  1601. CMD:addnos( playerid, params[ ] )
  1602. {
  1603. if ( pInfo[ playerid ][ VIPlevel ] < 1 )
  1604. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} Permission denied!");
  1605.  
  1606. if ( !IsPlayerInAnyVehicle( playerid ) )
  1607. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You must be inside a vehicle!");
  1608.  
  1609. switch( GetVehicleModel( GetPlayerVehicleID( playerid ) ) )
  1610. {
  1611. case 448, 461, 462, 463, 468, 471, 509, 510, 521, 522, 523, 581, 586, 449:
  1612. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot tune this vehicle!");
  1613. }
  1614.  
  1615. AddVehicleComponent( GetPlayerVehicleID( playerid ), 1010 );
  1616. PlayerPlaySound( playerid, 1056, 0.0, 0.0, 0.0 );
  1617. return 1;
  1618. }
  1619.  
  1620. CMD:flip( playerid, params[ ] )
  1621. {
  1622. if ( pInfo[ playerid ][ VIPlevel ] < 1 )
  1623. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} Permission denied!");
  1624.  
  1625. new Float: zAng;
  1626. GetVehicleZAngle( GetPlayerVehicleID( playerid ), zAng );
  1627. SetVehicleZAngle( GetPlayerVehicleID( playerid ), zAng );
  1628. SendClientMessage(playerid, RED, "[FLIPPED] Vehicle sucesfully flipped");
  1629. return 1;
  1630. }
  1631.  
  1632. /*_____________________________________________________________________________*/
  1633.  
  1634. CMD:vcmds(playerid, params[ ])
  1635. {
  1636. ShowPlayerDialog(playerid, 500, DIALOG_STYLE_MSGBOX, "VIP Commands", "Level 1: /nos, /flip \nLevel 2: /vspec, /vspecoff \nLevel 3: /jetpack", "Ok", "");
  1637. }
  1638.  
  1639. CMD:vspec(playerid, params[])
  1640. {
  1641. if ( pInfo[ playerid ][ VIPlevel ] < 2 )
  1642. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} Permission denied!");
  1643.  
  1644. new
  1645. pid;
  1646.  
  1647. if( sscanf(params,"d",pid))
  1648. return SendUsageError( playerid, "/spec [ID]" );
  1649.  
  1650. if ( pid == INVALID_PLAYER_ID )
  1651. return InvalidPlayerError( playerid );
  1652.  
  1653. if( pid == playerid)
  1654. return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot spectate yourself!");
  1655.  
  1656. if( GetPVarInt(playerid, "Spectating") == 1)
  1657. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You are already spectating. (/specoff)");
  1658.  
  1659. SetPVarInt(playerid, "Spectating", 1);
  1660. StartPlayerSpec(playerid, pid);
  1661.  
  1662. new str[128],
  1663. name[MAX_PLAYER_NAME];
  1664. GetPlayerName(pid,name,MAX_PLAYER_NAME);
  1665.  
  1666. format(str, sizeof (str), "[SPECTATING] You are now spectating %s!", name);
  1667. SendClientMessage(playerid, 0x008080FF, str);
  1668. return 1;
  1669. }
  1670.  
  1671. CMD:vspecoff(playerid, params[])
  1672. {
  1673. if ( pInfo[ playerid ][ VIPlevel ] < 2 )
  1674. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} Permission denied!");
  1675.  
  1676. if(GetPVarInt(playerid, "Spectating") == 0)
  1677. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You are not spectating anyone.");
  1678.  
  1679. DeletePVar(playerid, "Spectating");
  1680. StopPlayerSpec(playerid);
  1681. SendClientMessage(playerid, 0x008080FF, "[SPECTATE] You have stopped spectating!");
  1682. return 1;
  1683. }
  1684.  
  1685. /*_____________________________________________________________________________*/
  1686.  
  1687. CMD:jetpack(playerid, params[])
  1688. {
  1689. if ( pInfo[ playerid ][ VIPlevel ] < 2 )
  1690. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} Permission denied!");
  1691.  
  1692. SendClientMessage(playerid, RED, "You have sucesfully spawned a jetpack!");
  1693. SetPlayerSpecialAction(playerid,SPECIAL_ACTION_USEJETPACK);
  1694. return 1;
  1695. }
  1696.  
  1697. /*________________________________________________ NORMAL PLAYER COMMANDS ______________________________*/
  1698.  
  1699. CMD:status( playerid, params[ ] )
  1700. {
  1701. new
  1702. str[ 1024 ];
  1703.  
  1704. format( str, sizeof ( str ),
  1705. "{FFFFFF}Admin Level: {33FF33}%d \n\
  1706. {FFFFFF}VIP Level: {33FF33}%d \n\
  1707. {FFFFFF}Total warnings: {33FF33}%d \n\
  1708. {FFFFFF}Money: {33FF33}$%d \n\
  1709. {FFFFFF}Score: {33FF33}%d \n\
  1710. {FFFFFF}Kills: {33FF33}%d \n\
  1711. {FFFFFF}Deaths: {33FF33}%d",
  1712. pInfo[ playerid ][ Adminlevel ], pInfo[ playerid ][ VIPlevel ], pInfo[ playerid ][ Warnings ], GetPlayerMoney( playerid ), GetPlayerScore( playerid ), pInfo[ playerid ][ Kills ], pInfo[ playerid ][ Deaths ] );
  1713.  
  1714. ShowPlayerDialog( playerid, 1337, DIALOG_STYLE_MSGBOX, "{FFFFFF}Your stats",
  1715. str, "Okay", "" );
  1716. return 1;
  1717. }
  1718.  
  1719. CMD:pm(playerid, params[])
  1720. {
  1721. new
  1722. str[ 256 ],
  1723. str2[ 256 ],
  1724. id,
  1725. Name1[ MAX_PLAYER_NAME ],
  1726. Name2[ MAX_PLAYER_NAME ];
  1727.  
  1728. if(sscanf(params, "us", id, str2))
  1729. {
  1730. SendClientMessage(playerid, 0x009DFFFF,"USAGE:{FFFFFF} /pm [ID] [Message]");
  1731. return 1;
  1732. }
  1733.  
  1734. if(!IsPlayerConnected(id))
  1735. return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} This player is not connected");
  1736.  
  1737. if(playerid == id)
  1738. return SendClientMessage(playerid, 0xFF0000FF, "ERROR:{FFFFFF} You cannot send a PM yourself!");
  1739. {
  1740. GetPlayerName(playerid, Name1, sizeof(Name1));
  1741. GetPlayerName(id, Name2, sizeof(Name2));
  1742. format(str, sizeof(str), "PM sent to %s(%d): %s", Name2, id, str2);
  1743. SendClientMessage(playerid, 0xFFF700FF, str);
  1744. format(str, sizeof(str), "PM from %s(%d): %s", Name1, playerid, str2);
  1745. SendClientMessage(id, 0xFFF700FF, str);
  1746. }
  1747. return 1;
  1748. }
  1749.  
  1750. CMD:admins(playerid, params[])
  1751. {
  1752. new count = 0, string[256];
  1753. SendClientMessage(playerid, 0x0AFF1FFF,"-----|Current online Admins|------");
  1754. for(new i = 0; i < MAX_PLAYERS; i ++)
  1755. {
  1756. if(IsPlayerConnected(i))
  1757. {
  1758. if(hide[i] == 0)
  1759. {
  1760. if(pInfo[i][Adminlevel] == 1)
  1761. {
  1762. format(string, sizeof(string),"Admin Rank 1:{FFFFFF} (%d) %s", i, PlayerName(i));
  1763. SendClientMessage(playerid, 0x00B3FFFF, string);
  1764. count++;
  1765. }
  1766. if(pInfo[i][Adminlevel] == 2)
  1767. {
  1768. format(string, sizeof(string),"Admin Rank 2:{FFFFFF} (%d) %s", i, PlayerName(i));
  1769. SendClientMessage(playerid, 0x00B3FFFF, string);
  1770. count++;
  1771. }
  1772. if(pInfo[i][Adminlevel] == 3)
  1773. {
  1774. format(string, sizeof(string),"Admin Rank 3:{FFFFFF} (%d) %s", i, PlayerName(i));
  1775. SendClientMessage(playerid, 0x00B3FFFF, string);
  1776. count++;
  1777. }
  1778. if(pInfo[i][Adminlevel] == 4)
  1779. {
  1780. format(string, sizeof(string),"Admin Rank 4:{FFFFFF} (%d) %s", i, PlayerName(i));
  1781. SendClientMessage(playerid, 0x00B3FFFF, string);
  1782. count++;
  1783. }
  1784. if(pInfo[i][Adminlevel] == 5)
  1785. {
  1786. format(string, sizeof(string),"Admin Rank 5:{FFFFFF} (%d) %s", i, PlayerName(i));
  1787. SendClientMessage(playerid, 0x00B3FFFF, string);
  1788. count++;
  1789. }
  1790. if(pInfo[i][Adminlevel] == 6)
  1791. {
  1792. format(string, sizeof(string),"Admin Rank 6:{FFFFFF} (%d) %s", i, PlayerName(i));
  1793. SendClientMessage(playerid, 0x00B3FFFF, string);
  1794. count++;
  1795. }
  1796. if(pInfo[i][Adminlevel] == 7)
  1797. {
  1798. format(string, sizeof(string),"Head Administrator:{FFFFFF} (%d) %s", i, PlayerName(i));
  1799. SendClientMessage(playerid, 0xFF1212FF, string);
  1800. count++;
  1801. }
  1802. }
  1803. }
  1804. }
  1805. if(count == 0)
  1806. {
  1807. SendClientMessage(playerid, 0x00B3FFFF,"----|There are currently no Admins online|----");
  1808. }
  1809. return 1;
  1810. }
  1811.  
  1812. CMD:vips(playerid, params[])
  1813. {
  1814. new count = 0, string[256];
  1815. SendClientMessage(playerid, 0x0AFF1FFF,"-----|Current online VIPs|------");
  1816. for(new i = 0; i < MAX_PLAYERS; i ++)
  1817. {
  1818. if(IsPlayerConnected(i))
  1819. {
  1820. if(hide[i] == 0)
  1821. {
  1822. if(pInfo[i][VIPlevel] == 1)
  1823. {
  1824. format(string, sizeof(string),"Silver VIP:{FFFFFF} (%d) %s", i, PlayerName(i));
  1825. SendClientMessage(playerid, 0x00B3FFFF, string);
  1826. count++;
  1827. }
  1828. if(pInfo[i][VIPlevel] == 2)
  1829. {
  1830. format(string, sizeof(string),"Platinum VIP:{FFFFFF} (%d) %s", i, PlayerName(i));
  1831. SendClientMessage(playerid, 0x00B3FFFF, string);
  1832. count++;
  1833. }
  1834. if(pInfo[i][Adminlevel] == 3)
  1835. {
  1836. format(string, sizeof(string),"Gold VIP:{FFFFFF} (%d) %s", i, PlayerName(i));
  1837. SendClientMessage(playerid, 0x00B3FFFF, string);
  1838. count++;
  1839. }
  1840. }
  1841. }
  1842. }
  1843. if(count == 0)
  1844. {
  1845. SendClientMessage(playerid, 0x00B3FFFF,"----|There are currently no VIPs online|----");
  1846. }
  1847. return 1;
  1848. }
  1849.  
  1850.  
  1851. CMD:report( playerid, params[ ] )
  1852. {
  1853. new
  1854. targetid,
  1855. reason[ 128 ];
  1856.  
  1857. if ( sscanf( params, "us", targetid, reason ) )
  1858. return SendUsageError( playerid, "/report [Name/ID] [Reason]" );
  1859.  
  1860. if ( targetid == playerid )
  1861. return SendClientMessage( playerid, RED, "ERROR: {FFFFFF}You cannot report yourself." );
  1862.  
  1863. if ( targetid == INVALID_PLAYER_ID )
  1864. return InvalidPlayerError( playerid );
  1865.  
  1866. SendClientMessage( playerid, RED, "Your report has been successfully been sent to all online Administrators!" );
  1867.  
  1868. new
  1869. playerName[ MAX_PLAYER_NAME ],
  1870. targetName[ MAX_PLAYER_NAME ],
  1871. str[ 128 ];
  1872.  
  1873. GetPlayerName( playerid, playerName, MAX_PLAYER_NAME );
  1874. GetPlayerName( targetid, targetName, MAX_PLAYER_NAME );
  1875.  
  1876. format( str, 128, "[NEW REPORT] %s [%d] has reported %s [%d]",
  1877. playerName, playerid, targetName, targetid );
  1878. SendMessageToAdmins( 0xFF9500FF, str );
  1879.  
  1880. format( str, 128, "[REPORT] %s", reason );
  1881. SendMessageToAdmins( 0xFF9500FF, str );
  1882.  
  1883. return 1;
  1884. }
  1885.  
  1886.  
  1887.  
  1888. CMD:ask( playerid, params[ ] )
  1889. {
  1890. if ( playerAsked{ playerid } )
  1891. return SendClientMessage( playerid, RED, "ERROR:{FFFFFF} You have already asked a question, please wait patiently for your answer!");
  1892. new
  1893. str[ 128 ];
  1894. if ( sscanf( params, "s", str ) )
  1895. return SendUsageError( playerid, "/ask [Question]" );
  1896. new
  1897. str2[ 128 ], str3[ 128 ],
  1898. pName[ MAX_PLAYER_NAME ],
  1899. count = 0;
  1900.  
  1901. GetPlayerName( playerid, pName, sizeof ( pName ) );
  1902.  
  1903. format( str2, sizeof ( str2 ), "[NEW QUESTION] %s has asked a question", pName );
  1904. format( str3, sizeof ( str3 ), "[QUESTION] %s", str );
  1905.  
  1906. for ( new i, j = GetMaxPlayers (); i < j; i ++ )
  1907. {
  1908. if ( i == INVALID_PLAYER_ID )
  1909. continue;
  1910.  
  1911. if ( pInfo[ i ][ Adminlevel ] > 0 || pInfo[ i ][ VIPlevel ] > 0 )
  1912. {
  1913. count ++;
  1914. SendClientMessage( i, 0xFF9500FF, str2 );
  1915. SendClientMessage( i, 0xFF9500FF, str3 );
  1916. }
  1917. }
  1918.  
  1919. if ( !count )
  1920. SendClientMessage( playerid, RED, "ERROR:{FFFFFF} There are currently no helpers/VIPSs online." );
  1921. else {
  1922. SendClientMessage( playerid, RED, "Your question has been sent to all online Admins/VIPs, please wait!" );
  1923. playerAsked{ playerid } = true;
  1924. }
  1925.  
  1926. return 1;
  1927. }
  1928.  
  1929. CMD:sendcash(playerid, params[])
  1930. {
  1931. new
  1932. id,
  1933. amount;
  1934.  
  1935. if(sscanf(params, "ui", id, amount))
  1936. return SendUsageError( playerid, "/sendcash [Name/ID] [Cash]" );
  1937.  
  1938. if( id == playerid)
  1939. return SendClientMessage(playerid, RED, "ERROR:{FFFFFF} You cannot send yourself cash!");
  1940.  
  1941. if ( id == INVALID_PLAYER_ID )
  1942. return InvalidPlayerError( playerid );
  1943.  
  1944. if ( amount > GetPlayerMoney( playerid ) )
  1945. return SendClientMessage( playerid, RED, "ERROR: {FFFFFF}You don't have that much money!" );
  1946.  
  1947. GivePlayerMoney( playerid, - amount);
  1948. GivePlayerMoney ( id, amount );
  1949. return 1;
  1950. }cm
Advertisement
Add Comment
Please, Sign In to add comment