Guest User

GameMode

a guest
Nov 24th, 2014
213
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 84.93 KB | None | 0 0
  1. // This gamemode is made WopsS and modify by KnowN
  2. // Bugs: Nu
  3.  
  4. #include <a_samp>
  5. #include <a_mysql>
  6. #include <accounts>
  7. #include <other>
  8. #include <zcmd> // Pentru a putea creea comenzile gen CMD:comandamea(playerid, params[])
  9. #include <sscanf2>
  10. #include <streamer> //Pentru a putea adauga mape pe server
  11.  
  12. // Gamemode
  13. #define gamemode_version "v0.2 Beta"
  14. #define gamemode_map "LS-LV-SF"
  15.  
  16. // MySQL
  17. forward WhenAccountCheck(playerid, password[]);
  18.  
  19. #define SERVER_HOST             "localhost"
  20. #define SERVER_USER             "root"
  21. #define SERVER_PASS             ""
  22. #define SERVER_DB               "w3op"
  23. //
  24.  
  25. // Colors
  26. #define COLOR_ADMIN_INFO 0x5CAD5CFF
  27. #define COLOR_ERROR 0x5CAD5CFF
  28. #define COLOR_FADE1 0xE6E6E6E6
  29. #define COLOR_FADE2 0xC8C8C8C8
  30. #define COLOR_FADE3 0xAAAAAAAA
  31. #define COLOR_FADE4 0x8C8C8C8C
  32. #define COLOR_FADE5 0x6E6E6E6E
  33. #define COLOR_GRAD 0xBFC0C2FF
  34. #define COLOR_GREEN 0x33AA33AA
  35. #define COLOR_YELLOW2 0xF5DEB3AA
  36. #define COLOR_YELLOW3 0xFFD633AA
  37. #define COLOR_SERVER_GREEN 0x21DD00FF
  38. #define COLOR_LIGHTBLUE 0x33CCFFAA
  39. #define COLOR_LIGHTRED 0xFF6347AA
  40. #define COLOR_LIGHTRED2 0xE63E3EFF
  41. #define COLOR_SYN 0xB8DBFFFF
  42. #define COLOR_SYN2 0xA9C4E4FF
  43. #define COLOR_WHITE 0xFFFFFFFF
  44. //
  45.  
  46. // Faction colors
  47. #define COLOR_LSPD 0x2641FEAA
  48. #define COLOR_LVPD 0x2641FEAA
  49. #define COLOR_SFPD 0x2641FEAA
  50. #define COLOR_FBI 0x2641FEAA
  51. #define COLOR_NG 0x1E519DAA
  52. #define COLOR_PARAMEDICS 0xFF6347AA
  53.  
  54. #define COLOR_FACTION_CHAT 0x01FCFFC8
  55. #define COLOR_RADIO_CHAT 0x8D8DFF00
  56. //
  57.  
  58. // Dialogs
  59. #define DIALOG_LOGIN 2
  60. #define DIALOG_REGISTER 1
  61. #define DIALOG_SEX 3
  62. #define DIALOG_AGE 4
  63. #define DIALOG_EMAIL 5
  64. #define DIALOG_REGISTER_FINISH 6
  65. //
  66.  
  67. // Login
  68. new gRegistred[MAX_PLAYERS];
  69. new gLogged[MAX_PLAYERS];
  70.  
  71. new RegistrationStep[MAX_PLAYERS];
  72.  
  73. forward OnPlayerRegister(playerid, password[]);
  74. forward OnPlayerLogin(playerid, password[]);
  75. forward WhenPlayerLogin(playerid);
  76. //
  77.  
  78. // Money
  79. #define ResetMoneyBar ResetPlayerMoney
  80. #define UpdateMoneyBar GivePlayerMoney
  81.  
  82. new Cash[MAX_PLAYERS];
  83. //
  84.  
  85. // Tutorial
  86. new TutorialTime[MAX_PLAYERS];
  87. //
  88.  
  89. // Clock
  90. new clockupdate;
  91.  
  92. new Text:ClockTime;
  93. new Text:ClockDate;
  94.  
  95. new pName2[MAX_PLAYER_NAME];
  96. new pNameGive[MAX_PLAYER_NAME];
  97. new Float:x, Float:y, Float:z;
  98.  
  99. forward ClockUpdate();
  100. //
  101.  
  102. // Admin & Helpers & Reports
  103. #define ADMIN_SPEC_TYPE_NONE 0
  104. #define ADMIN_SPEC_TYPE_PLAYER 1
  105. #define ADMIN_SPEC_TYPE_VEHICLE 2
  106.  
  107. new ReportTime[MAX_PLAYERS];
  108. new SpectateType[MAX_PLAYERS];
  109. new SpectatedID[MAX_PLAYERS];
  110. new MySQLConnecting;
  111.  
  112. forward AdminsBroadCast(color, string[]);
  113. forward HelpersBroadCast(color, string[]);
  114.  
  115. forward ReportTimer(playerid);
  116. //
  117.  
  118. // Faction
  119. forward SetPlayerFactionColor(playerid);
  120. forward FactionsBroadCast(faction, color, string[]);
  121. forward RadioBroadCast(faction, color, string[]);
  122. //
  123.  
  124. // Timers
  125. new othertimers;
  126. forward OtherTimers();
  127. //
  128.  
  129. //
  130.  
  131. forward KickPublic(playerid);
  132.  
  133. forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
  134.  
  135. forward MoneyTimer();
  136.  
  137. main()
  138. {
  139.     printf(" ");
  140.     printf(" ");
  141.     printf(" RPG: %s %s", gamemode_version, gamemode_map);
  142.     printf("_____________________");
  143. }
  144.  
  145. public OnGameModeInit()
  146. {
  147.     // MySQL Connect (by KnowN)
  148.     MySQLConnecting = mysql_connect( SERVER_HOST, SERVER_USER, SERVER_DB, SERVER_PASS, 3306, true, 2 );
  149.  
  150.     print( "=======================================================" );
  151.     print( "\t\t   > MySQL System <" );
  152.     print( "=======================================================" );
  153.  
  154.     print ( "[MySQL] Conectare la ('"SERVER_HOST"') cu ('"SERVER_USER"') la baza de date ('"SERVER_DB"')." );
  155.  
  156.     if( mysql_errno( MySQLConnecting ) != 0 )
  157.         print ( "[MySQL] Conectarea la ('"SERVER_HOST"') a esuat !\n" );
  158.  
  159.     else
  160.     {
  161.         print ( "[MySQL] Conectarea la ('"SERVER_HOST"') sa stabilit cu succes !" );
  162.         print ( "[MySQL] Baza de date ('"SERVER_DB"') a fost selectata !\n" );
  163.     }
  164.  
  165.     mysql_log( LOG_ERROR | LOG_WARNING, LOG_TYPE_HTML );
  166.    
  167.     // Cars
  168.     AddStaticVehicleEx (411, 1741.7678, -1852.7793, 13.4141, 267.4383, 0, 1, 60);
  169.  
  170.     // Gamemode and Map text
  171.     new string [500];
  172.     SetGameModeText(#gamemode_version);
  173.     format(string, sizeof(string), "mapname %s", gamemode_map);
  174.     SendRconCommand(string);
  175.  
  176.     // Timers
  177.     SetTimer("MoneyTimer", 1000, true);
  178.     othertimers = SetTimer("OtherTimers", 1000, true);
  179.  
  180.     // Clock
  181.     clockupdate = SetTimer("ClockUpdate", 1000, 1);
  182.  
  183.     ClockTime = TextDrawCreate(548.000000,21.000000,"00:00");
  184.     TextDrawAlignment(ClockTime,1);
  185.     TextDrawFont(ClockTime,3);
  186.     TextDrawUseBox(ClockTime, 0);
  187.     TextDrawSetOutline(ClockTime,2);
  188.     TextDrawColor(ClockTime,0xffffffff);
  189.     TextDrawSetShadow(ClockTime,1);
  190.     TextDrawLetterSize(ClockTime,0.589999,2.300000);
  191.  
  192.     ClockDate = TextDrawCreate(535.000000,6.000000,"00/00/0000");
  193.     TextDrawAlignment(ClockDate,1);
  194.     TextDrawFont(ClockDate,1);
  195.     TextDrawUseBox(ClockDate, 0);
  196.     TextDrawSetOutline(ClockDate,1);
  197.     TextDrawColor(ClockDate,0xffffffff);
  198.     TextDrawSetShadow(ClockDate,1);
  199.     TextDrawLetterSize(ClockDate,0.450000,1.400000);
  200.     //
  201.  
  202.     ShowPlayerMarkers(0);
  203.     EnableStuntBonusForAll(0);
  204.     UsePlayerPedAnims();
  205.  
  206.     return 1;
  207. }
  208.  
  209. public OnGameModeExit()
  210. {
  211.     KillTimer(othertimers);
  212.     KillTimer(clockupdate);
  213.     mysql_close();
  214.     return 1;
  215. }
  216.  
  217. public OnPlayerRequestClass(playerid, classid)
  218. {
  219.     return 1;
  220. }
  221.  
  222. public OnPlayerConnect(playerid)
  223. {
  224.     gRegistred[playerid] = 0; gLogged[playerid] = 0;
  225.     RegistrationStep[playerid] = 0; TutorialTime[playerid] = 0;
  226.     ReportTime[playerid] = 0; SpectatedID[playerid] = 0;
  227.  
  228.     PlayerInfo[playerid][pRegistred] = 0;
  229.     PlayerInfo[playerid][pTutorial] = 0;
  230.     PlayerInfo[playerid][pSex] = 0;
  231.  
  232.     new pName[30];
  233.     new query[256];
  234.     GetPlayerName(playerid, pName, sizeof(pName));
  235.     mysql_format(handle, query, sizeof(query), "SELECT * FROM `players` WHERE `username` = '%e'", pName);
  236.     mysql_tquery(handle, query, "WhenAccountCheck", "i", playerid);
  237.  
  238.     TogglePlayerSpectating(playerid, 0);
  239.  
  240.     TextDrawShowForPlayer(playerid, ClockTime);
  241.     TextDrawShowForPlayer(playerid, ClockDate);
  242.  
  243.     SetPlayerColor(playerid, COLOR_GRAD);
  244.  
  245.     return 1;
  246. }
  247.  
  248. public WhenAccountCheck(playerid, password[])
  249. {
  250.     new pName[30];
  251.     GetPlayerName(playerid, pName, sizeof(pName));
  252.  
  253.     cache_get_data(rows, fields, handle);
  254.  
  255.     if(rows)
  256.     {
  257.         gRegistred[playerid] = 1;
  258.     }
  259.     else
  260.     {
  261.         gRegistred[playerid] = 0;
  262.     }
  263.  
  264.     // Login or Register!
  265.  
  266.     if(gLogged[playerid] == 0)
  267.     {
  268.         if(gRegistred[playerid] == 1)
  269.         {
  270.             new string[256];
  271.             GetPlayerName(playerid, pName, sizeof(pName));
  272.  
  273.             cache_get_field_content(0, "LastLogin", temp), strmid(PlayerInfo[playerid][pLastLogin], temp, 0, 255, 255);
  274.  
  275.             format(string,sizeof(string),"{BECBFC}Welcome, {95A3FF}%s{BECBFC}!\n\nPlease enter your password below to login to your account.\n\n* {FFFFFF}Last login: %s *",pName, PlayerInfo[playerid][pLastLogin]);
  276.             ShowPlayerDialog(playerid, DIALOG_LOGIN ,DIALOG_STYLE_PASSWORD,"Login",string,"Login","Exit");
  277.         }
  278.         else
  279.         {
  280.             ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Register", "Enter your password below:", "Register", "Cancel");
  281.         }
  282.     }
  283.  
  284.     SetPlayerCameraPos(playerid, 1500.7156,-1778.1880,80.3080);
  285.     SetPlayerCameraLookAt(playerid, 1500.7156,-1778.1880,80.3080);
  286.     SetPlayerPos(playerid, 1437.6957,-2266.6355,13.5469);
  287.  
  288.     return 1;
  289. }
  290.  
  291. public OnPlayerRegister(playerid, password[])
  292. {
  293.     if(IsPlayerConnected(playerid))
  294.     {
  295.         new pName[30];
  296.         new query[256];
  297.         new string[256];
  298.         GetPlayerName(playerid, pName, sizeof(pName));
  299.  
  300.         mysql_format(handle, query, sizeof(query), "INSERT INTO `players` (`username`,`password`) VALUES ('%e', MD5('%e'))", pName, password);
  301.         mysql_tquery(handle, query, "", "");
  302.  
  303.         strmid(PlayerInfo[playerid][pPassword], password, 0, strlen(password), 255);
  304.  
  305.         format(string, sizeof(string), "Please enter your password below to login to your account.", pName);
  306.         ShowPlayerDialog(playerid, DIALOG_LOGIN ,DIALOG_STYLE_PASSWORD, "Login", string, "Login", "Exit");
  307.  
  308.     }
  309.     return 1;
  310. }
  311.  
  312. public OnPlayerLogin(playerid, password[])
  313. {
  314.     if(IsPlayerConnected(playerid))
  315.     {
  316.         new pName[30];
  317.         new query[256];
  318.         GetPlayerName(playerid, pName, sizeof(pName));
  319.  
  320.         mysql_format(handle, query, sizeof(query), "SELECT * FROM `players` WHERE `username`='%e' AND `password`=MD5('%e')", pName, password);
  321.         mysql_tquery(handle, query, "WhenPlayerLogin", "i", playerid);
  322.  
  323.     }
  324.  
  325.     TogglePlayerSpectating(playerid, 0);
  326.  
  327.     return 1;
  328. }
  329.  
  330. public WhenPlayerLogin(playerid)
  331. {
  332.     if(IsPlayerConnected(playerid))
  333.     {
  334.         new string[256];
  335.         new pName[30];
  336.         GetPlayerName(playerid, pName, sizeof(pName));
  337.  
  338.         cache_get_data(rows, fields, handle);
  339.  
  340.         if(rows != 0)
  341.         {
  342.             cache_get_field_content(0, "password", temp),  format(PlayerInfo[playerid][pPassword], 128, temp);
  343.             cache_get_field_content(0, "Level", temp), PlayerInfo[playerid][pLevel] = strval(temp);
  344.             cache_get_field_content(0, "AdminLevel", temp), PlayerInfo[playerid][pAdmin] = strval(temp);
  345.             cache_get_field_content(0, "HelperLevel", temp), PlayerInfo[playerid][pHelper] = strval(temp);
  346.             cache_get_field_content(0, "Cash", temp), PlayerInfo[playerid][pCash] = strval(temp);
  347.             cache_get_field_content(0, "Account", temp), PlayerInfo[playerid][pAccount] = strval(temp);
  348.             cache_get_field_content(0, "Email", temp),  format(PlayerInfo[playerid][pEmail], 256, temp);
  349.             cache_get_field_content(0, "Registred", temp), PlayerInfo[playerid][pRegistred] = strval(temp);
  350.             cache_get_field_content(0, "Tutorial", temp), PlayerInfo[playerid][pTutorial] = strval(temp);
  351.             cache_get_field_content(0, "Sex", temp), PlayerInfo[playerid][pSex] = strval(temp);
  352.             cache_get_field_content(0, "Age", temp), PlayerInfo[playerid][pAge] = strval(temp);
  353.             cache_get_field_content(0, "PhoneNumber", temp), PlayerInfo[playerid][pPhoneNumber] = strval(temp);
  354.             cache_get_field_content(0, "PremiumAccount", temp), PlayerInfo[playerid][pPremiumAccount] = strval(temp);
  355.             cache_get_field_content(0, "Banned", temp), PlayerInfo[playerid][pBanned] = strval(temp);
  356.             cache_get_field_content(0, "Warns", temp), PlayerInfo[playerid][pWarns] = strval(temp);
  357.             cache_get_field_content(0, "Leader", temp), PlayerInfo[playerid][pLeader] = strval(temp);
  358.             cache_get_field_content(0, "Member", temp), PlayerInfo[playerid][pMember] = strval(temp);
  359.             cache_get_field_content(0, "Rank", temp), PlayerInfo[playerid][pRank] = strval(temp);
  360.             cache_get_field_content(0, "Skin", temp), PlayerInfo[playerid][pSkin] = strval(temp);
  361.             cache_get_field_content(0, "IP", temp), PlayerInfo[playerid][pIP] = strval(temp);
  362.         }
  363.         else
  364.         {
  365.             ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "The passwords don't match!\nType your account's password below:", "Login", "Exit");
  366.             return 1;
  367.         }
  368.  
  369.         if(PlayerInfo[playerid][pRegistred] == 0)
  370.         {
  371.             PlayerInfo[playerid][pLevel] = 1;
  372.             Update(playerid, pLevelu);
  373.  
  374.             PlayerInfo[playerid][pAdmin] = 0;
  375.             Update(playerid, pAdminu);
  376.  
  377.             GivePlayerCash(playerid, 150);
  378.  
  379.             PlayerInfo[playerid][pAccount] = 500;
  380.             Update(playerid, pAccountu);
  381.  
  382.             PlayerInfo[playerid][pRegistred] = 1;
  383.             Update(playerid, pRegistredu);
  384.  
  385.             new randomphonenumber = 1000000 + random(9999999);
  386.             PlayerInfo[playerid][pPhoneNumber] = randomphonenumber;
  387.             Update(playerid, pPhoneNumberu);
  388.  
  389.             PlayerInfo[playerid][pInterior] = 0;
  390.         }
  391.  
  392.         if(PlayerInfo[playerid][pBanned] == 1)
  393.         {
  394.             KickWithMessage(playerid, COLOR_LIGHTRED2, "Your account is currently banned.");
  395.             KickWithMessage(playerid, COLOR_LIGHTRED2, "In case you think this is a confusion, request an unban at the forums.");
  396.         }
  397.  
  398.         GetPlayerCash(playerid);
  399.  
  400.         SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
  401.         SetPlayerCash(playerid, PlayerInfo[playerid][pCash]);
  402.  
  403.         SetSpawnInfo(playerid, 0, 0, 1742.9515, -1862.3721, 13.5764, 359.5591, 0, 0, 0, 0, 0, 0);
  404.         SpawnPlayer(playerid);
  405.  
  406.         Update(playerid, pLastLoginu);
  407.  
  408.         new pNameIP[256];
  409.         GetPlayerIp(playerid, pNameIP, sizeof(pNameIP));
  410.  
  411.         strmid(PlayerInfo[playerid][pIP], pNameIP, 0, 100, 255);
  412.         Update(playerid, pIPu);
  413.  
  414.  
  415.         if (PlayerInfo[playerid][pAdmin] >= 1)
  416.         {
  417.             format(string, sizeof(string), "You're logged in as a level %d admin.", PlayerInfo[playerid][pAdmin]);
  418.             SendClientMessage(playerid, COLOR_YELLOW2, string);
  419.         }
  420.  
  421.         if (PlayerInfo[playerid][pHelper] >= 1)
  422.         {
  423.             format(string, sizeof(string), "You're logged in as a level %d helper.", PlayerInfo[playerid][pHelper]);
  424.             SendClientMessage(playerid, COLOR_YELLOW2, string);
  425.         }
  426.  
  427.         if (PlayerInfo[playerid][pPremiumAccount] >= 1)
  428.         {
  429.             SendClientMessage(playerid, COLOR_WHITE,"You're a premium account user. ");
  430.         }
  431.  
  432.         printf("%s has logged in.", pName);
  433.  
  434.         gLogged[playerid] = 1;
  435.     }
  436.  
  437.     return 1;
  438. }
  439.  
  440. public OnPlayerDisconnect(playerid, reason)
  441. {
  442.     return 1;
  443. }
  444.  
  445. public OnPlayerSpawn(playerid)
  446. {
  447.     if(IsPlayerConnected(playerid))
  448.     {
  449.         SetPlayerFactionColor(playerid);
  450.         if(gLogged[playerid] == 0)
  451.         {
  452.             KickWithMessage(playerid, COLOR_LIGHTRED, "** This server requires a Login BEFORE spawn (Kicked) **");
  453.         }
  454.  
  455.         if(PlayerInfo[playerid][pSkin] > 0)
  456.         {
  457.             SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  458.         }
  459.         else
  460.         {
  461.             SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  462.         }
  463.  
  464.         if(PlayerInfo[playerid][pTutorial] == 0)
  465.         {
  466.             SetPlayerCameraPos(playerid, 1500.7156,-1778.1880,80.3080);
  467.             SetPlayerCameraLookAt(playerid, 1500.7156,-1778.1880,80.3080);
  468.             SetPlayerPos(playerid, 1437.6957,-2266.6355,13.5469);
  469.  
  470.             ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_MSGBOX, "Character Gender", "Are you a male or a female?", "Male", "Female");
  471.         }
  472.  
  473.         if (PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)// Los Santos Police Departament spawn
  474.         {
  475.             SetPlayerFactionColor(playerid);
  476.  
  477.             PlayerInfo[playerid][pInterior] = 6;
  478.             SetPlayerInterior(playerid, 6);
  479.  
  480.             SetPlayerPos(playerid, 216.9725,79.1339,1005.0391);
  481.             SetPlayerFacingAngle(playerid, 0);
  482.             return 1;
  483.         }
  484.         if (PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)// Las Venturas Police Departament spawn
  485.         {
  486.             SetPlayerFactionColor(playerid);
  487.  
  488.             PlayerInfo[playerid][pInterior] = 3;
  489.             SetPlayerInterior(playerid, 3);
  490.  
  491.             SetPlayerPos(playerid, 297.3488,186.3873,1007.1719);
  492.             SetPlayerFacingAngle(playerid, 0);
  493.             return 1;
  494.         }
  495.         if (PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)// San Fierro Police Departament spawn
  496.         {
  497.             SetPlayerFactionColor(playerid);
  498.  
  499.             PlayerInfo[playerid][pInterior] = 0;
  500.             SetPlayerInterior(playerid, 0);
  501.  
  502.             SetPlayerPos(playerid, -1606.3876,676.6782,-5.2422);
  503.             SetPlayerFacingAngle(playerid, 0);
  504.             return 1;
  505.         }
  506.         if (PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)// FBI spawn
  507.         {
  508.             SetPlayerFactionColor(playerid);
  509.  
  510.             PlayerInfo[playerid][pInterior] = 10;
  511.             SetPlayerInterior(playerid, 0);
  512.  
  513.             SetPlayerPos(playerid, 246.375991,109.245994,1003.218750);
  514.             SetPlayerFacingAngle(playerid, 90);
  515.             return 1;
  516.         }
  517.         if (PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)// National Guard spawn
  518.         {
  519.             SetPlayerFactionColor(playerid);
  520.  
  521.             PlayerInfo[playerid][pInterior] = 0;
  522.             SetPlayerInterior(playerid, 0);
  523.  
  524.             SetPlayerPos(playerid, 246.6305,1860.1299,14.0840);
  525.             SetPlayerFacingAngle(playerid, 0);
  526.             return 1;
  527.         }
  528.         if (PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)// Paramedics spawn
  529.         {
  530.             SetPlayerFactionColor(playerid);
  531.  
  532.             PlayerInfo[playerid][pInterior] = 0;
  533.             SetPlayerInterior(playerid, 0);
  534.  
  535.             SetPlayerPos(playerid, 1607.1846,1818.9738,10.8203);
  536.             SetPlayerFacingAngle(playerid, 0);
  537.             return 1;
  538.         }
  539.     }
  540.     return 1;
  541. }
  542.  
  543. public OnPlayerDeath(playerid, killerid, reason)
  544. {
  545.     return 1;
  546. }
  547.  
  548. public OnVehicleSpawn(vehicleid)
  549. {
  550.     return 1;
  551. }
  552.  
  553. public OnVehicleDeath(vehicleid, killerid)
  554. {
  555.     return 1;
  556. }
  557.  
  558. public OnPlayerText(playerid, text[])
  559. {
  560.     new pName[MAX_PLAYER_NAME];
  561.     new string[256];
  562.     GetPlayerName(playerid, pName, sizeof(pName));
  563.    
  564.     format(string, sizeof(string), "%s says: %s", pName, text);
  565.     ProxDetector(20.0, playerid, string, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
  566.     return 0;
  567. }
  568.  
  569. public OnPlayerCommandText(playerid, cmdtext[])
  570. {
  571.     return SendClientMessage(playerid, COLOR_YELLOW2, "Error: Unknown command");
  572. }
  573.  
  574. // General Commands
  575. CMD:help( playerid, params[] )
  576. {
  577.     if(IsPlayerConnected(playerid))
  578.     {
  579.             if(gLogged[playerid] == 1)
  580.             {
  581.                 SendClientMessage(playerid, COLOR_WHITE, "*** ACCOUNT *** /stats");
  582.                 SendClientMessage(playerid, COLOR_WHITE, "*** CHAT *** -");
  583.                 SendClientMessage(playerid, COLOR_WHITE, "*** GENERAL *** /report /helpme");
  584.             }
  585.             else
  586.             {
  587.                 SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
  588.             }
  589.     }
  590.     return 1;
  591. }
  592.  
  593. CMD:stats( playerid, params[] )
  594. {
  595.     new targetid;
  596.     if(IsPlayerConnected(playerid))
  597.     {
  598.             GetPlayerName(playerid, pName2, sizeof(pName2));
  599.  
  600.             if(gLogged[playerid] == 1)
  601.             {
  602.                 ShowStats(playerid, targetid);
  603.             }
  604.             else
  605.             {
  606.                 SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
  607.             }
  608.     }
  609.     return 1;
  610. }
  611.  
  612. CMD:report( playerid, params[] )
  613. {
  614.     new idx, string[256], cmdtext[2048];
  615.     if(IsPlayerConnected(playerid))
  616.     {
  617.             if(gLogged[playerid] == 1)
  618.             {
  619.                 GetPlayerName(playerid, pName2, sizeof(pName2));
  620.  
  621.                 new length = strlen(cmdtext);
  622.  
  623.                 while ((idx < length) && (cmdtext[idx] <= ' '))
  624.                 {
  625.                     idx++;
  626.                 }
  627.  
  628.                 new offset = idx;
  629.                 new result[128];
  630.  
  631.                 while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  632.                 {
  633.                     result[idx - offset] = cmdtext[idx];
  634.                     idx++;
  635.                 }
  636.  
  637.                 //result[idx - offset] = EOS;
  638.  
  639.                 if(!strlen(result))
  640.                 {
  641.                     SendClientMessage(playerid, COLOR_SYN, "Synthax: /report <text>");
  642.                     return 1;
  643.                 }
  644.  
  645.                 if(ReportTime[playerid] == 0)
  646.                 {
  647.                     format(string, sizeof(string), "Report from %s (ID:%d): %s", pName2, playerid, result);
  648.                     AdminsBroadCast(COLOR_LIGHTRED2, string);
  649.  
  650.                     SendClientMessage(playerid, COLOR_YELLOW2, "Your report got sent to the administrator!");
  651.  
  652.                     ReportTime[playerid] = 10;
  653.                     SetTimerEx("ReportTimer", 10000, false, "i", playerid);
  654.                 }
  655.  
  656.                 else
  657.                 {
  658.                     format(string, sizeof(string), "You need to wait %d seconds before send another report.",  ReportTime[playerid]);
  659.                     SendClientMessage(playerid, COLOR_YELLOW2, string);
  660.                 }
  661.             }
  662.             else
  663.             {
  664.                 SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
  665.             }
  666.     }
  667.     return 1;
  668. }
  669.  
  670. CMD:helpme( playerid, params[] )
  671. {
  672.     new idx, string[256], cmdtext[2048];
  673.     if(IsPlayerConnected(playerid))
  674.     {
  675.             if(gLogged[playerid] == 1)
  676.             {
  677.                 GetPlayerName(playerid, pName2, sizeof(pName2));
  678.  
  679.                 new length = strlen(cmdtext);
  680.  
  681.                 while ((idx < length) && (cmdtext[idx] <= ' '))
  682.                 {
  683.                     idx++;
  684.                 }
  685.  
  686.                 new offset = idx;
  687.                 new result[128];
  688.  
  689.                 while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  690.                 {
  691.                     result[idx - offset] = cmdtext[idx];
  692.                     idx++;
  693.                 }
  694.  
  695.                 result[idx - offset] = EOS;
  696.  
  697.                 if(!strlen(result))
  698.                 {
  699.                     SendClientMessage(playerid, COLOR_SYN, "Synthax: /helpme <text>");
  700.                     return 1;
  701.                 }
  702.  
  703.                 if(ReportTime[playerid] == 0)
  704.                 {
  705.                     format(string, sizeof(string), "Report from %s (ID:%d): %s", pName2, playerid, result);
  706.                     AdminsBroadCast(COLOR_LIGHTRED2, string);
  707.  
  708.                     SendClientMessage(playerid, COLOR_YELLOW2, "Your help request got sent to the helpers!");
  709.  
  710.                     ReportTime[playerid] = 10;
  711.                     SetTimerEx("ReportTimer", 10000, false, "i", playerid);
  712.                 }
  713.  
  714.                 else
  715.                 {
  716.                     format(string, sizeof(string), "You need to wait %d seconds before request another help.",  ReportTime[playerid]);
  717.                     SendClientMessage(playerid, COLOR_YELLOW2, string);
  718.                 }
  719.             }
  720.             else
  721.             {
  722.                 SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
  723.             }
  724.     }
  725.     return 1;
  726. }
  727.  
  728.     //
  729.     // Admin Commands
  730. CMD:ah( playerid, params[] )
  731. {
  732.     if(IsPlayerConnected(playerid))
  733.     {
  734.             if(gLogged[playerid] == 1)
  735.             {
  736.                 if(PlayerInfo[playerid][pAdmin] >= 1)
  737.                 {
  738.                     SendClientMessage(playerid, COLOR_GREEN, "_______________________________________");
  739.                     if(PlayerInfo[playerid][pAdmin] >= 1)
  740.                     {
  741.                         SendClientMessage(playerid, COLOR_WHITE, "** Admin level 1 ** (/ah)dminhelp (/a)dmin /goto /gethere /respawn /ban /kick (/checkw)eapons /check /spec (/rcon)");
  742.                     }
  743.                     if(PlayerInfo[playerid][pAdmin] >= 2)
  744.                     {
  745.                         SendClientMessage(playerid, COLOR_WHITE, "** Admin level 2 ** (/bano)ffline**");
  746.                     }
  747.                     if(PlayerInfo[playerid][pAdmin] >= 3)
  748.                     {
  749.                         SendClientMessage(playerid, COLOR_WHITE, "** Admin level 3 **");
  750.                     }
  751.                     if(PlayerInfo[playerid][pAdmin] >= 4)
  752.                     {
  753.                         SendClientMessage(playerid, COLOR_WHITE, "** Admin level 4 **");
  754.                     }
  755.                     if(PlayerInfo[playerid][pAdmin] >= 5)
  756.                     {
  757.                         SendClientMessage(playerid, COLOR_WHITE, "** Admin level 5 **");
  758.                     }
  759.                     if(PlayerInfo[playerid][pAdmin] >= 6)
  760.                     {
  761.                         SendClientMessage(playerid, COLOR_WHITE, "** Admin level 6 ** /makeadmin /makehelper /makeleader /auninvite");
  762.                     }
  763.                     SendClientMessage(playerid, COLOR_GREEN, "_______________________________________");
  764.                 }
  765.  
  766.                 else if(PlayerInfo[playerid][pAdmin] < 1)
  767.                 {
  768.                     SendClientMessage(playerid, COLOR_ERROR, "Error: Your admin level is not high enough to use this command.");
  769.                 }
  770.             }
  771.             else
  772.             {
  773.                 SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
  774.             }
  775.     }
  776.     return 1;
  777. }
  778.  
  779. CMD:a( playerid, params[] )
  780. {
  781.     new idx, string[256], cmdtext[2048];
  782.     if(IsPlayerConnected(playerid))
  783.     {
  784.             if(gLogged[playerid] == 1)
  785.             {
  786.                 GetPlayerName(playerid, pName2, sizeof(pName2));
  787.  
  788.                 new length = strlen(cmdtext);
  789.  
  790.                 while ((idx < length) && (cmdtext[idx] <= ' '))
  791.                 {
  792.                     idx++;
  793.                 }
  794.  
  795.                 new offset = idx;
  796.                 new result[128];
  797.  
  798.                 while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  799.                 {
  800.                     result[idx - offset] = cmdtext[idx];
  801.                     idx++;
  802.                 }
  803.  
  804.                 result[idx - offset] = EOS;
  805.  
  806.                 if(!strlen(result))
  807.                 {
  808.                     SendClientMessage(playerid, COLOR_SYN, "Synthax: (/a)dminchat <text>");
  809.                     return 1;
  810.                 }
  811.  
  812.                 if (PlayerInfo[playerid][pAdmin] >= 1 && PlayerInfo[playerid][pAdmin] <= 5)
  813.                 {
  814.                     format(string, sizeof(string), "** Admin Level %d %s : %s **", PlayerInfo[playerid][pAdmin], pName2, result);
  815.                     AdminsBroadCast(COLOR_YELLOW2, string);
  816.                 }
  817.  
  818.                 if (PlayerInfo[playerid][pAdmin] == 6)
  819.                 {
  820.                     format(string, sizeof(string), "{CFAE70}** Admin Level %d %s : %s **", PlayerInfo[playerid][pAdmin], pName2, result);
  821.                     AdminsBroadCast(COLOR_WHITE, string);
  822.                 }
  823.  
  824.                 if (PlayerInfo[playerid][pAdmin] < 1)
  825.                 {
  826.                     SendClientMessage(playerid, COLOR_ERROR, "Error: Your admin level is not high enough to use this command.");
  827.                     return 1;
  828.                 }
  829.             }
  830.             else
  831.             {
  832.                 SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
  833.             }
  834.     }
  835.     return 1;
  836. }
  837.  
  838. CMD:ban( playerid, params[] )
  839. {
  840.     new idx, string[256], cmdtext[2048], targetid;
  841.     if(IsPlayerConnected(playerid))
  842.     {
  843.             if(gLogged[playerid] == 1)
  844.             {
  845.                 GetPlayerName(playerid, pName2, sizeof(pName2));
  846.  
  847.                 temp = strtok(cmdtext, idx);
  848.  
  849.                 if(!strlen(temp))
  850.                 {
  851.                     SendClientMessage(playerid, COLOR_SYN, "Synthax: /ban <playerid/PartOfName> <reason>");
  852.                     return 1;
  853.                 }
  854.  
  855.                 targetid = ReturnUser(temp);
  856.  
  857.                 if (PlayerInfo[playerid][pAdmin] >= 1)
  858.                 {
  859.                     if(IsPlayerConnected(targetid))
  860.                     {
  861.                         if(targetid != INVALID_PLAYER_ID)
  862.                         {
  863.                             GetPlayerName(targetid, pNameGive, sizeof(pNameGive));
  864.  
  865.                             new length = strlen(cmdtext);
  866.  
  867.                             while ((idx < length) && (cmdtext[idx] <= ' '))
  868.                             {
  869.                                 idx++;
  870.                             }
  871.  
  872.                             new offset = idx;
  873.                             new result[128];
  874.  
  875.                             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  876.                             {
  877.                                 result[idx - offset] = cmdtext[idx];
  878.                                 idx++;
  879.                             }
  880.  
  881.                             result[idx - offset] = EOS;
  882.  
  883.                             if(!strlen(result))
  884.                             {
  885.                                 SendClientMessage(playerid, COLOR_SYN, "Synthax: /ban <playerid/PartOfName> <reason>");
  886.                                 return 1;
  887.                             }
  888.  
  889.                             if(PlayerInfo[targetid][pAdmin] > 0 && PlayerInfo[playerid][pAdmin] < 6)
  890.                             {
  891.                                 SendClientMessage(playerid, COLOR_ERROR, "AdmWarning: You can't ban admins!");
  892.                                 format(string, sizeof(string), "AdmCmd: %s tried to ban admin %s with the reason: %s", pName2, pNameGive, (result));
  893.                                 AdminsBroadCast(COLOR_LIGHTRED, string);
  894.                                 return 1;
  895.                             }
  896.  
  897.                             format(string, sizeof(string), "AdmCmd: %s was banned by %s, reason: %s", pNameGive, pName2, (result));
  898.                             SendClientMessageToAll(COLOR_LIGHTRED, string);
  899.                             PlayerInfo[targetid][pBanned] = 1;
  900.                             Update(targetid, pBannedu);
  901.  
  902.                             new pGiveIP[256];
  903.                             GetPlayerIp(targetid, pGiveIP, sizeof(pGiveIP));
  904.                             strmid(PlayerInfo[targetid][pIP], pGiveIP, 0, 100, 255);
  905.                             Update(targetid, pIPu);
  906.  
  907.                             new query[512];
  908.                             mysql_format(handle, query, sizeof(query) ,"INSERT INTO `banslogs` (`ID`,`username`,`IP`,`Admin`,`Reason`,`Type`,`Date`,`Time`) VALUES ('','%e','%e','%e','%e','%e',CURRENT_TIMESTAMP,'%d')",
  909.                             pNameGive, PlayerInfo[targetid][pIP], pName2, result, "Online", 0);
  910.                             mysql_query(handle, query);
  911.  
  912.                             Kick(targetid);
  913.                             return 1;
  914.                         }
  915.                     }
  916.                     else
  917.                     {
  918.                         SendClientMessage(playerid, COLOR_ERROR, "Error: Invalid playerid / playername.");
  919.                     }
  920.                 }
  921.                 else
  922.                 {
  923.                     SendClientMessage(playerid, COLOR_ERROR, "Error: Your admin level is not high enough to use this command.");
  924.                 }
  925.             }
  926.             else
  927.             {
  928.                 SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
  929.             }
  930.     }
  931.     return 1;
  932. }
  933.  
  934. CMD:bano( playerid, params[] )
  935. {
  936.     new idx, string[256], cmdtext[2048], targetid;
  937.     if(IsPlayerConnected(playerid))
  938.     {
  939.             if(gLogged[playerid] == 1)
  940.             {
  941.                 cache_get_data(rows, fields, handle);
  942.  
  943.                 new query[512];
  944.                 mysql_format(handle, query, sizeof(query), "SELECT `username` FROM `players` WHERE `username` = '%e' AND `Banned` = '0' LIMIT 0", temp);
  945.                 mysql_query(handle, query);
  946.  
  947.                 GetPlayerName(playerid, pName2, sizeof(pName2));
  948.  
  949.                 temp = strtok(cmdtext, idx);
  950.  
  951.                 if(!strlen(temp))
  952.                 {
  953.                     SendClientMessage(playerid, COLOR_SYN, "Synthax: (/bano)ffline <playername> <reason>");
  954.                     return 1;
  955.                 }
  956.  
  957.                 if (PlayerInfo[playerid][pAdmin] >= 2)
  958.                 {
  959.                     if(!rows)
  960.                     {
  961.                         format(string, sizeof(string), "Error: Nobody with the name %s is registered or this player is alredy banned.");
  962.                         return SendClientMessage(playerid, COLOR_ERROR, string);
  963.                     }
  964.  
  965.                     else if(rows)
  966.                     {
  967.                         GetPlayerName(targetid, pNameGive, sizeof(pNameGive));
  968.  
  969.                         new length = strlen(cmdtext);
  970.  
  971.                         while ((idx < length) && (cmdtext[idx] <= ' '))
  972.                         {
  973.                             idx++;
  974.                         }
  975.  
  976.                         new offset = idx;
  977.                         new result[128];
  978.  
  979.                         while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  980.                         {
  981.                             result[idx - offset] = cmdtext[idx];
  982.                             idx++;
  983.                         }
  984.  
  985.                         result[idx - offset] = EOS;
  986.  
  987.                         if(!strlen(result))
  988.                         {
  989.                             SendClientMessage(playerid, COLOR_SYN, "Synthax: (/bano)ffline <playername> <reason>");
  990.                             return 1;
  991.                         }
  992.  
  993.                         if(PlayerInfo[targetid][pAdmin] > 0 && PlayerInfo[playerid][pAdmin] < 6)
  994.                         {
  995.                             SendClientMessage(playerid, COLOR_ERROR, "AdmWarning: You can't ban admins!");
  996.                             format(string, sizeof(string), "AdmCmd: %s tried to ban admin %s with the reason: %s", pName2, pNameGive, (result));
  997.                             AdminsBroadCast(COLOR_LIGHTRED, string);
  998.                             return 1;
  999.                         }
  1000.  
  1001.                         format(string, sizeof(string), "AdmCmd: %s was banned offline by %s, reason: %s", temp, pName2, (result));
  1002.                         SendClientMessageToAll(COLOR_LIGHTRED, string);
  1003.  
  1004.                         mysql_format(handle, query, sizeof(query), "UPDATE `players` SET `Banned` = '1' WHERE username = '%e'", temp);
  1005.                         mysql_query(handle, query);
  1006.  
  1007.                         mysql_format(handle, query, sizeof(query) ,"INSERT INTO `banslogs` (`ID`,`username`,`IP`,`Admin`,`Reason`,`Type`,`Date`,`Time`) VALUES ('','%e','%e','%e','%e','%e',CURRENT_TIMESTAMP,'%d')",
  1008.                         temp, PlayerInfo[targetid][pIP], pName2, result, "Offline", 0);
  1009.                         mysql_query(handle, query);
  1010.  
  1011.                         new pGiveIP[256];
  1012.                         GetPlayerIp(targetid, pGiveIP, sizeof(pGiveIP));
  1013.                         strmid(PlayerInfo[targetid][pIP], pGiveIP, 0, 100, 255);
  1014.  
  1015.                         return 1;
  1016.                     }
  1017.                 }
  1018.                 else
  1019.                 {
  1020.                     SendClientMessage(playerid, COLOR_ERROR, "Error: Your admin level is not high enough to use this command.");
  1021.                 }
  1022.             }
  1023.             else
  1024.             {
  1025.                 SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
  1026.             }
  1027.     }
  1028.     return 1;
  1029. }
  1030.  
  1031. CMD:kick( playerid, params[] )
  1032. {
  1033.     new idx, string[256], cmdtext[2048], targetid;
  1034.     if(IsPlayerConnected(playerid))
  1035.     {
  1036.             if(gLogged[playerid] == 1)
  1037.             {
  1038.                 temp = strtok(cmdtext, idx);
  1039.                 if(!strlen(temp))
  1040.                 {
  1041.                     SendClientMessage(playerid, COLOR_SYN, "Synthax: /kick <playerid/PartOfName> <reason>");
  1042.                     return 1;
  1043.                 }
  1044.                 targetid = ReturnUser(temp);
  1045.                 if (PlayerInfo[playerid][pAdmin] >= 1)
  1046.                 {
  1047.                     if(IsPlayerConnected(targetid))
  1048.                     {
  1049.                         if(targetid != INVALID_PLAYER_ID)
  1050.                         {
  1051.                             GetPlayerName(targetid, pNameGive, sizeof(pNameGive));
  1052.                             GetPlayerName(playerid, pName2, sizeof(pName2));
  1053.                             new length = strlen(cmdtext);
  1054.                             while ((idx < length) && (cmdtext[idx] <= ' '))
  1055.                             {
  1056.                                 idx++;
  1057.                             }
  1058.                             new offset = idx;
  1059.                             new result[128];
  1060.                             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  1061.                             {
  1062.                                 result[idx - offset] = cmdtext[idx];
  1063.                                 idx++;
  1064.                             }
  1065.                             result[idx - offset] = EOS;
  1066.                             if(!strlen(result))
  1067.                             {
  1068.                                 SendClientMessage(playerid, COLOR_SYN, "Synthax: /kick <playerid/PartOfName> <reason>");
  1069.                                 return 1;
  1070.                             }
  1071.                             if (PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin])
  1072.                             {
  1073.                                 SendClientMessage(playerid, COLOR_ERROR, "Error: You cannot kick an administrator higher than your level.");
  1074.                                 return 1;
  1075.                             }
  1076.  
  1077.                             format(string, sizeof(string), "AdmCmd:  %s got kicked by %s, reason: %s", pNameGive, pName2, (result));
  1078.                             SendClientMessageToAll(COLOR_LIGHTRED, string);
  1079.  
  1080.                             new query[512];
  1081.                             mysql_format(handle, query, sizeof(query) ,"INSERT INTO `kickslogs` (`ID`,`username`,`IP`,`Admin`,`Reason`,`Date`) VALUES ('','%e','%e','%e','%e',CURRENT_TIMESTAMP)",
  1082.                             pNameGive, PlayerInfo[targetid][pIP], pName2, result);
  1083.                             mysql_query(handle, query);
  1084.  
  1085.                             Kick(targetid);
  1086.                             return 1;
  1087.                         }
  1088.                     }
  1089.                     else
  1090.                     {
  1091.                         SendClientMessage(playerid, COLOR_ERROR, "Error: Invalid playerid / playername.");
  1092.                     }
  1093.                 }
  1094.                 else
  1095.                 {
  1096.                     SendClientMessage(playerid, COLOR_ERROR, "Error: Your admin level is not high enough to use this command.");
  1097.                 }
  1098.             }
  1099.             else
  1100.             {
  1101.                 SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
  1102.             }
  1103.     }
  1104.     return 1;
  1105. }
  1106.  
  1107. CMD:makeadmin( playerid, params[] )
  1108. {
  1109.     new idx, string[256], cmdtext[2048], targetid;
  1110.     if(IsPlayerConnected(playerid))
  1111.     {
  1112.             if(gLogged[playerid] == 1)
  1113.             {
  1114.                 temp = strtok(cmdtext, idx);
  1115.  
  1116.                 if(!strlen(temp))
  1117.                 {
  1118.                     SendClientMessage(playerid, COLOR_SYN, "Synthax: /makeadmin <playerid/PartOfName> <admin level (1-6)>");
  1119.                     return 1;
  1120.                 }
  1121.                 new adminlevel;
  1122.  
  1123.                 targetid = ReturnUser(temp);
  1124.                 temp = strtok(cmdtext, idx);
  1125.                 adminlevel = strval(temp);
  1126.  
  1127.                 GetPlayerName(targetid, pName2, sizeof(pName2));
  1128.                 GetPlayerName(targetid, pNameGive, sizeof(pNameGive));
  1129.  
  1130.                 if(adminlevel >= 0 && adminlevel <= 6) {} else return 1;
  1131.  
  1132.                 if (PlayerInfo[playerid][pAdmin] == 6 || IsPlayerAdmin(playerid))
  1133.                 {
  1134.                     if(IsPlayerConnected(targetid))
  1135.                     {
  1136.                         if(targetid != INVALID_PLAYER_ID)
  1137.                         {
  1138.                             GetPlayerName(targetid, pNameGive, sizeof(pNameGive));
  1139.  
  1140.                             PlayerInfo[targetid][pAdmin] = adminlevel;
  1141.                             Update(targetid, pAdminu);
  1142.  
  1143.                             printf("AdmCmd: %s has promoted %s to a level %d admin.", pName2, pNameGive, adminlevel);
  1144.  
  1145.                             format(string, sizeof(string), "You have been promoted to a level %d admin by %s", adminlevel, pName2);
  1146.                             SendClientMessage(targetid, COLOR_LIGHTRED2, string);
  1147.  
  1148.                             format(string, sizeof(string), "You have promoted %s to a level %d admin.", pNameGive, adminlevel);
  1149.                             SendClientMessage(playerid, COLOR_LIGHTRED2, string);
  1150.                         }
  1151.                     }
  1152.                     else
  1153.                     {
  1154.                         SendClientMessage(playerid, COLOR_ERROR, "Error: Invalid playerid / playername.");
  1155.                     }
  1156.                 }
  1157.  
  1158.                 else
  1159.                 {
  1160.                     SendClientMessage(playerid, COLOR_ERROR, "Error: Your admin level is not high enough to use this command.");
  1161.                 }
  1162.             }
  1163.             else
  1164.             {
  1165.                 SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
  1166.             }
  1167.     }
  1168.     return 1;
  1169. }
  1170.  
  1171. CMD:makehelper( playerid, params[] )
  1172. {
  1173.     new idx, string[256], cmdtext[2048], targetid;
  1174.     if(IsPlayerConnected(playerid))
  1175.     {
  1176.             if(gLogged[playerid] == 1)
  1177.             {
  1178.                 temp = strtok(cmdtext, idx);
  1179.  
  1180.                 if(!strlen(temp))
  1181.                 {
  1182.                     SendClientMessage(playerid, COLOR_SYN, "Synthax: /makehelper <playerid/PartOfName> <helper level (1-6) >");
  1183.                     return 1;
  1184.                 }
  1185.                 new helperlevel;
  1186.  
  1187.                 targetid = ReturnUser(temp);
  1188.                 temp = strtok(cmdtext, idx);
  1189.                 helperlevel = strval(temp);
  1190.  
  1191.                 if(helperlevel >= 0 && helperlevel <= 6) {} else return 1;
  1192.  
  1193.                 if (PlayerInfo[playerid][pAdmin] == 6 || IsPlayerAdmin(playerid))
  1194.                 {
  1195.                     if(IsPlayerConnected(targetid))
  1196.                     {
  1197.                         if(targetid != INVALID_PLAYER_ID)
  1198.                         {
  1199.                             GetPlayerName(targetid, pNameGive, sizeof(pNameGive));
  1200.  
  1201.                             PlayerInfo[targetid][pHelper] = helperlevel;
  1202.                             Update(targetid, pHelperu);
  1203.  
  1204.                             printf("AdmCmd: %s has promoted %s to a level %d admin.", pName2, pNameGive, helperlevel);
  1205.  
  1206.                             format(string, sizeof(string), "You have been promoted to a level %d helper by %s", helperlevel, pName2);
  1207.                             SendClientMessage(targetid, COLOR_LIGHTRED2, string);
  1208.  
  1209.                             format(string, sizeof(string), "You have promoted %s to a level %d helper.", pNameGive, helperlevel);
  1210.                             SendClientMessage(playerid, COLOR_LIGHTRED2, string);
  1211.                         }
  1212.                     }
  1213.                     else
  1214.                     {
  1215.                         SendClientMessage(playerid, COLOR_ERROR, "Error: Invalid playerid / playername.");
  1216.                     }
  1217.                 }
  1218.                 else
  1219.                 {
  1220.                     SendClientMessage(playerid, COLOR_ERROR, "Error: Your admin level is not high enough to use this command.");
  1221.                 }
  1222.             }
  1223.             else
  1224.             {
  1225.                 SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
  1226.             }
  1227.     }
  1228.     return 1;
  1229. }
  1230.  
  1231. CMD:makeleader( playerid, params[] )
  1232. {
  1233.     new idx, string[256], cmdtext[2048], targetid;
  1234.     if(IsPlayerConnected(playerid))
  1235.     {
  1236.             if(gLogged[playerid] == 1)
  1237.             {
  1238.                 temp = strtok(cmdtext, idx);
  1239.  
  1240.                 if(!strlen(temp))
  1241.                 {
  1242.                     SendClientMessage(playerid, COLOR_SYN, "Synthax: /makeleader <playerid/PartOfName> <Faction Number (1-6) >");
  1243.                     return 1;
  1244.                 }
  1245.  
  1246.                 new factionid;
  1247.  
  1248.                 targetid = ReturnUser(temp);
  1249.                 temp = strtok(cmdtext, idx);
  1250.                 factionid = strval(temp);
  1251.  
  1252.                 if(factionid < 1 || factionid > 6)
  1253.                 {
  1254.                     SendClientMessage(playerid, COLOR_ERROR, "Faction ID can't be lower than 1 or bigger than 6!");
  1255.                     return 1;
  1256.  
  1257.                 }
  1258.  
  1259.                 if (PlayerInfo[playerid][pAdmin] == 6)
  1260.                 {
  1261.                     if(IsPlayerConnected(targetid))
  1262.                     {
  1263.                         if(targetid != INVALID_PLAYER_ID)
  1264.                         {
  1265.                             GetPlayerName(targetid, pNameGive, sizeof(pNameGive));
  1266.  
  1267.                             PlayerInfo[targetid][pLeader] = factionid;
  1268.                             PlayerInfo[targetid][pMember] = factionid;
  1269.  
  1270.                             Update(targetid, pLeaderu);
  1271.                             Update(targetid, pMemberu);
  1272.  
  1273.                             format(string, sizeof(string), "You got promoted to the rank of a faction leader by %s", pName2);
  1274.                             SendClientMessage(targetid, COLOR_LIGHTRED2, string);
  1275.  
  1276.                             format(string, sizeof(string), "%s is now the leader of faction id %d.", pNameGive, factionid);
  1277.                             SendClientMessage(playerid, COLOR_LIGHTRED2, string);
  1278.  
  1279.                             if(factionid == 1)
  1280.                             {
  1281.                                 PlayerInfo[targetid][pSkin] = 265;
  1282.                                 PlayerInfo[targetid][pRank] = 6;
  1283.  
  1284.                                 PlayerInfo[targetid][pRank] = 6;
  1285.                                 Update(targetid, pRanku);
  1286.  
  1287.                                 SetPlayerSkin(targetid, PlayerInfo[targetid][pSkin]);
  1288.                                 Update(targetid, pSkinu);                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   return 1;
  1289.                             }
  1290.                             else if(factionid == 2)
  1291.                             {
  1292.                                 PlayerInfo[targetid][pSkin] = 265;
  1293.                                 PlayerInfo[targetid][pRank] = 6;
  1294.  
  1295.                                 PlayerInfo[targetid][pRank] = 6;
  1296.                                 Update(targetid, pRanku);
  1297.  
  1298.                                 SetPlayerSkin(targetid, PlayerInfo[targetid][pSkin]);
  1299.                                 Update(targetid, pSkinu);
  1300.                             }
  1301.                             else if(factionid == 3)
  1302.                             {
  1303.                                 PlayerInfo[targetid][pSkin] = 265;
  1304.                                 PlayerInfo[targetid][pRank] = 6;
  1305.  
  1306.                                 PlayerInfo[targetid][pRank] = 6;
  1307.                                 Update(targetid, pRanku);
  1308.  
  1309.                                 SetPlayerSkin(targetid, PlayerInfo[targetid][pSkin]);
  1310.                                 Update(targetid, pSkinu);
  1311.                             }
  1312.                             else if(factionid == 4)
  1313.                             {
  1314.                                 PlayerInfo[targetid][pSkin] = 295;
  1315.                                 PlayerInfo[targetid][pRank] = 6;
  1316.  
  1317.                                 PlayerInfo[targetid][pRank] = 6;
  1318.                                 Update(targetid, pRanku);
  1319.  
  1320.                                 SetPlayerSkin(targetid, PlayerInfo[targetid][pSkin]);
  1321.                                 Update(targetid, pSkinu);
  1322.                             }
  1323.                             else if(factionid == 5)
  1324.                             {
  1325.                                 PlayerInfo[targetid][pSkin] = 287;
  1326.                                 PlayerInfo[targetid][pRank] = 6;
  1327.  
  1328.                                 PlayerInfo[targetid][pRank] = 6;
  1329.                                 Update(targetid, pRanku);
  1330.  
  1331.                                 SetPlayerSkin(targetid, PlayerInfo[targetid][pSkin]);
  1332.                                 Update(targetid, pSkinu);
  1333.                             }
  1334.                             else if(factionid == 6)
  1335.                             {
  1336.                                 PlayerInfo[targetid][pSkin] = 228;
  1337.                                 PlayerInfo[targetid][pRank] = 6;
  1338.  
  1339.                                 PlayerInfo[targetid][pRank] = 6;
  1340.                                 Update(targetid, pRanku);
  1341.  
  1342.                                 SetPlayerSkin(targetid, PlayerInfo[targetid][pSkin]);
  1343.                                 Update(targetid, pSkinu);
  1344.                             }
  1345.                         }
  1346.                     }
  1347.                     else
  1348.                     {
  1349.                         SendClientMessage(playerid, COLOR_ERROR, "Error: Invalid playerid / playername.");
  1350.                     }
  1351.                 }
  1352.                 else
  1353.                 {
  1354.                     SendClientMessage(playerid, COLOR_ERROR, "Error: Your admin level is not high enough to use this command.");
  1355.                 }
  1356.             }
  1357.             else
  1358.             {
  1359.                 SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
  1360.             }
  1361.     }
  1362.     return 1;
  1363. }
  1364.  
  1365. CMD:auninvite( playerid, params[] )
  1366. {
  1367.     new idx, string[256], cmdtext[2048], targetid;
  1368.     if(IsPlayerConnected(playerid))
  1369.     {
  1370.             if(gLogged[playerid] == 1)
  1371.             {
  1372.                 temp = strtok(cmdtext, idx);
  1373.                 targetid = ReturnUser(temp);
  1374.  
  1375.                 if(!strlen(temp))
  1376.                 {
  1377.                     SendClientMessage(playerid, COLOR_SYN, "Synthax: /auninvite <playerid/PartOfName>");
  1378.                     return 1;
  1379.                 }
  1380.  
  1381.                 if (PlayerInfo[playerid][pAdmin] == 6)
  1382.                 {
  1383.                     if(IsPlayerConnected(targetid))
  1384.                     {
  1385.                             if(targetid != INVALID_PLAYER_ID)
  1386.                             {
  1387.                                 GetPlayerName(targetid, pNameGive, sizeof(pNameGive));
  1388.  
  1389.                                 format(string, sizeof(string), "* You were FactionPKed by Admin %s, you are kicked out of your faction.", pName2);
  1390.                                 SendClientMessage(targetid, COLOR_LIGHTRED, string);
  1391.  
  1392.                                 SendClientMessage(targetid, COLOR_LIGHTBLUE, "* You're a civilian now.");
  1393.  
  1394.                                 PlayerInfo[targetid][pLeader] = 0;
  1395.                                 Update(targetid, pLeaderu);
  1396.  
  1397.                                 PlayerInfo[targetid][pMember] = 0;
  1398.                                 Update(targetid, pMemberu);
  1399.  
  1400.                                 PlayerInfo[targetid][pRank] = 0;
  1401.                                 Update(targetid, pRanku);
  1402.  
  1403.                                 PlayerInfo[targetid][pSkin] = 250;
  1404.                                 SetPlayerSkin(targetid, PlayerInfo[targetid][pSkin]);
  1405.                                 Update(targetid, pSkinu);
  1406.  
  1407.                                 SetPlayerFactionColor(playerid);
  1408.  
  1409.                                 SetSpawnInfo(playerid, 0, 0, 1742.9515, -1862.3721, 13.5764, 359.5591, 0, 0, 0, 0, 0, 0);
  1410.                                 SetPlayerInterior(playerid, 0);
  1411.                                 SpawnPlayer(targetid);
  1412.                             }
  1413.                         }
  1414.                         else
  1415.                         {
  1416.                             SendClientMessage(playerid, COLOR_ERROR, "Error: Invalid playerid / playername.");
  1417.                         }
  1418.                     }
  1419.                     else
  1420.                     {
  1421.                         SendClientMessage(playerid, COLOR_ERROR, "Error: Your admin level is not high enough to use this command.");
  1422.                     }
  1423.                 }
  1424.                 else
  1425.                 {
  1426.                     SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
  1427.                 }
  1428.     }
  1429.     return 1;
  1430. }
  1431.  
  1432. CMD:respawn( playerid, params[] )
  1433. {
  1434.     new idx, string[256], cmdtext[2048], targetid;
  1435.     if(IsPlayerConnected(playerid))
  1436.     {
  1437.             if(gLogged[playerid] == 1)
  1438.             {
  1439.                 temp = strtok(cmdtext, idx);
  1440.  
  1441.                 if(!strlen(temp))
  1442.                 {
  1443.                     SendClientMessage(playerid, COLOR_SYN, "Synthax: /respawn <playerid/PartOfName>");
  1444.                     return 1;
  1445.                 }
  1446.  
  1447.                 targetid = ReturnUser(temp);
  1448.  
  1449.                 if(PlayerInfo[playerid][pAdmin] >= 1)
  1450.                 {
  1451.                     if(IsPlayerConnected(targetid))
  1452.                     {
  1453.                         GetPlayerName(playerid, pName2, sizeof(pName2));
  1454.                         GetPlayerName(targetid, pNameGive, sizeof(pNameGive));
  1455.  
  1456.                         if(targetid != INVALID_PLAYER_ID)
  1457.                         {
  1458.                             format(string, sizeof(string), "AdmWarning: %s respawned %s.", pName2, pNameGive);
  1459.                             AdminsBroadCast(COLOR_LIGHTRED, string);
  1460.  
  1461.                             format(string, sizeof(string), "AdmCmd: %s respawned you.", pName2);
  1462.                             SendClientMessage(targetid, COLOR_LIGHTRED, string);
  1463.  
  1464.                             SetPlayerInterior(playerid, 0);
  1465.                             SpawnPlayer(targetid);
  1466.                         }
  1467.                     }
  1468.                     else
  1469.                     {
  1470.                         SendClientMessage(playerid, COLOR_ERROR, "Error: Invalid playerid / playername.");
  1471.                     }
  1472.                 }
  1473.                 else
  1474.                 {
  1475.                     SendClientMessage(playerid, COLOR_ERROR, "Error: Your admin level is not high enough to use this command.");
  1476.                 }
  1477.             }
  1478.             else
  1479.             {
  1480.                 SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
  1481.             }
  1482.     }
  1483.     return 1;
  1484. }
  1485.  
  1486. CMD:checkweapons( playerid, params[] )
  1487. {
  1488.     new idx, string[256], cmdtext[2048], targetid;
  1489.     if(IsPlayerConnected(playerid))
  1490.     {
  1491.             if(gLogged[playerid] == 1)
  1492.             {
  1493.                 if (PlayerInfo[playerid][pAdmin] < 1)
  1494.                 {
  1495.                     SendClientMessage(playerid, COLOR_ERROR, "You are not authorized");
  1496.                     return 1;
  1497.                 }
  1498.                 temp = strtok(cmdtext,idx);
  1499.                 if (!strlen(temp))
  1500.                 {
  1501.                     SendClientMessage(playerid, COLOR_SYN, "Synthax: /checkweapons <playerid/partOfName>");
  1502.                     return 1;
  1503.                 }
  1504.                 targetid = ReturnUser(temp);
  1505.                 if (targetid == INVALID_PLAYER_ID)
  1506.                 {
  1507.                     SendClientMessage(playerid, COLOR_ERROR, "That player is offline");
  1508.                     return 1;
  1509.                 }
  1510.                 new weaponsmodel, ammunition;
  1511.  
  1512.                 GetPlayerName(targetid, pNameGive, sizeof(pNameGive));
  1513.  
  1514.                 format(string, sizeof(string), "%s has the following weapons:", pNameGive);
  1515.                 SendClientMessage(playerid, COLOR_ADMIN_INFO, string);
  1516.  
  1517.                 for (new i=0; i<9; i++)
  1518.                 {
  1519.                     GetPlayerWeaponData(targetid, i, weaponsmodel, ammunition);
  1520.                     if(weaponsmodel != 0)
  1521.                     {
  1522.                         format(string, sizeof(string), "%d: %d (%d)", i, weaponsmodel, ammunition);
  1523.                         SendClientMessage(playerid, COLOR_ADMIN_INFO, string);
  1524.                     }
  1525.                 }
  1526.             }
  1527.     }
  1528.     return 1;
  1529. }
  1530.  
  1531. CMD:spec( playerid, params[] )
  1532. {
  1533.     new idx, string[256], cmdtext[2048], targetid;
  1534.     if(IsPlayerConnected(playerid))
  1535.     {
  1536.             if(PlayerInfo[playerid][pAdmin] < 1)
  1537.             {
  1538.                 SendClientMessage(playerid, COLOR_ERROR, "You are not authorized to use that command.");
  1539.                 return 1;
  1540.             }
  1541.             temp = strtok(cmdtext, idx);
  1542.             if(!strlen(temp))
  1543.             {
  1544.                 SendClientMessage(playerid, COLOR_SYN, "Synthax: /spec [playerid/off]");
  1545.                 return 1;
  1546.             }
  1547.             targetid = ReturnUser(temp);
  1548.             if(IsPlayerNPC(targetid)) return 1;
  1549.             if(strcmp("off", temp, true, strlen(temp)) == 0)
  1550.             {
  1551.                 if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING)
  1552.                 {
  1553.                     SendClientMessage(playerid, COLOR_ADMIN_INFO, "You are not spectating anyone");
  1554.                     return 1;
  1555.                 }
  1556.                 SetPlayerInterior(playerid, PlayerInfo[playerid][pInterior]);
  1557.                 SendClientMessage(playerid, COLOR_ADMIN_INFO, "You are no longer spectating.");
  1558.                 TogglePlayerSpectating(playerid, 0);
  1559.                 SpectatedID[playerid] = INVALID_PLAYER_ID;
  1560.                 SpectateType[playerid] = ADMIN_SPEC_TYPE_NONE;
  1561.                 return 1;
  1562.             }
  1563.             if(IsPlayerConnected(targetid))
  1564.             {
  1565.                 if(GetPlayerState(playerid) != PLAYER_STATE_SPECTATING)
  1566.                 {
  1567.                     PlayerInfo[playerid][pInterior] = GetPlayerInterior(playerid);
  1568.                 }
  1569.                 SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid));
  1570.                 SetPlayerInterior(playerid, GetPlayerInterior(targetid));
  1571.                 TogglePlayerSpectating(playerid, 1);
  1572.                 SpectatedID[playerid] = targetid;
  1573.                 new Float:X, Float:Y, Float:Z;
  1574.                 new Float:health;
  1575.                 GetPlayerHealth(targetid, health);
  1576.                 new Float:armor;
  1577.                 GetPlayerArmour(targetid, armor);GetPlayerPos(playerid, X, Y, Z);
  1578.                 GetPlayerName(targetid, pNameGive, sizeof(pNameGive));
  1579.                 new cash =  GetPlayerMoney(targetid);
  1580.                 if (PlayerInfo[playerid][pAdmin] >= 1)
  1581.                 {
  1582.                     format(string, sizeof(string), "Specing: [%d]%s [$%d] [H:%.0f] [A:%.0f]",targetid,pNameGive,cash,health,armor);
  1583.                 }
  1584.                 SendClientMessage(playerid, COLOR_GREEN, string);
  1585.                 if(IsPlayerInAnyVehicle(targetid))
  1586.                 {
  1587.                     PlayerSpectateVehicle(playerid, GetPlayerVehicleID(targetid));
  1588.                     SpectateType[playerid] = ADMIN_SPEC_TYPE_VEHICLE;
  1589.                 }
  1590.                 else
  1591.                 {
  1592.                     PlayerSpectatePlayer(playerid, targetid);
  1593.                     SpectateType[playerid] = ADMIN_SPEC_TYPE_PLAYER;
  1594.                 }
  1595.             }
  1596.             else
  1597.             {
  1598.                 SendClientMessage(playerid, COLOR_ERROR, "That player isn't active !");
  1599.                 return 1;
  1600.             }
  1601.     }
  1602.     return 1;
  1603. }
  1604.  
  1605. CMD:gethere( playerid, params[] )
  1606. {
  1607.     new idx, cmdtext[2048], targetid;
  1608.     if(IsPlayerConnected(playerid))
  1609.     {
  1610.             if(gLogged[playerid] == 1)
  1611.             {
  1612.                 temp = strtok(cmdtext, idx);
  1613.  
  1614.                 if(!strlen(temp))
  1615.                 {
  1616.                     SendClientMessage(playerid, COLOR_SYN, "Synthax: /gethere <playerid/PartOfName> or <carid>");
  1617.                     return 1;
  1618.                 }
  1619.                 targetid = ReturnUser(temp);
  1620.                 if (PlayerInfo[playerid][pAdmin] >= 1)
  1621.                 {
  1622.                     if (IsPlayerConnected(targetid))
  1623.                     {
  1624.                         if(targetid != INVALID_PLAYER_ID)
  1625.                         {
  1626.                             GetPlayerPos(playerid, x, y, z);
  1627.  
  1628.                             if(PlayerInfo[playerid][pInterior] > 0)
  1629.                             {
  1630.                                 SetPlayerInterior(targetid,PlayerInfo[playerid][pInterior]);
  1631.                                 PlayerInfo[targetid][pInterior] = PlayerInfo[playerid][pInterior];
  1632.                                 SetPlayerInterior(targetid, GetPlayerInterior(playerid));
  1633.                                 SetPlayerVirtualWorld(targetid, GetPlayerVirtualWorld(playerid));
  1634.                             }
  1635.                             if(PlayerInfo[playerid][pInterior] == 0)
  1636.                             {
  1637.                                 SetPlayerInterior(targetid,0);
  1638.                             }
  1639.                             if(z > 930.0 && PlayerInfo[playerid][pInterior] == 0)
  1640.                             {
  1641.                                 SetPlayerInterior(targetid,1);
  1642.                                 PlayerInfo[targetid][pInterior] = 1;
  1643.                             }
  1644.                             if (GetPlayerState(targetid) == 2)
  1645.                             {
  1646.                                 new tmpcar = GetPlayerVehicleID(targetid);
  1647.                                 SetVehiclePos(tmpcar, x, y+4, z);
  1648.                                 SetPlayerInterior(targetid, GetPlayerInterior(playerid));
  1649.                                 SetPlayerVirtualWorld(targetid, GetPlayerVirtualWorld(playerid));
  1650.                                 SetVehicleVirtualWorld(GetPlayerVehicleID(targetid), GetPlayerVirtualWorld(playerid));
  1651.                             }
  1652.                             else
  1653.                             {
  1654.                                 SetPlayerPos(targetid,x, y+2, z);
  1655.                             }
  1656.                             SendClientMessage(targetid, COLOR_LIGHTRED, "You got teleported");
  1657.                         }
  1658.                     }
  1659.                     else if(strcmp(temp, "car", true) == 0)
  1660.                         {
  1661.                             temp = strtok(cmdtext, idx);
  1662.  
  1663.                             if(!strlen(temp))
  1664.                             {
  1665.                                 SendClientMessage(playerid, COLOR_SYN, "Synthax: /gethere car <carid>");
  1666.                                 return 1;
  1667.                             }
  1668.  
  1669.                             new carid;
  1670.  
  1671.                             carid = strval(temp);
  1672.  
  1673.                             GetPlayerPos(playerid, x, y, z);
  1674.                             SetVehiclePos(carid,x,y+4, z);
  1675.                             SetVehicleVirtualWorld(carid, GetPlayerVirtualWorld(playerid));
  1676.                         }
  1677.                 }
  1678.                 else
  1679.                 {
  1680.                     SendClientMessage(playerid, COLOR_ERROR, "Error: Your admin level is not high enough to use this command.");
  1681.                 }
  1682.             }
  1683.             else if(gLogged[playerid] != 1)
  1684.             {
  1685.                 SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
  1686.             }
  1687.             else
  1688.             {
  1689.                 SendClientMessage(playerid, COLOR_ERROR, "Error: Invalid playerid / playername / carid.");
  1690.             }
  1691.     }
  1692.     return 1;
  1693. }
  1694.  
  1695.     //
  1696.     // Helpers Commands
  1697. CMD:hh( playerid, params[] )
  1698. {
  1699.     if(IsPlayerConnected(playerid))
  1700.     {
  1701.             if(gLogged[playerid] == 1)
  1702.             {
  1703.                 if(PlayerInfo[playerid][pHelper] >= 1)
  1704.                 {
  1705.                     SendClientMessage(playerid, COLOR_GREEN, "_______________________________________");
  1706.  
  1707.                     if(PlayerInfo[playerid][pHelper] >= 1)
  1708.                     {
  1709.                         SendClientMessage(playerid, COLOR_WHITE, "** Helper level 1 ** (/hh)elperhelp (/he)lperchat /goto /check");
  1710.                     }
  1711.  
  1712.                     if(PlayerInfo[playerid][pHelper] >= 2)
  1713.                     {
  1714.                         SendClientMessage(playerid, COLOR_WHITE, "** Helper level 2 **");
  1715.                     }
  1716.  
  1717.                     if(PlayerInfo[playerid][pHelper] >= 3)
  1718.                     {
  1719.                         SendClientMessage(playerid, COLOR_WHITE, "** Helper level 3 **");
  1720.                     }
  1721.  
  1722.                     if(PlayerInfo[playerid][pHelper] >= 4)
  1723.                     {
  1724.                         SendClientMessage(playerid, COLOR_WHITE, "** Helper level 4 **");
  1725.                     }
  1726.  
  1727.                     if(PlayerInfo[playerid][pHelper] >= 5)
  1728.                     {
  1729.                         SendClientMessage(playerid, COLOR_WHITE, "** Helper level 5 **");
  1730.                     }
  1731.  
  1732.                     if(PlayerInfo[playerid][pHelper] >= 6)
  1733.                     {
  1734.                         SendClientMessage(playerid, COLOR_WHITE, "** Helper level 6 **");
  1735.                     }
  1736.  
  1737.                     SendClientMessage(playerid, COLOR_GREEN, "_______________________________________");
  1738.                 }
  1739.  
  1740.                 else
  1741.                 {
  1742.                     SendClientMessage(playerid, COLOR_ERROR, "Error: Your helper level is not high enough to use this command.");
  1743.                 }
  1744.  
  1745.             }
  1746.  
  1747.             else
  1748.             {
  1749.                 SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
  1750.             }
  1751.     }
  1752.     return 1;
  1753. }
  1754.  
  1755. CMD:he( playerid, params[] )
  1756. {
  1757.     new idx, string[256], cmdtext[2048];
  1758.     if(IsPlayerConnected(playerid))
  1759.     {
  1760.             if(gLogged[playerid] == 1)
  1761.             {
  1762.                 GetPlayerName(playerid, pName2, sizeof(pName2));
  1763.  
  1764.                 new length = strlen(cmdtext);
  1765.  
  1766.                 while ((idx < length) && (cmdtext[idx] <= ' '))
  1767.                 {
  1768.                     idx++;
  1769.                 }
  1770.  
  1771.                 new offset = idx;
  1772.                 new result[128];
  1773.  
  1774.                 while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  1775.                 {
  1776.                     result[idx - offset] = cmdtext[idx];
  1777.                     idx++;
  1778.                 }
  1779.  
  1780.                 result[idx - offset] = EOS;
  1781.  
  1782.                 if(!strlen(result))
  1783.                 {
  1784.                     SendClientMessage(playerid, COLOR_SYN, "Synthax: (/he)lperchat <text>");
  1785.                     return 1;
  1786.                 }
  1787.  
  1788.                 if (PlayerInfo[playerid][pHelper] >= 1 && PlayerInfo[playerid][pHelper] <= 5)
  1789.                 {
  1790.                     format(string, sizeof(string), "** Helper Level %d %s : %s **", PlayerInfo[playerid][pHelper], pName2, result);
  1791.                     HelpersBroadCast(COLOR_YELLOW2, string);
  1792.                 }
  1793.  
  1794.                 if (PlayerInfo[playerid][pHelper] == 6)
  1795.                 {
  1796.                     format(string, sizeof(string), "{CFAE70}** Helper Level %d %s : %s **", PlayerInfo[playerid][pHelper], pName2, result);
  1797.                     HelpersBroadCast(COLOR_WHITE, string);
  1798.                 }
  1799.  
  1800.                 if (PlayerInfo[playerid][pAdmin] < 1)
  1801.                 {
  1802.                     SendClientMessage(playerid, COLOR_ERROR, "Error: Your helper level is not high enough to use this command.");
  1803.                     return 1;
  1804.                 }
  1805.             }
  1806.             else
  1807.             {
  1808.                 SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
  1809.             }
  1810.     }
  1811.     return 1;
  1812. }
  1813.  
  1814.     //
  1815.     // Admins & Helpers commands
  1816. CMD:goto( playerid, params[] )
  1817. {
  1818.     new idx, cmdtext[2048], targetid;
  1819.     if(IsPlayerConnected(playerid))
  1820.     {
  1821.             if(gLogged[playerid] == 1)
  1822.             {
  1823.                 temp = strtok(cmdtext, idx);
  1824.  
  1825.                 if(!strlen(temp))
  1826.                 {
  1827.                     SendClientMessage(playerid, COLOR_SYN, "Synthax: /goto <playerid/PartOfName> or <carid> or <destination>");
  1828.                     return 1;
  1829.                 }
  1830.  
  1831.                 targetid = ReturnUser(temp);
  1832.  
  1833.                 if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)
  1834.                 {
  1835.                     if (IsPlayerConnected(targetid))
  1836.                     {
  1837.                         if(targetid != INVALID_PLAYER_ID)
  1838.                         {
  1839.                             if(GetPlayerState(targetid) == PLAYER_STATE_SPECTATING)
  1840.                             {
  1841.                                 SendClientMessage(playerid, COLOR_YELLOW3, "That Player is spectating Someone.");
  1842.                             }
  1843.  
  1844.                             GetPlayerPos(targetid, Float:x, Float:y, Float:z);
  1845.  
  1846.                             if(PlayerInfo[targetid][pInterior] > 0)
  1847.                             {
  1848.                                 SetPlayerInterior(playerid,PlayerInfo[targetid][pInterior]);
  1849.                                 PlayerInfo[playerid][pInterior] = PlayerInfo[targetid][pInterior];
  1850.                             }
  1851.                             if(PlayerInfo[playerid][pInterior] == 0)
  1852.                             {
  1853.                                 SetPlayerInterior(playerid,0);
  1854.                             }
  1855.                             if(Float:z > 530.0 && PlayerInfo[targetid][pInterior] == 0)
  1856.                             {
  1857.                                 SetPlayerInterior(playerid,1);
  1858.                                 PlayerInfo[playerid][pInterior] = 1;
  1859.                             }
  1860.                             if (GetPlayerState(playerid) == 2)
  1861.                             {
  1862.                                 new tempcar = GetPlayerVehicleID(playerid);
  1863.                                 SetVehiclePos(tempcar, Float:x, Float:y+4, Float:z);
  1864.                             }
  1865.                             else
  1866.                             {
  1867.                                 SetPlayerPos(playerid, Float:x, Float:y+2, Float:z);
  1868.                             }
  1869.  
  1870.                             SendClientMessage(playerid, COLOR_LIGHTRED, "You got teleported");
  1871.                             SetPlayerInterior(playerid, GetPlayerInterior(targetid));
  1872.                             SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(targetid));
  1873.                         }
  1874.                     }
  1875.                     else if(strcmp(temp, "car", true) == 0)
  1876.                     {
  1877.                         temp = strtok(cmdtext, idx);
  1878.                         if(!strlen(temp))
  1879.                         {
  1880.                             SendClientMessage(playerid, COLOR_SYN, "Synthax: /goto car <carid>");
  1881.                             return 1;
  1882.                         }
  1883.  
  1884.                         new tempcar = strval(temp);
  1885.  
  1886.                         GetVehiclePos(tempcar, Float:x, Float:y, Float:z);
  1887.  
  1888.                         if (GetPlayerState(playerid) == 2)
  1889.                         {
  1890.                             new tempcar2 = GetPlayerVehicleID(playerid);
  1891.                             SetVehiclePos(tempcar2, Float:x, Float:y, Float:z);
  1892.                         }
  1893.                         else
  1894.                         {
  1895.                             SetPlayerPos(playerid, Float:x, Float:y, Float:z);
  1896.                         }
  1897.  
  1898.                         SendClientMessage(playerid, COLOR_LIGHTRED, "You got teleported");
  1899.                         SetPlayerInterior(playerid, 0);
  1900.                     }
  1901.                     else if(strcmp(temp, "ls", true) == 0)
  1902.                     {
  1903.                         if (GetPlayerState(playerid) == 2)
  1904.                         {
  1905.                             new tempcar = GetPlayerVehicleID(playerid);
  1906.                             SetVehiclePos(tempcar, 1529.6,-1691.2,13.3);
  1907.                         }
  1908.                         else
  1909.                         {
  1910.                             SetPlayerPos(playerid, 1529.6,-1691.2,13.3);
  1911.                         }
  1912.  
  1913.                         SendClientMessage(playerid, COLOR_LIGHTRED, "You got teleported");
  1914.                         SetPlayerInterior(playerid,0);
  1915.                         PlayerInfo[playerid][pInterior] = 0;
  1916.                     }
  1917.                     else
  1918.                     {
  1919.                         SendClientMessage(playerid, COLOR_ERROR, "Error: Invalid playerid / playername / carid / destination.");
  1920.                     }
  1921.                 }
  1922.                 else
  1923.                 {
  1924.                 SendClientMessage(playerid, COLOR_ERROR, "Error: Your admin level is not high enough to use this command.");
  1925.                 }
  1926.             }
  1927.             else
  1928.             {
  1929.                 SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
  1930.             }
  1931.     }
  1932.     return 1;
  1933. }
  1934.  
  1935. CMD:check( playerid, params[] )
  1936. {
  1937.     new idx, cmdtext[2048], targetid;
  1938.     if(IsPlayerConnected(playerid))
  1939.     {
  1940.             if(gLogged[playerid] == 1)
  1941.             {
  1942.                 temp = strtok(cmdtext, idx);
  1943.  
  1944.                 if(!strlen(temp))
  1945.                 {
  1946.                     SendClientMessage(playerid, COLOR_SYN, "Synthax: /check <playerid/PartOfName>");
  1947.                     return 1;
  1948.                 }
  1949.  
  1950.                 if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pHelper] >= 1)
  1951.                 {
  1952.  
  1953.                     targetid = ReturnUser(temp);
  1954.  
  1955.                     if(targetid != INVALID_PLAYER_ID)
  1956.                     {
  1957.                         GetPlayerName(targetid, pNameGive, sizeof(pNameGive));
  1958.  
  1959.                         ShowStats(playerid, targetid);
  1960.                     }
  1961.  
  1962.                     else
  1963.                     {
  1964.                         SendClientMessage(playerid, COLOR_ERROR, "Error: Invalid playerid / playername.");
  1965.                     }
  1966.                 }
  1967.  
  1968.                 else
  1969.                 {
  1970.                     SendClientMessage(playerid, COLOR_ERROR, "Error: Your admin level is not high enough to use this command.");
  1971.                 }
  1972.             }
  1973.             else
  1974.             {
  1975.                 SendClientMessage(playerid, COLOR_ERROR, "You are not logged in!");
  1976.             }
  1977.     }
  1978.     return 1;
  1979. }
  1980.     // Faction Member Commands
  1981. CMD:f( playerid, params[] )
  1982. {
  1983.     new idx, string[256], cmdtext[2048];
  1984.     if(IsPlayerConnected(playerid))
  1985.     {
  1986.             GetPlayerName(playerid, pName2, sizeof(pName2));
  1987.             new length = strlen(cmdtext);
  1988.  
  1989.             while ((idx < length) && (cmdtext[idx] <= ' '))
  1990.             {
  1991.                 idx++;
  1992.             }
  1993.  
  1994.             new offset = idx;
  1995.             new result[128];
  1996.  
  1997.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  1998.             {
  1999.                 result[idx - offset] = cmdtext[idx];
  2000.                 idx++;
  2001.             }
  2002.  
  2003.             result[idx - offset] = EOS;
  2004.  
  2005.             if(!strlen(result))
  2006.             {
  2007.                 SendClientMessage(playerid, COLOR_SYN, "Synthax: (/f)action <faction chat>");
  2008.                 return 1;
  2009.             }
  2010.  
  2011.             if(PlayerInfo[playerid][pLeader] > 0 || PlayerInfo[playerid][pMember] > 0)
  2012.             {
  2013.                 if(PlayerInfo[playerid][pMember] == 1)
  2014.                 {
  2015.                     if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** (( Chief %s: %s )) **", pName2, result); }
  2016.                     else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** (( Captain %s: %s ))  **", pName2, result); }
  2017.                     else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** (( Lieutenant %s: %s )) **", pName2, result); }
  2018.                     else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** (( Sergeant %s: %s ))  **", pName2, result); }
  2019.                     else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** (( Officer %s: %s ))  **", pName2, result); }
  2020.                     else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** (( Cadet %s: %s ))  **", pName2, result); }
  2021.                     else { format(string, sizeof(string), "** (( Cadet %s: %s )) **", pName2, result); }
  2022.                     FactionsBroadCast(PlayerInfo[playerid][pMember], COLOR_FACTION_CHAT, string);
  2023.                 }
  2024.                 else if(PlayerInfo[playerid][pMember] == 4)
  2025.                 {
  2026.                     if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** (( Chief Fireman/Paramedic %s: %s )) **", pName2, result); }
  2027.                     else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** (( Paramedic Field %s: %s )) **", pName2, result); }
  2028.                     else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** (( Ambulance Commander %s: %s ))  **", pName2, result); }
  2029.                     else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** (( Paramedic in charge %s: %s ))  **", pName2, result); }
  2030.                     else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** (( Fire Paramedic %s: %s ))  **", pName2, result); }
  2031.                     else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** (( Candidate Fire Paramedic %s: %s ))  **", pName2, result); }
  2032.                     else { format(string, sizeof(string), "** (( Private %s: %s )) **", pName2, result); }
  2033.                     FactionsBroadCast(PlayerInfo[playerid][pMember], COLOR_FACTION_CHAT, string);
  2034.                 }
  2035.                 return 1;
  2036.             }
  2037.             else
  2038.             {
  2039.                 SendClientMessage(playerid, COLOR_ERROR, "Error: You are not part of a Faction!");
  2040.                 return 1;
  2041.             }
  2042.     }
  2043.     return 1;
  2044. }
  2045.  
  2046. CMD:radio( playerid, params[] )
  2047. {
  2048.     new idx, string[256], cmdtext[2048];
  2049.     if(IsPlayerConnected(playerid))
  2050.     {
  2051.             GetPlayerName(playerid, pName2, sizeof(pName2));
  2052.  
  2053.             new length = strlen(cmdtext);
  2054.  
  2055.             while ((idx < length) && (cmdtext[idx] <= ' '))
  2056.             {
  2057.                 idx++;
  2058.             }
  2059.  
  2060.             new offset = idx;
  2061.             new result[128];
  2062.  
  2063.             while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
  2064.             {
  2065.                 result[idx - offset] = cmdtext[idx];
  2066.                 idx++;
  2067.             }
  2068.  
  2069.             result[idx - offset] = EOS;
  2070.  
  2071.             if(!strlen(result))
  2072.             {
  2073.                 SendClientMessage(playerid, COLOR_SYN, "Synthax: (/r)adio <radio chat>");
  2074.                 return 1;
  2075.             }
  2076.  
  2077.             if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
  2078.             {
  2079.                 if(PlayerInfo[playerid][pRank] >= 6) { format(string, sizeof(string), "** LSPD Chief %s: %s, over. **", pName2, result); }
  2080.                 else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** LSPD Captain %s: %s, over. **", pName2, result); }
  2081.                 else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** LSPD Lieutenant %s: %s, over. **", pName2, result); }
  2082.                 else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** LSPD Sergeant %s: %s, over. **", pName2, result); }
  2083.                 else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** LSPD Officer %s: %s, over. **", pName2, result); }
  2084.                 else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** LSPD Cadet %s: %s, over. **", pName2, result); }
  2085.                 else
  2086.                 {
  2087.                     format(string, sizeof(string), "** LSPD Cadet %s: %s, over. **", pName2, result);
  2088.                 }
  2089.                 RadioBroadCast(PlayerInfo[playerid][pMember], COLOR_RADIO_CHAT, string);
  2090.                 return 1;
  2091.             }
  2092.             if(PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
  2093.             {
  2094.                 if(PlayerInfo[playerid][pRank] >= 6) { format(string, sizeof(string), "** LVPD Chief %s: %s, over. **", pName2, result); }
  2095.                 else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** LVPD Captain %s: %s, over. **", pName2, result); }
  2096.                 else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** LVPD Lieutenant %s: %s, over. **", pName2, result); }
  2097.                 else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** LVPD Sergeant %s: %s, over. **", pName2, result); }
  2098.                 else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** LVPD Officer %s: %s, over. **", pName2, result); }
  2099.                 else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** LVPD Cadet %s: %s, over. **", pName2, result); }
  2100.                 else
  2101.                 {
  2102.                     format(string, sizeof(string), "** Cadet %s: %s, over. **", pName2, result);
  2103.                 }
  2104.                 RadioBroadCast(PlayerInfo[playerid][pMember], COLOR_RADIO_CHAT, string);
  2105.                 return 1;
  2106.             }
  2107.             if(PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
  2108.             {
  2109.                 if(PlayerInfo[playerid][pRank] >= 6) { format(string, sizeof(string), "** SFPD Chief %s: %s, over. **", pName2, result); }
  2110.                 else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** SFPD Captain %s: %s, over. **", pName2, result); }
  2111.                 else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** SFPD Lieutenant %s: %s, over. **", pName2, result); }
  2112.                 else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** SFPD Sergeant %s: %s, over. **", pName2, result); }
  2113.                 else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** SFPD Officer %s: %s, over. **", pName2, result); }
  2114.                 else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** SFPD Cadet %s: %s, over. **", pName2, result); }
  2115.                 else
  2116.                 {
  2117.                     format(string, sizeof(string), "** Cadet %s: %s, over. **", pName2, result);
  2118.                 }
  2119.                 RadioBroadCast(PlayerInfo[playerid][pMember], COLOR_RADIO_CHAT, string);
  2120.                 return 1;
  2121.             }
  2122.             else if(PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)
  2123.             {
  2124.                 if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Director %s: %s, over. **", pName2, result); }
  2125.                 else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Assistant Director in Charge %s: %s, over. **", pName2, result); }
  2126.                 else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Special Agent in Charge %s: %s, over. **", pName2, result); }
  2127.                 else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Special Agent %s: %s, over. **", pName2, result); }
  2128.                 else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Special Agent Trainee %s: %s, over. **", pName2, result); }
  2129.                 else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Professional Staff %s: %s, over. **", pName2, result); }
  2130.                 else
  2131.                 {
  2132.                     format(string, sizeof(string), "** Intern %s: %s, over. **", pName2, result);
  2133.                 }
  2134.                 RadioBroadCast(PlayerInfo[playerid][pMember], COLOR_RADIO_CHAT, string);
  2135.                 return 1;
  2136.             }
  2137.             else if(PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)
  2138.             {
  2139.                 if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** General %s: %s, over. **", pName2, result); }
  2140.                 else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Lieutenant %s: %s, over. **", pName2, result); }
  2141.                 else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Captain %s: %s, over. **", pName2, result); }
  2142.                 else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Major %s: %s, over. **", pName2, result); }
  2143.                 else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Sergeant %s: %s, over. **", pName2, result); }
  2144.                 else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Private %s: %s, over. **", pName2, result); }
  2145.                 else
  2146.                 {
  2147.                     format(string, sizeof(string), "** Private %s: %s, over. **", pName2, result);
  2148.                 }
  2149.                 RadioBroadCast(PlayerInfo[playerid][pMember], COLOR_RADIO_CHAT, string);
  2150.                 return 1;
  2151.             }
  2152.             else if(PlayerInfo[playerid][pMember]== 6 || PlayerInfo[playerid][pLeader]== 6)
  2153.             {
  2154.                 if(PlayerInfo[playerid][pRank] == 6) { format(string, sizeof(string), "** Chief Paramedic %s: %s, over. **", pName2, result); }
  2155.                 else if(PlayerInfo[playerid][pRank] == 5) { format(string, sizeof(string), "** Assistant Chief Paramedic %s: %s, over. **", pName2, result); }
  2156.                 else if(PlayerInfo[playerid][pRank] == 4) { format(string, sizeof(string), "** Ambulance Chief %s: %s, over. **", pName2, result); }
  2157.                 else if(PlayerInfo[playerid][pRank] == 3) { format(string, sizeof(string), "** Paramedic in Charge %s: %s, over. **", pName2, result); }
  2158.                 else if(PlayerInfo[playerid][pRank] == 2) { format(string, sizeof(string), "** Paramedic %s: %s, over. **", pName2, result); }
  2159.                 else if(PlayerInfo[playerid][pRank] == 1) { format(string, sizeof(string), "** Candidate Paramedic %s: %s, over. **", pName2, result); }
  2160.                 else
  2161.                 {
  2162.                     format(string, sizeof(string), "** Candidate Paramedic %s: %s, over. **", pName2, result);
  2163.                 }
  2164.                 RadioBroadCast(PlayerInfo[playerid][pMember], COLOR_RADIO_CHAT, string);
  2165.                 return 1;
  2166.             }
  2167.             else
  2168.             {
  2169.                 SendClientMessage(playerid, COLOR_ERROR, "Error: You are not part of a Team!");
  2170.                 return 1;
  2171.             }
  2172.     }
  2173.     return 1;
  2174. }
  2175.  
  2176. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  2177. {
  2178.     return 1;
  2179. }
  2180.  
  2181. public OnPlayerExitVehicle(playerid, vehicleid)
  2182. {
  2183.     return 1;
  2184. }
  2185.  
  2186. public OnPlayerStateChange(playerid, newstate, oldstate)
  2187. {
  2188.     return 1;
  2189. }
  2190.  
  2191. public OnPlayerEnterCheckpoint(playerid)
  2192. {
  2193.     return 1;
  2194. }
  2195.  
  2196. public OnPlayerLeaveCheckpoint(playerid)
  2197. {
  2198.     return 1;
  2199. }
  2200.  
  2201. public OnPlayerEnterRaceCheckpoint(playerid)
  2202. {
  2203.     return 1;
  2204. }
  2205.  
  2206. public OnPlayerLeaveRaceCheckpoint(playerid)
  2207. {
  2208.     return 1;
  2209. }
  2210.  
  2211. public OnRconCommand(cmd[])
  2212. {
  2213.     return 1;
  2214. }
  2215.  
  2216. public OnPlayerRequestSpawn(playerid)
  2217. {
  2218.     return 1;
  2219. }
  2220.  
  2221. public OnObjectMoved(objectid)
  2222. {
  2223.     return 1;
  2224. }
  2225.  
  2226. public OnPlayerObjectMoved(playerid, objectid)
  2227. {
  2228.     return 1;
  2229. }
  2230.  
  2231. public OnPlayerPickUpPickup(playerid, pickupid)
  2232. {
  2233.     return 1;
  2234. }
  2235.  
  2236. public OnVehicleMod(playerid, vehicleid, componentid)
  2237. {
  2238.     return 1;
  2239. }
  2240.  
  2241. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  2242. {
  2243.     return 1;
  2244. }
  2245.  
  2246. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  2247. {
  2248.     return 1;
  2249. }
  2250.  
  2251. public OnPlayerSelectedMenuRow(playerid, row)
  2252. {
  2253.     return 1;
  2254. }
  2255.  
  2256. public OnPlayerExitedMenu(playerid)
  2257. {
  2258.     return 1;
  2259. }
  2260.  
  2261. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  2262. {
  2263.     return 1;
  2264. }
  2265.  
  2266. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  2267. {
  2268.     return 1;
  2269. }
  2270.  
  2271. public OnRconLoginAttempt(ip[], password[], success)
  2272. {
  2273.     return 1;
  2274. }
  2275.  
  2276. public OnPlayerUpdate(playerid)
  2277. {
  2278.     return 1;
  2279. }
  2280.  
  2281. public OnPlayerStreamIn(playerid, forplayerid)
  2282. {
  2283.     return 1;
  2284. }
  2285.  
  2286. public OnPlayerStreamOut(playerid, forplayerid)
  2287. {
  2288.     return 1;
  2289. }
  2290.  
  2291. public OnVehicleStreamIn(vehicleid, forplayerid)
  2292. {
  2293.     return 1;
  2294. }
  2295.  
  2296. public OnVehicleStreamOut(vehicleid, forplayerid)
  2297. {
  2298.     return 1;
  2299. }
  2300.  
  2301. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  2302. {
  2303.  
  2304.     if(dialogid == DIALOG_LOGIN)
  2305.     {
  2306.         if(IsPlayerConnected(playerid))
  2307.         {
  2308.             if(!response)
  2309.             {
  2310.                 Kick(playerid);
  2311.                 return 1;
  2312.             }
  2313.             if(strlen(inputtext) >= 3 && strlen(inputtext) <= 20)
  2314.             {
  2315.                 if(strfind(inputtext, "'", true) != -1)
  2316.                 {
  2317.                     new pName[64];
  2318.                     GetPlayerName(playerid, pName, sizeof(pName));
  2319.                     ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Type your account's password below:", "Login", "Exit");
  2320.                 }
  2321.                 new tmppass[64];
  2322.                 mysql_real_escape_string(inputtext, tmppass);
  2323.                 if(strlen(tmppass) < 3)
  2324.                 {
  2325.                     new loginname[64];
  2326.                     GetPlayerName(playerid,loginname,sizeof(loginname));
  2327.                     ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD,"Login", "Type your account's password below:", "Login", "Exit");
  2328.                 }
  2329.                 OnPlayerLogin(playerid,tmppass);
  2330.             }
  2331.             else
  2332.             {
  2333.                 new loginname[64];
  2334.                 GetPlayerName(playerid,loginname,sizeof(loginname));
  2335.                 ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_PASSWORD, "Login", "Type your account's password below:", "Login", "Exit");
  2336.             }
  2337.         }
  2338.     }
  2339.  
  2340.     if(dialogid == DIALOG_REGISTER)
  2341.     {
  2342.         if(!response)
  2343.         {
  2344.             Kick(playerid);
  2345.             return 1;
  2346.         }
  2347.  
  2348.         if(strlen(inputtext) >= 3 && strlen(inputtext) <= 20)
  2349.         {
  2350.             new tmppass[64];
  2351.             new pName[30];
  2352.             new string[256];
  2353.             GetPlayerName(playerid, pName, sizeof(pName));
  2354.  
  2355.             mysql_real_escape_string(inputtext, tmppass);
  2356.  
  2357.             if(strlen(tmppass) < 3)
  2358.             {
  2359.                 format(string,sizeof(string),"{BECBFC}Welcome, {95A3FF}%s{BECBFC}!\n\nPlease enter your password below to login to your account.\n\n* {FFFFFF}Last login: %s *",pName);
  2360.                 ShowPlayerDialog(playerid, DIALOG_LOGIN ,DIALOG_STYLE_PASSWORD,"Login", string, "Login", "Exit");
  2361.             }
  2362.             OnPlayerRegister(playerid,tmppass);
  2363.         }
  2364.         else
  2365.         {
  2366.             ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_PASSWORD, "Character Gender", "Enter your password below:", "Register", "Cancel");
  2367.         }
  2368.     }
  2369.  
  2370.     if(dialogid == DIALOG_SEX)
  2371.     {
  2372.         if(!response)
  2373.         {
  2374.             ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_MSGBOX, "Character Gender", "Are you a male or a female?", "Male", "Female");
  2375.         }
  2376.         if(response)
  2377.         {
  2378.             PlayerInfo[playerid][pSex] = 1;
  2379.             Update(playerid, pSexu);
  2380.  
  2381.             RegistrationStep[playerid] = 1;
  2382.  
  2383.             ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Character Age", "OK, so you're a male.\n\nNow, how old are you?(7-50)", "Next", "Back");
  2384.  
  2385.             return 1;
  2386.         }
  2387.         else
  2388.         {
  2389.             PlayerInfo[playerid][pSex] = 2;
  2390.             Update(playerid, pSexu);
  2391.  
  2392.             RegistrationStep[playerid] = 1;
  2393.  
  2394.             ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Character Age", "OK, so you're a female.\n\nNow, how old are you?(7-50)", "Next", "Back");
  2395.  
  2396.             return 1;
  2397.         }
  2398.     }
  2399.  
  2400.     if(dialogid == DIALOG_AGE)
  2401.     {
  2402.         if(response)
  2403.         {
  2404.             new age = strval(inputtext);
  2405.             new string[256];
  2406.             if(age > 6 && age < 101)
  2407.             {
  2408.                 PlayerInfo[playerid][pAge] = age;
  2409.                 Update(playerid, pAgeu);
  2410.  
  2411.                 RegistrationStep[playerid] = 2;
  2412.  
  2413.                 format(string, sizeof(string), "OK, so you have %d years.\n\nPlease enter below you email adress:", age);
  2414.                 ShowPlayerDialog(playerid, DIALOG_EMAIL, DIALOG_STYLE_INPUT, "Email", string, "Next", "Back");
  2415.             }
  2416.             else return ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Character Age", "Now, what is your age?(7-100)", "Next", "Back");
  2417.         }
  2418.         if(!response)
  2419.         {
  2420.             ShowPlayerDialog(playerid, DIALOG_SEX, DIALOG_STYLE_MSGBOX, "Character Gender", "Are you a male or a female?", "Male", "Female");
  2421.         }
  2422.     }
  2423.  
  2424.     if(dialogid == DIALOG_EMAIL)
  2425.     {
  2426.         if(response)
  2427.         {
  2428.             new string[256];
  2429.             if(strlen(inputtext) < 4 || strlen(inputtext) > 151)
  2430.             {
  2431.                 SendClientMessage(playerid, COLOR_ERROR, "The name of the email can't pass 150 letters and can't be shorter than 5 letters!");
  2432.                 ShowPlayerDialog(playerid,702,DIALOG_STYLE_INPUT,"Email","Please enter below you email adress:","Next","");
  2433.                 return 1;
  2434.             }
  2435.             else
  2436.             {
  2437.                 strmid(PlayerInfo[playerid][pEmail], inputtext, 0, strlen(inputtext), 999);
  2438.                 Update(playerid, pEmailu);
  2439.                 format(string, sizeof(string), "OK, so you're email is %s.", inputtext);
  2440.                 ShowPlayerDialog(playerid, DIALOG_REGISTER_FINISH, DIALOG_STYLE_MSGBOX,"Email", string, "Next", "");
  2441.             }
  2442.         }
  2443.         if(!response)
  2444.         {
  2445.             ShowPlayerDialog(playerid, DIALOG_AGE, DIALOG_STYLE_INPUT, "Character Age", "Now, what is your age?(7-100)", "Next", "Back");
  2446.         }
  2447.     }
  2448.  
  2449.     if(dialogid == DIALOG_REGISTER_FINISH)
  2450.     {
  2451.         if(response)
  2452.         {
  2453.             RegistrationStep[playerid] = 0;
  2454.             TutorialTime[playerid] = 1;
  2455.         }
  2456.     }
  2457.     return 1;
  2458. }
  2459.  
  2460. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  2461. {
  2462.     return 1;
  2463. }
  2464.  
  2465. stock ShowStats(playerid, targetid)
  2466. {
  2467.     if(IsPlayerConnected(targetid))
  2468.     {
  2469.         new pName[MAX_PLAYER_NAME];
  2470.         GetPlayerName(targetid, pName, sizeof(pName));
  2471.         new string[256];
  2472.  
  2473.         new level = PlayerInfo[targetid][pLevel];
  2474.         new sex[8];
  2475.         if(PlayerInfo[targetid][pSex] == 1)
  2476.         {
  2477.             sex = "Male";
  2478.         }
  2479.         else if(PlayerInfo[targetid][pSex] == 2)
  2480.         {
  2481.             sex = "Female";
  2482.         }
  2483.         new age = PlayerInfo[targetid][pAge];
  2484.         new cash = GetPlayerCash(targetid);
  2485.         new account = PlayerInfo[targetid][pAccount];
  2486.         new phonenumber = PlayerInfo[targetid][pPhoneNumber];
  2487.         new premiumaccount[4];
  2488.         if(PlayerInfo[targetid][pPremiumAccount] == 1)
  2489.         {
  2490.             premiumaccount = "Yes";
  2491.         }
  2492.         else
  2493.         {
  2494.             premiumaccount = "No";
  2495.         }
  2496.         new factiontext[128];
  2497.         if(PlayerInfo[targetid][pMember] == 1 || PlayerInfo[targetid][pLeader] == 1)
  2498.         {
  2499.             factiontext = "Los Santos Police Department";
  2500.         }
  2501.         if(PlayerInfo[targetid][pMember] == 2 || PlayerInfo[targetid][pLeader] == 2)
  2502.         {
  2503.             factiontext = "Las Venturas Police Department";
  2504.         }
  2505.         if(PlayerInfo[targetid][pMember] == 3 || PlayerInfo[targetid][pLeader] == 3)
  2506.         {
  2507.             factiontext = "San Fierro Police Department";
  2508.         }
  2509.         else if(PlayerInfo[targetid][pMember] == 4 || PlayerInfo[targetid][pLeader] == 4)
  2510.         {
  2511.             factiontext = "Federal Bureau of Investigations";
  2512.         }
  2513.         else if(PlayerInfo[targetid][pMember] == 5 || PlayerInfo[targetid][pLeader] == 5)
  2514.         {
  2515.             factiontext = "National Guard";
  2516.         }
  2517.         new ranktext[128];
  2518.         if(PlayerInfo[targetid][pMember] == 1 || PlayerInfo[targetid][pLeader] == 1 || PlayerInfo[targetid][pMember] == 2 || PlayerInfo[targetid][pLeader] == 2 || PlayerInfo[targetid][pMember] == 3 || PlayerInfo[targetid][pLeader] == 3)// Los Santos Police Department Ranks || Las Venturas Police Department Ranks || San Fierro Police Department Ranks
  2519.         {
  2520.             if(PlayerInfo[targetid][pRank] == 1)
  2521.             {
  2522.                 ranktext = "Cadet";
  2523.             }
  2524.             else if(PlayerInfo[targetid][pRank] == 2)
  2525.             {
  2526.                 ranktext = "Officer";
  2527.             }
  2528.             else if(PlayerInfo[targetid][pRank] == 3)
  2529.             {
  2530.                 ranktext = "Sergent";
  2531.             }
  2532.             else if(PlayerInfo[targetid][pRank] == 4)
  2533.             {
  2534.                 ranktext = "Lieutenant";
  2535.             }
  2536.             else if(PlayerInfo[targetid][pRank] == 5)
  2537.             {
  2538.                 ranktext = "Captain";
  2539.             }
  2540.             else if(PlayerInfo[targetid][pRank] == 6)
  2541.             {
  2542.                 ranktext = "Chief";
  2543.             }
  2544.             else
  2545.             {
  2546.                 ranktext = "Cadet";
  2547.             }
  2548.         }
  2549.         else if(PlayerInfo[targetid][pMember] == 4 || PlayerInfo[targetid][pLeader] == 4)// FBI Ranks
  2550.         {
  2551.             if(PlayerInfo[targetid][pRank] == 1)
  2552.             {
  2553.                 ranktext = "Professional Staff";
  2554.             }
  2555.             else if(PlayerInfo[targetid][pRank] == 2)
  2556.             {
  2557.                 ranktext = "Special Agent Trainee";
  2558.             }
  2559.             else if(PlayerInfo[targetid][pRank] == 3)
  2560.             {
  2561.                 ranktext = "Special Agent";
  2562.             }
  2563.             else if(PlayerInfo[targetid][pRank] == 4)
  2564.             {
  2565.                 ranktext = "Special Agent in Charge";
  2566.             }
  2567.             else if(PlayerInfo[targetid][pRank] == 5)
  2568.             {
  2569.                 ranktext = "Assistant Director in Charge";
  2570.             }
  2571.             else if(PlayerInfo[targetid][pRank] == 6)
  2572.             {
  2573.                 ranktext = "Director";
  2574.             }
  2575.             else
  2576.             {
  2577.                 ranktext = "Professional Staff";
  2578.             }
  2579.         }
  2580.         else if(PlayerInfo[targetid][pMember] == 5 || PlayerInfo[targetid][pLeader] == 5)// National Guard Ranks
  2581.         {
  2582.             if(PlayerInfo[targetid][pRank] == 1)
  2583.             {
  2584.                 ranktext = "Private";
  2585.             }
  2586.             else if(PlayerInfo[targetid][pRank] == 2)
  2587.             {
  2588.                 ranktext = "Mayor";
  2589.             }
  2590.             else if(PlayerInfo[targetid][pRank] == 3)
  2591.             {
  2592.                 ranktext = "Sergent";
  2593.             }
  2594.             else if(PlayerInfo[targetid][pRank] == 4)
  2595.             {
  2596.                 ranktext = "Lieutenant";
  2597.             }
  2598.             else if(PlayerInfo[targetid][pRank] == 5)
  2599.             {
  2600.                 ranktext = "Captain";
  2601.             }
  2602.             else if(PlayerInfo[targetid][pRank] == 6)
  2603.             {
  2604.                 ranktext = "General";
  2605.             }
  2606.             else
  2607.             {
  2608.                 ranktext = "Private";
  2609.             }
  2610.         }
  2611.  
  2612.         SendClientMessage(playerid, COLOR_SERVER_GREEN,"_______________________________________");
  2613.         format(string, sizeof(string), "%s's Stats", pName);
  2614.         SendClientMessage(playerid, COLOR_WHITE, string);
  2615.         format(string, sizeof(string), "Level:[%d] Sex:[%s] Age:[%d] Cash:[$%s] Bank:[$%s] Phone:[%s]", level, sex, age, FormatNumber(cash), FormatNumber(account), PhoneFormat(phonenumber));
  2616.         SendClientMessage(playerid, COLOR_WHITE,string);
  2617.         format(string, sizeof(string), "Premium Account:[%s]", premiumaccount);
  2618.         SendClientMessage(playerid, COLOR_WHITE,string);
  2619.         format(string, sizeof(string), "Faction:[%s] Rank:[%s]", factiontext, ranktext);
  2620.         SendClientMessage(playerid, COLOR_WHITE,string);
  2621.         SendClientMessage(playerid, COLOR_SERVER_GREEN,"_______________________________________");
  2622.  
  2623.     }
  2624.     return 1;
  2625. }
  2626.  
  2627. public KickPublic(playerid)
  2628. {
  2629.     Kick(playerid);
  2630. }
  2631.  
  2632. public ProxDetector(Float:radi, playerid, string[], col1, col2, col3, col4, col5)
  2633. {
  2634.     if(IsPlayerConnected(playerid))
  2635.     {
  2636.         new Float:posx, Float:posy, Float:posz;
  2637.         new Float:oldposx, Float:oldposy, Float:oldposz;
  2638.         new Float:tempposx, Float:tempposy, Float:tempposz;
  2639.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  2640.         for(new i = 0; i < MAX_PLAYERS; i++)
  2641.         {
  2642.             if(IsPlayerConnected(i))
  2643.             {
  2644.                 //if(!BigEar[i])
  2645.                 //{
  2646.                 if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
  2647.                 {
  2648.                         GetPlayerPos(i, posx, posy, posz);
  2649.                         tempposx = (oldposx -posx);
  2650.                         tempposy = (oldposy -posy);
  2651.                         tempposz = (oldposz -posz);
  2652.                         if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  2653.                         {
  2654.                             SendClientMessage(i, col1, string);
  2655.                         }
  2656.                         else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  2657.                         {
  2658.                             SendClientMessage(i, col2, string);
  2659.                         }
  2660.                         else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  2661.                         {
  2662.                             SendClientMessage(i, col3, string);
  2663.                         }
  2664.                         else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  2665.                         {
  2666.                             SendClientMessage(i, col4, string);
  2667.                         }
  2668.                         else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  2669.                         {
  2670.                             SendClientMessage(i, col5, string);
  2671.                         }
  2672.                 }
  2673.                 else
  2674.                 {
  2675.                     SendClientMessage(i, col1, string);
  2676.                 }
  2677.             }
  2678.         }
  2679.     }
  2680.     return 0;
  2681. }
  2682.  
  2683. public ClockUpdate()
  2684. {
  2685.     new hour, minutes, seconds, day, month, year;
  2686.     new string[256];
  2687.     gettime(hour, minutes, seconds);
  2688.     getdate(year, month, day);
  2689.     format(string,256,"%02d:%02d", hour, minutes);
  2690.     TextDrawSetString(ClockTime, string);
  2691.     format(string,256,"%02d/%02d/%d", day, month, year);
  2692.     TextDrawSetString(ClockDate, string);
  2693. }
  2694.  
  2695. public MoneyTimer()
  2696. {
  2697.     new pName[MAX_PLAYER_NAME];
  2698.     for(new i=0; i<MAX_PLAYERS; i++)
  2699.     {
  2700.         if(IsPlayerConnected(i))
  2701.         {
  2702.             if(GetPlayerCash(i) != GetPlayerMoney(i))
  2703.             {
  2704.                 ResetMoneyBar(i);
  2705.                 UpdateMoneyBar(i, GetPlayerCash(i));
  2706.                 new hack = GetPlayerMoney(i) - GetPlayerCash(i);
  2707.                 GetPlayerName(i, pName, sizeof(pName));
  2708.                 printf("%s has picked up/attempted to spawn $%d.", pName, hack);
  2709.             }
  2710.         }
  2711.     }
  2712. }
  2713.  
  2714. public OtherTimers()
  2715. {
  2716.     for(new i = 0; i < MAX_PLAYERS; i ++)
  2717.     {
  2718.         if(TutorialTime[i]  >= 1)
  2719.         {
  2720.             TutorialTime[i] += 1;
  2721.             if(TutorialTime[i] == 3)
  2722.             {
  2723.                 SendClientMessage(i, COLOR_WHITE, "Edit Here");
  2724.             }
  2725.             else if(TutorialTime[i] == 5)
  2726.             {
  2727.                 SendClientMessage(i, COLOR_WHITE, "Edit Here");
  2728.  
  2729.                 TutorialTime[i] = 0; PlayerInfo[i][pTutorial] = 1;
  2730.                 Update(i, pTutorialu);
  2731.  
  2732.                 PlayerInfo[i][pLevel] = 1;
  2733.                 Update(i, pLevelu);
  2734.                 PlayerInfo[i][pRegistred] = 1;
  2735.                 Update(i, pRegistredu);
  2736.                 PlayerInfo[i][pAdmin] = 0;
  2737.                 Update(i, pAdminu);
  2738.  
  2739.                 new randomphonenumber = 1000000 + random(9999999);
  2740.                 PlayerInfo[i][pPhoneNumber] = randomphonenumber;
  2741.                 Update(i, pPhoneNumberu);
  2742.  
  2743.                 PlayerInfo[i][pInterior] = 0;
  2744.  
  2745.                 SetSpawnInfo(i, 0, 0, 1742.9515, -1862.3721, 13.5764, 359.5591, 0, 0, 0, 0, 0, 0);
  2746.                 SpawnPlayer(i);
  2747.  
  2748.                 new pName[MAX_PLAYER_NAME];
  2749.                 GetPlayerName(i, pName, sizeof(pName));
  2750.  
  2751.                 new query[128];
  2752.                 mysql_format(handle, query, sizeof(query), "SELECT * FROM `players` WHERE `username`='%e'", pName);
  2753.                 mysql_tquery(handle, query, "WhenPlayerLogin", "i", i);
  2754.  
  2755.             }
  2756.         }
  2757.  
  2758.         if(ReportTime[i] > 0)
  2759.         {
  2760.             ReportTime[i]--;
  2761.         }
  2762.     }
  2763. }
  2764.  
  2765. public ReportTimer(playerid)
  2766. {
  2767.     ReportTime[playerid] = 0;
  2768. }
  2769.  
  2770. public AdminsBroadCast(color, string[])
  2771. {
  2772.     for(new i = 0; i < MAX_PLAYERS; i++)
  2773.     {
  2774.         if(IsPlayerConnected(i))
  2775.         {
  2776.             if(PlayerInfo[i][pAdmin] >= 1)
  2777.             {
  2778.                 SendClientMessage(i, color, string);
  2779.             }
  2780.         }
  2781.     }
  2782.     return 1;
  2783. }
  2784.  
  2785. public HelpersBroadCast(color, string[])
  2786. {
  2787.     for(new i = 0; i < MAX_PLAYERS; i++)
  2788.     {
  2789.         if(IsPlayerConnected(i))
  2790.         {
  2791.             if(PlayerInfo[i][pHelper] >= 1)
  2792.             {
  2793.                 SendClientMessage(i, color, string);
  2794.             }
  2795.         }
  2796.     }
  2797.     return 1;
  2798. }
  2799.  
  2800. public FactionsBroadCast(faction, color, string[])
  2801. {
  2802.     for(new i = 0; i < MAX_PLAYERS; i++)
  2803.     {
  2804.         if(IsPlayerConnected(i))
  2805.         {
  2806.             if(PlayerInfo[i][pMember] == faction || PlayerInfo[i][pLeader] == faction)
  2807.             {
  2808.                 SendClientMessage(i, color, string);
  2809.             }
  2810.         }
  2811.     }
  2812. }
  2813.  
  2814. public RadioBroadCast(faction, color, string[])
  2815. {
  2816.     for(new i = 0; i < MAX_PLAYERS; i++)
  2817.     {
  2818.         if(IsPlayerConnected(i))
  2819.         {
  2820.             if(PlayerInfo[i][pMember] == faction || PlayerInfo[i][pLeader] == faction)
  2821.             {
  2822.                 SendClientMessage(i, color, string);
  2823.             }
  2824.         }
  2825.     }
  2826. }
  2827.  
  2828. public SetPlayerFactionColor(playerid)
  2829. {
  2830.     if(IsPlayerConnected(playerid))
  2831.     {
  2832.         SetPlayerColor(playerid, COLOR_WHITE);
  2833.         if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pLeader] == 1)
  2834.         SetPlayerColor(playerid,COLOR_LSPD);
  2835.  
  2836.         if (PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pLeader] == 2)
  2837.         SetPlayerColor(playerid,COLOR_LVPD);
  2838.  
  2839.         if (PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pLeader] == 3)
  2840.         SetPlayerColor(playerid,COLOR_SFPD);
  2841.  
  2842.         if (PlayerInfo[playerid][pMember] == 4 || PlayerInfo[playerid][pLeader] == 4)
  2843.         SetPlayerColor(playerid,COLOR_FBI);
  2844.  
  2845.         if (PlayerInfo[playerid][pMember] == 5 || PlayerInfo[playerid][pLeader] == 5)
  2846.         SetPlayerColor(playerid,COLOR_NG);
  2847.        
  2848.         if (PlayerInfo[playerid][pMember] == 6 || PlayerInfo[playerid][pLeader] == 6)
  2849.         SetPlayerColor(playerid,COLOR_PARAMEDICS);
  2850.     }
  2851.  }
  2852.  
  2853. stock KickWithMessage(playerid, color, message[])
  2854. {
  2855.     SendClientMessage(playerid, color, message);
  2856.     SetTimerEx("KickPublic", 1000, 0, "d", playerid);
  2857. }
  2858.  
  2859. stock GivePlayerCash(playerid, money)
  2860. {
  2861.     Cash[playerid] += money;
  2862.     ResetMoneyBar(playerid);
  2863.     UpdateMoneyBar(playerid, Cash[playerid]);
  2864.     PlayerInfo[playerid][pCash] = Cash[playerid];
  2865.     Update(playerid, pCashu);
  2866.  
  2867.     return Cash[playerid];
  2868. }
  2869.  
  2870. stock SetPlayerCash(playerid, money)
  2871. {
  2872.     Cash[playerid] = money;
  2873.     ResetMoneyBar(playerid);
  2874.     UpdateMoneyBar(playerid, Cash[playerid]);
  2875.     PlayerInfo[playerid][pCash] = Cash[playerid];
  2876.     Update(playerid, pCashu);
  2877.  
  2878.     return Cash[playerid];
  2879. }
  2880.  
  2881. stock ResetPlayerCash(playerid)
  2882. {
  2883.     Cash[playerid] = 0;
  2884.     ResetMoneyBar(playerid);
  2885.     UpdateMoneyBar(playerid, Cash[playerid]);
  2886.     PlayerInfo[playerid][pCash] = Cash[playerid];
  2887.     Update(playerid, pCashx);
  2888.  
  2889.     return Cash[playerid];
  2890. }
  2891.  
  2892. stock GetPlayerCash(playerid)
  2893. {
  2894.     return Cash[playerid];
  2895. }
Add Comment
Please, Sign In to add comment