Guest User

Roleplay Base Script [0.3z] - JUSTINAN

a guest
Aug 26th, 2014
2,046
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pawn 61.39 KB | None | 0 0
  1. /*
  2. __________________________________________________________________________
  3.  
  4.  _____ _____  ______ _____ _____ _______ _____
  5.   / ____|  __ \|  ____|  __ \_   _|__   __/ ____|
  6.  | |    | |__) | |__  | |  | || |    | | | (___
  7.  | |    |  _  /|  __| | |  | || |    | |  \___ \
  8.  | |____| | \ \| |____| |__| || |_   | |  ____) |
  9.   \_____|_|  \_\______|_____/_____|  |_| |_____/
  10.  
  11. CREDITS to.....
  12. -Y_Less for YINI include, sscanf include too.
  13. -Dracoblue for hashing the passwords.
  14. -Kush for making a tutorial on a login and register system.
  15. -Zeex for the ZCMD command processor.
  16.  
  17.  
  18. |_____You may delete all this credits, this script is all yours!____|
  19.  
  20. NOTE: If I forgot any credits, I apologize.
  21.  
  22. _____________________________________________________________________________
  23.  
  24. */
  25.  
  26. #include <a_samp>
  27. #include <sscanf2>
  28. #include <YSI\y_ini>
  29. #include <zcmd>
  30. #include <foreach>
  31.  
  32. #define PATH "/Users/%s.ini"
  33. #define NOTADMIN "You are not authorized to use this command !"
  34.  
  35. #define COL_WHITE "{FFFFFF}"
  36. #define COL_YELLOW "{F3FF02}"
  37. #define COL_RED "{F81414}"
  38.  
  39. #define COLOR_BITEM         0xE1B0B0FF
  40. #define COLOR_GRAD1         0xB4B5B7FF
  41. #define COLOR_GRAD2         0xBFC0C2FF
  42. #define COLOR_GRAD3         0xCBCCCEFF
  43. #define COLOR_GRAD4         0xD8D8D8FF
  44. #define COLOR_GRAD5         0xE3E3E3FF
  45. #define COLOR_GRAD6         0xF0F0F0FF
  46. #define COLOR_GREY          0xAFAFAFAA
  47. #define COLOR_GREEN         0x33AA33AA
  48. #define COLOR_RED           0xAA3333AA
  49. #define COLOR_BLACK         0x000001FF
  50. #define COLOR_BLUE          0x007BD0FF
  51. #define COLOR_LIGHTORANGE   0xFFA100FF
  52. #define COLOR_FLASH         0xFF000080
  53. #define COLOR_LIGHTRED      0xFF6347AA
  54. #define COLOR_LIGHTBLUE     0x33CCFFAA
  55. #define COLOR_LIGHTGREEN    0x9ACD32AA
  56. #define COLOR_YELLOW        0xFFFF00AA
  57. #define COLOR_LIGHTYELLOW   0xFFFF91FF
  58. #define COLOR_YELLOW2       0xF5DEB3AA
  59. #define COLOR_WHITE         0xFFFFFFAA
  60. #define COLOR_FADE1         0xE6E6E6E6
  61. #define COLOR_FADE2         0xC8C8C8C8
  62. #define COLOR_FADE3         0xAAAAAAAA
  63. #define COLOR_FADE4         0x8C8C8C8C
  64. #define COLOR_FADE5         0x6E6E6E6E
  65. #define COLOR_PURPLE        0xC2A2DAAA
  66. #define COLOR_DBLUE         0x2641FEAA
  67. #define COLOR_DOC           0xFF8282AA
  68. #define COLOR_DCHAT         0xF0CC00FF
  69. #define COLOR_NEWS          0xFFA500AA
  70. #define COLOR_OOC           0xE0FFFFAA
  71. #define TEAM_BLUE_COLOR     0x8D8DFF00
  72. #define TEAM_GROVE_COLOR    0x00AA00FF
  73. #define TEAM_AZTECAS_COLOR  0x01FCFFC8
  74. #define NEWBIE_COLOR        0x7DAEFFFF
  75. #define SAMP_COLOR          0xAAC4E5FF
  76.  
  77. //Fowards
  78. forward split(const strsrc[], strdest[][], delimiter);
  79. forward ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5);
  80. forward ProxDetectorS(Float:radi, playerid, targetid);
  81. forward LoadUser_data(playerid,name[],value[]);
  82. forward SaveAccountInfo(playerid);
  83. forward OOCOff(color,const string[]);
  84. forward FixHour(hour);
  85. forward IsValidName(playerid);
  86.  
  87. //Forwarded Logs
  88. forward PayLog(string[]);
  89. forward BanLog(string[]);
  90. forward KickLog(string[]);
  91. //-------------------------------------
  92. //Variables
  93. new gPlayerLogged[MAX_PLAYERS char];
  94. new gAdminAuthorized[MAX_PLAYERS];
  95. new gOOC[MAX_PLAYERS];
  96. new HidePM[MAX_PLAYERS];
  97. new PayWarn[MAX_PLAYERS][MAX_PLAYERS];
  98.  
  99. new noooc = 0;
  100. new realchat = 1;
  101. new timeshift = -1;
  102. new shifthour;
  103. //-----------------------------
  104.  
  105. enum pInfo
  106. {
  107.     pPass,
  108.     pCash,
  109.     pSkin,
  110.     pLevel,
  111.     pInt,
  112.     pVW,
  113.     pAdmin,
  114.     pSecKey,
  115.     pKills,
  116.     pDeaths,
  117.     Float:pFacingAngle,
  118.     Float:pHealth,
  119.     Float:pArmour,
  120.     Float:pLastX,
  121.     Float:pLastY,
  122.     Float:pLastZ
  123. }
  124. new PlayerInfo[MAX_PLAYERS][pInfo];
  125.  
  126. //Fowarded Public Functions
  127. public PayLog(string[])
  128. {
  129.     new entry[256];
  130.     format(entry, sizeof(entry), "%s\n",string);
  131.     new File:hFile;
  132.     hFile = fopen("pay.log", io_append);
  133.     fwrite(hFile, entry);
  134.     fclose(hFile);
  135. }
  136.  
  137. public KickLog(string[])
  138. {
  139.     new entry[256];
  140.     format(entry, sizeof(entry), "%s\n",string);
  141.     new File:hFile;
  142.     hFile = fopen("kick.log", io_append);
  143.     fwrite(hFile, entry);
  144.     fclose(hFile);
  145. }
  146.  
  147. public BanLog(string[])
  148. {
  149.     new entry[256];
  150.     format(entry, sizeof(entry), "%s\n",string);
  151.     new File:hFile;
  152.     hFile = fopen("ban.log", io_append);
  153.     fwrite(hFile, entry);
  154.     fclose(hFile);
  155. }
  156.  
  157. public IsValidName(playerid)
  158. {
  159.     new pname[MAX_PLAYER_NAME],underline=0;
  160.     GetPlayerName(playerid, pname, sizeof(pname));
  161.     if(strfind(pname,"[",true) != (-1)) return 0;
  162.     else if(strfind(pname,".",true) != (-1)) return 0;
  163.     else if(strfind(pname,"]",true) != (-1)) return 0;
  164.     else if(strfind(pname,"$",true) != (-1)) return 0;
  165.     else if(strfind(pname,"(",true) != (-1)) return 0;
  166.     else if(strfind(pname,")",true) != (-1)) return 0;
  167.     else if(strfind(pname,"=",true) != (-1)) return 0;
  168.     else if(strfind(pname,"@",true) != (-1)) return 0;
  169.     else if(strfind(pname,"1",true) != (-1)) return 0;
  170.     else if(strfind(pname,"2",true) != (-1)) return 0;
  171.     else if(strfind(pname,"3",true) != (-1)) return 0;
  172.     else if(strfind(pname,"4",true) != (-1)) return 0;
  173.     else if(strfind(pname,"5",true) != (-1)) return 0;
  174.     else if(strfind(pname,"6",true) != (-1)) return 0;
  175.     else if(strfind(pname,"7",true) != (-1)) return 0;
  176.     else if(strfind(pname,"8",true) != (-1)) return 0;
  177.     else if(strfind(pname,"9",true) != (-1)) return 0;
  178.     new maxname = strlen(pname);
  179.     for(new i=0; i<maxname; i++) { if(pname[i] == '_') underline ++; }
  180.     if(underline != 1) return 0;
  181.     pname[0] = toupper(pname[0]);
  182.     for(new x=1; x<maxname; x++)
  183.     {
  184.         if(pname[x] == '_') pname[x+1] = toupper(pname[x+1]);
  185.          else if(pname[x] != '_' && pname[x-1] != '_') pname[x] = tolower(pname[x]);
  186.     }
  187.     return 1;
  188. }
  189.  
  190. public ProxDetectorS(Float:radi, playerid, targetid)
  191. {
  192.     if(IsPlayerConnected(playerid)&&IsPlayerConnected(targetid))
  193.     {
  194.         new Float:posx, Float:posy, Float:posz;
  195.         new Float:oldposx, Float:oldposy, Float:oldposz;
  196.         new Float:tempposx, Float:tempposy, Float:tempposz;
  197.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  198.         GetPlayerPos(targetid, posx, posy, posz);
  199.         tempposx = (oldposx -posx);
  200.         tempposy = (oldposy -posy);
  201.         tempposz = (oldposz -posz);
  202.         if(((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  203.         {
  204.             return 1;
  205.         }
  206.     }
  207.     return 0;
  208. }
  209.  
  210. public FixHour(hour)
  211. {
  212.     hour = timeshift+hour;
  213.     if(hour < 0) { hour = hour+24; }
  214.     else if(hour > 23) { hour = hour-24; }
  215.     shifthour = hour;
  216.     return 1;
  217. }
  218.  
  219.  
  220. public OOCOff(color,const string[])
  221. {
  222.     for(new i = 0; i < MAX_PLAYERS; i++)
  223.     {
  224.         if(IsPlayerConnected(i))
  225.         {
  226.             if(!gOOC[i])
  227.             {
  228.                 SendClientMessage(i, color, string);
  229.             }
  230.         }
  231.     }
  232. }
  233.  
  234. public ProxDetector(Float:radi, playerid, string[],col1,col2,col3,col4,col5)
  235. {
  236.     if(IsPlayerConnected(playerid))
  237.     {
  238.         new Float:posx, Float:posy, Float:posz;
  239.         new Float:oldposx, Float:oldposy, Float:oldposz;
  240.         new Float:tempposx, Float:tempposy, Float:tempposz;
  241.         GetPlayerPos(playerid, oldposx, oldposy, oldposz);
  242.         for(new i = 0; i < MAX_PLAYERS; i++)
  243.         {
  244.             if(IsPlayerConnected(i))
  245.             {
  246.                 GetPlayerPos(i, posx, posy, posz);
  247.                 tempposx = (oldposx -posx);
  248.                 tempposy = (oldposy -posy);
  249.                 tempposz = (oldposz -posz);
  250.                 new playerworld, player2world;
  251.                 playerworld = GetPlayerVirtualWorld(playerid);
  252.                 player2world = GetPlayerVirtualWorld(i);
  253.                 if(playerworld == player2world)
  254.                 {
  255.                     if (((tempposx < radi/16) && (tempposx > -radi/16)) && ((tempposy < radi/16) && (tempposy > -radi/16)) && ((tempposz < radi/16) && (tempposz > -radi/16)))
  256.                     {
  257.                         SendClientMessage(i, col1, string);
  258.                     }
  259.                     else if (((tempposx < radi/8) && (tempposx > -radi/8)) && ((tempposy < radi/8) && (tempposy > -radi/8)) && ((tempposz < radi/8) && (tempposz > -radi/8)))
  260.                     {
  261.                         SendClientMessage(i, col2, string);
  262.                     }
  263.                     else if (((tempposx < radi/4) && (tempposx > -radi/4)) && ((tempposy < radi/4) && (tempposy > -radi/4)) && ((tempposz < radi/4) && (tempposz > -radi/4)))
  264.                     {
  265.                         SendClientMessage(i, col3, string);
  266.                     }
  267.                     else if (((tempposx < radi/2) && (tempposx > -radi/2)) && ((tempposy < radi/2) && (tempposy > -radi/2)) && ((tempposz < radi/2) && (tempposz > -radi/2)))
  268.                     {
  269.                         SendClientMessage(i, col4, string);
  270.                     }
  271.                     else if (((tempposx < radi) && (tempposx > -radi)) && ((tempposy < radi) && (tempposy > -radi)) && ((tempposz < radi) && (tempposz > -radi)))
  272.                     {
  273.                         SendClientMessage(i, col5, string);
  274.                     }
  275.                 }
  276.                 else
  277.                 {
  278.                     SendClientMessage(i, col1, string);
  279.                 }
  280.             }
  281.         }
  282.     }
  283.     return 1;
  284. }
  285.  
  286. public SaveAccountInfo(playerid)
  287. {
  288.     new cash = GetPlayerMoney(playerid);
  289.     new skin = GetPlayerSkin(playerid);
  290.     new level = GetPlayerScore(playerid);
  291.     new int = GetPlayerInterior(playerid);
  292.     new vw = GetPlayerVirtualWorld(playerid);
  293.     new Float:X, Float:Y, Float:Z;
  294.     new Float:facingangle;
  295.     new Float:health, Float:armour;
  296.     GetPlayerHealth(playerid, health);
  297.     GetPlayerArmour(playerid, armour);
  298.     GetPlayerFacingAngle(playerid, facingangle);
  299.     GetPlayerPos(playerid, X, Y, Z);
  300.     new INI:File = INI_Open(UserPath(playerid));
  301.     INI_SetTag(File,"data");
  302.     INI_WriteInt(File,"Cash",cash);
  303.     INI_WriteInt(File,"Skin",skin);
  304.     INI_WriteInt(File,"Level",level);
  305.     INI_WriteInt(File,"Int",int);
  306.     INI_WriteInt(File,"VW",vw);
  307.     INI_WriteInt(File,"Admin",PlayerInfo[playerid][pAdmin]);
  308.     INI_WriteInt(File,"SecKey",PlayerInfo[playerid][pSecKey]);
  309.     INI_WriteInt(File,"Kills",PlayerInfo[playerid][pKills]);
  310.     INI_WriteInt(File,"Deaths",PlayerInfo[playerid][pDeaths]);
  311.     INI_WriteFloat(File, "FacingAngle", facingangle);
  312.     INI_WriteFloat(File, "Health", health);
  313.     INI_WriteFloat(File, "Armour", armour);
  314.     INI_WriteFloat(File, "LastX", X);
  315.     INI_WriteFloat(File, "LastY", Y);
  316.     INI_WriteFloat(File, "LastZ", Z);
  317.     INI_Close(File);
  318.     return 1;
  319. }
  320.  
  321. public LoadUser_data(playerid,name[],value[])
  322. {
  323.     INI_Int("Password",PlayerInfo[playerid][pPass]);
  324.     INI_Int("Cash",PlayerInfo[playerid][pCash]);
  325.     INI_Int("Skin",PlayerInfo[playerid][pSkin]);
  326.     INI_Int("Level",PlayerInfo[playerid][pLevel]);
  327.     INI_Int("Admin",PlayerInfo[playerid][pAdmin]);
  328.     INI_Int("SecKey",PlayerInfo[playerid][pSecKey]);
  329.     INI_Int("Kills",PlayerInfo[playerid][pKills]);
  330.     INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);
  331.     INI_Float("FacingAngle",PlayerInfo[playerid][pFacingAngle]);
  332.     INI_Float("Health",PlayerInfo[playerid][pHealth]);
  333.     INI_Float("Armour",PlayerInfo[playerid][pArmour]);
  334.     INI_Float("LastX", PlayerInfo[playerid][pLastX]);
  335.     INI_Float("LastY", PlayerInfo[playerid][pLastY]);
  336.     INI_Float("LastZ", PlayerInfo[playerid][pLastZ]);
  337.     return 1;
  338. }
  339.  
  340. public split(const strsrc[], strdest[][], delimiter)
  341. {
  342.     new i, li;
  343.     new aNum;
  344.     new len;
  345.     while(i <= strlen(strsrc)){
  346.         if(strsrc[i]==delimiter || i==strlen(strsrc)){
  347.             len = strmid(strdest[aNum], strsrc, li, i, 128);
  348.             strdest[aNum][len] = 0;
  349.             li = i+1;
  350.             aNum++;
  351.         }
  352.         i++;
  353.     }
  354.     return 1;
  355. }
  356.  
  357. //STOCKS
  358. stock ABroadCast(color,string[],level)
  359. {
  360.     foreach(Player, i)
  361.     {
  362.         if (PlayerInfo[i][pAdmin] >= level)
  363.         {
  364.             SendClientMessage(i, color, string);
  365.             printf("%s", string);
  366.         }
  367.     }
  368.     return 1;
  369. }
  370.  
  371.  
  372. stock GetPlayerFirstName(playerid)
  373. {
  374.     new namestring[2][MAX_PLAYER_NAME];
  375.     new name[MAX_PLAYER_NAME];
  376.     GetPlayerName(playerid,name,MAX_PLAYER_NAME);
  377.     split(name, namestring, '_');
  378.     return namestring[0];
  379. }
  380.  
  381. stock UserPath(playerid)
  382. {
  383.     new string[128],playername[MAX_PLAYER_NAME];
  384.     GetPlayerName(playerid,playername,sizeof(playername));
  385.     format(string,sizeof(string),PATH,playername);
  386.     return string;
  387. }
  388.  
  389. stock udb_hash(buf[]) {
  390.     new length=strlen(buf);
  391.     new s1 = 1;
  392.     new s2 = 0;
  393.     new n;
  394.     for (n=0; n<length; n++)
  395.     {
  396.        s1 = (s1 + buf[n]) % 65521;
  397.        s2 = (s2 + s1)     % 65521;
  398.     }
  399.     return (s2 << 16) + s1;
  400. }
  401.  
  402. stock strreplace(string[], find, replace)
  403. {
  404.     for(new i=0; string[i]; i++)
  405.     {
  406.         if(string[i] == find)
  407.         {
  408.             string[i] = replace;
  409.         }
  410.     }
  411. }
  412.  
  413. stock GetName(playerid)
  414. {
  415.     new
  416.         name[24];
  417.     GetPlayerName(playerid, name, sizeof(name));
  418.     strreplace(name, '_', ' ');
  419.     return name;
  420. }
  421. //--------------------------------------------------
  422.  
  423. main()
  424. {
  425.     print("\n----------------------------------");
  426.     print("* CHANGEME load sucessfully....");
  427.     print("----------------------------------\n");
  428. }
  429.  
  430. public OnGameModeInit()
  431. {
  432.     SetGameModeText("CHANGEME");
  433.     SetNameTagDrawDistance(30.0);
  434.     AllowInteriorWeapons(1);
  435.     UsePlayerPedAnims();
  436.     ShowPlayerMarkers(0);
  437.     EnableStuntBonusForAll(0);
  438.     DisableInteriorEnterExits();
  439.     /*
  440.     DO NOT DELETE THIS ADDPLAYERCLASS or else it will cause problems to the server.
  441.     When you die, your screen will flash repeadetly and it'll say do not leave the world boundries or something..
  442.     ... w/e and you'll have to relog every single time. SO DO NOT DELETE.
  443.     You can also remove this warning if you want and will remember not to delete it.
  444.     */
  445.     AddPlayerClass(299, 0.0, 0.0, 0.0, 90.0, 0, 0, 0, 0, 0, 0);
  446.    
  447.     //VEHICLES
  448.     //LSPD
  449.     AddStaticVehicleEx(523,1585.2291,-1676.4011,5.4624,270.0000,-1,-1,900); //police bike
  450.     AddStaticVehicleEx(523,1585.2291,-1679.0729,5.4607,270.0000,-1,-1,900); //police bike
  451.     AddStaticVehicleEx(596,1583.3301,-1710.1624,5.6129,0,-1,-1,900); //police lspd car
  452.     AddStaticVehicleEx(598,1587.4896,-1710.1624,5.6129,0,-1,-1,900); //police lvpd car
  453.     AddStaticVehicleEx(427,1558.7682,-1710.4094,6.0225,359.5701,-1,-1,900); //police enforcer
  454.     AddStaticVehicleEx(596,1578.5399,-1710.1624,5.6129,0,-1,-1,900); //police lspd car
  455.     AddStaticVehicleEx(596,1574.4989,-1710.1624,5.6129,0,-1,-1,900); //police lspd car
  456.     AddStaticVehicleEx(596,1570.3170,-1710.1624,5.6129,0,-1,-1,900); //police lspd car
  457.     AddStaticVehicleEx(596,1535.7517,-1678.2754,15.0000,0,-1,-1,900); //police lspd car
  458.     AddStaticVehicleEx(497,1549.5,-1644.1257,33.0,90.0,0,1,900); // Roof Chopper
  459.     AddStaticVehicleEx(497,1549.5,-1707.3848,33.0,90.0,0,1,900); // Roof Chopper
  460.     AddStaticVehicleEx(601,1564.4753,-1711.6448,5.6510,5.6801,-1,-1,900); //swat tank
  461.     AddStaticVehicleEx(528,1558.0299,-1694.0360,5.9432,180,-1,-1,900); //swat vehicle
  462.     AddStaticVehicleEx(528,1561.2257,-1694.0164,5.9347,180,-1,-1,900); //swat vehicle 02
  463.     AddStaticVehicleEx(598,1591.4315,-1710.1624,5.6255,0,-1,-1,900); //police lvpd car
  464.     AddStaticVehicleEx(596,1601.8004,-1704.2368,5.6111,90,-1,-1,900); //police lspd car
  465.     AddStaticVehicleEx(596,1601.8004,-1700.1127,5.6111,90,-1,-1,900); //police lspd car
  466.     AddStaticVehicleEx(596,1601.8004,-1696.0378,5.6111,90,-1,-1,900); //police lspd car
  467.     AddStaticVehicleEx(596,1601.8004,-1691.9602,5.6111,90,-1,-1,900); //police lspd car
  468.     AddStaticVehicleEx(596, 1535.7517, -1668.5831, 13.1053, 360.0000, 0, 1, 900); // police lspd car
  469.     AddStaticVehicleEx(599,1585.3041,-1671.7306,6.1209,269.1276,0,1,900); //police rancher car
  470.     AddStaticVehicleEx(599,1585.5951,-1667.6407,6.0218,270.1369,0,1,900); //police rancher car
  471.     AddStaticVehicleEx(598,1601.8846,-1683.9987,5.6107,89.8121,0,1,900); //police lvpd car
  472.     AddStaticVehicleEx(598,1602.0452,-1687.9415,5.6112,90.9819,0,1,900); //police lvpd car
  473.     AddStaticVehicleEx(523,1600.2445,-1711.6592,5.4535,44.0296,0,1,900); //police bike
  474.     AddStaticVehicleEx(523,1602.6547,-1709.4182,5.4535,46.7312,0,1,900); //police bike
  475.     AddStaticVehicleEx(598,1595.4485,-1710.2502,5.6096,359.5797,0,1,900); //police lvpd car
  476.     //SPAWN CARS
  477.     AddStaticVehicleEx(579,883.5909,-1658.0751,13.4765,180.1207,0,0,900); // Huntley
  478.     AddStaticVehicleEx(421,870.3824,-1678.7533,13.4294,179.4584,1,1,900); // Washington
  479.     //HOSPITAL
  480.     AddStaticVehicleEx(563, 1162.5315, -1373.2607, 32.3312, 270.1107, 3, 1, 900); // Raindance 1
  481.     AddStaticVehicleEx(563, 1163.3928, -1357.1760, 32.3656, 269.4890, 3, 1, 900); //Raindance 2
  482.     //AIRPORT
  483.     AddStaticVehicleEx(519,1889.6531,-2629.1267,14.4657,0,-1,-1,900); // Shamal 1
  484.     AddStaticVehicleEx(519,1823.1190,-2629.1267,14.4657,0,-1,-1,900); // Shamal 2
  485.     AddStaticVehicleEx(519,1754.5325,-2629.1267,14.4657,0,-1,-1,900); // Shamal 3
  486.     AddStaticVehicleEx(487,1964.2646,-2629.1267,13.7619,0,-1,-1,900); // Heli 1
  487.     AddStaticVehicleEx(487,1944.7985,-2629.1267,13.7354,0,-1,-1,900); // Heli 2
  488.     AddStaticVehicleEx(417,1765.6274,-2285.0801,26.8743,0,-1,-1,900); // Levi 1
  489.     AddStaticVehicleEx(593,1616.7531,-2627.9131,14.0094,0,-1,-1,900); // Dodo 1
  490.     AddStaticVehicleEx(593,1681.9587,-2627.9131,14.0094,0,-1,-1,900); // Dodo 2
  491.     //BOATS
  492.     AddStaticVehicleEx(430,2473.2754,-2716.4000,0,90,-1,-1,900); // LSPD 1
  493.     AddStaticVehicleEx(430,2446.4270,-2716.4000,0,90,-1,-1,900); // LSPD 2
  494.     //BIKES
  495.     AddStaticVehicleEx(481,1909.3695,-1416.4291,16.0000,90.0000,26,1,900); // Skatepark 1
  496.     AddStaticVehicleEx(481,1927.2667,-1436.1995,16.0000,90.0000,26,1,900); // Skatepark 2
  497.     //BOATS
  498.     AddStaticVehicleEx(484,719.9970,-1696.9248,0.1500,180.0000,1,1,900); // Boat 1
  499.     AddStaticVehicleEx(453,719.9970,-1626.4930,0.1500,180.0000,1,1,900); // Boat 2
  500.     AddStaticVehicleEx(453,719.9970,-1638.4017,0.1500,180.0000,1,1,900); // Boat 3
  501.     //STRANDEDCARS
  502.     AddStaticVehicleEx(480,2493.5391,1239.4542,10.5939,0.1534,1,1,900); // Comet 1
  503.     AddStaticVehicleEx(480,-1576.0280,-2728.5027,48.2507,144.9941,1,1,900); // Comet 2
  504.     AddStaticVehicleEx(480,2441.3447,2017.1165,10.5276,270.8628,1,1,900); // Comet 3
  505.     AddStaticVehicleEx(480,1117.5936,2069.2937,10.5276,181.1499,1,1,900); // Comet 4
  506.     AddStaticVehicleEx(480,920.9744,2012.0786,10.8600,269.9051,1,1,900); // Comet 5
  507.     //SPECIAL
  508.     AddStaticVehicleEx(454,729.2374,-1496.4160,0.2745,179.2701,-1,-1,900); // boat1
  509.     AddStaticVehicleEx(512,-1436.8271,-946.4916,201.3638,270.5414,-1,-1,900); // cropduster
  510.     AddStaticVehicleEx(532,-346.0279,-1067.7395,60.5232,357.7303,-1,-1,900); // combineharvester
  511.     AddStaticVehicleEx(442,930.0162,-1064.6062,24.1230,179.2080,0,0,900); // romero
  512.     AddStaticVehicleEx(525, 2282.9084, -2351.3218, 13.4, 225.36, 1, 79, 900); // TowTruck Pos
  513.     AddStaticVehicleEx(525, 2289.9924, -2344.1809, 13.4, 225.36, 1, 79, 900); // TowTruck Pos
  514.     AddStaticVehicleEx(525, 2297.6077, -2336.4568, 13.4, 225.36, 1, 79, 900); // TowTruck Pos
  515.     AddStaticVehicleEx(572,743.7960,-594.3464,16.9159,269.2212,3,3,900); // mower
  516.     AddStaticVehicleEx(428,1385.0476,-1009.4760,27.3589,0.1330,-1,-1,900); // bankvan
  517.     AddStaticVehicleEx(508,-89.3810,-1604.8574,2.9916,121.6778,-1,-1,900); // camper
  518.     AddStaticVehicleEx(469,1291.3120,-789.5865,96.4699,359.3932,-1,-1,900); // heli
  519.     AddStaticVehicleEx(495,452.7136,-1812.0624,5.8968,181.9573,-1,-1,900); // sandking1
  520.     AddStaticVehicleEx(495,447.6973,-1812.1508,5.8961,181.4140,-1,-1,900); // sandking2
  521.     AddStaticVehicleEx(553,2112.0979,-2422.7620,14.8796,177.6028,73,118,900); // nevada
  522.     AddStaticVehicleEx(530,1083.8391,-1230.6941,15.5836,0.0,-1,-1,900); // forklift
  523.     AddStaticVehicleEx(446,2106.2417,-94.8254,-0.3685,125.0311,-1,-1,900); // speedboat
  524.     AddStaticVehicleEx(577,1585.6345,1188.1622,10.6200,180.0000,1,1,900); // lv plane
  525.     AddStaticVehicleEx(470,1544.1649,16.5959,24.1309,99.8654,-1,-1,900); // partiot
  526.     AddStaticVehicleEx(478,1535.5079,25.7885,24.1359,193.4562,-1,-1,900); // walton
  527.     AddStaticVehicleEx(489,1547.9408,-20.5773,21.5223,270.9849,0,0,900); // rancher 1
  528.     AddStaticVehicleEx(489,1520.1488,5.2112,24.1746,281.2211,0,0,900); // rancher 2
  529.     //FBI
  530.     AddStaticVehicleEx(490,1759.6000,-1680.1136,16.0000,270.0000,0,0,900); // Rancher 1
  531.     AddStaticVehicleEx(490,1759.6000,-1675.2715,16.0000,270.0000,0,0,900); // Rancher 2
  532.     AddStaticVehicleEx(482,1759.6000,-1667.3435,16.0000,270.0000,0,0,900); // Burrito 1
  533.     AddStaticVehicleEx(482,1759.6000,-1661.9944,16.0000,270.0000,0,0,900); // Burrito 2
  534.     AddStaticVehicleEx(415,1775.1281,-1703.4574,16.0000,358.0000,0,0,900); // Cheetah 1
  535.     AddStaticVehicleEx(415,1783.0220,-1703.4574,16.0000,358.0000,0,0,900); // Cheetah 2
  536.     // TRASHMAN
  537.     AddStaticVehicleEx(408, 2183.7778, -1989.2, 16.0, 0.0, 1, 1, 900); // Trashmaster #1
  538.     AddStaticVehicleEx(408, 2188.0386, -1989.2, 16.0, 0.0, 1, 1, 900); // Trashmaster #2
  539.     AddStaticVehicleEx(408, 2192.1223, -1989.2, 16.0, 0.0, 1, 1, 900); // Trashmaster #3
  540.     AddStaticVehicleEx(574,2156.8496,-1970.3,16.0,0.0,1,1,900); // Sweeper #1
  541.     AddStaticVehicleEx(574,2159.9492,-1970.3,16.0,0.0,1,1,900); // Sweeper #2
  542.     AddStaticVehicleEx(574,2163.0276,-1970.3,16.0,0.0,1,1,900); // Sweeper #3
  543.     AddStaticVehicleEx(574,2165.9788,-1970.3,16.0,0.0,1,1,900); // Sweeper #4
  544.     //TAXI VEHICLES
  545.     AddStaticVehicleEx(438,1732.7784,-1858.6791,16.000,270,-1,-1,900); // Oldschool Cab 1
  546.     AddStaticVehicleEx(438,1755.5264,-1858.6791,16.000,270,-1,-1,900); // Oldschool Cab 2
  547.     AddStaticVehicleEx(438,1802.4722,-1864.7412,13.5806,358.2501,-1,-1,900); // Oldschool Cab 3
  548.     AddStaticVehicleEx(438,1798.2456,-1864.6693,13.5776,359.2436,-1,-1,900); // Oldschool Cab 4
  549.     AddStaticVehicleEx(420,1749.4923,-1851.2766,16.000,90,-1,-1,900); // Taxi 1
  550.     AddStaticVehicleEx(420,1730.4237,-1851.2766,16.000,90,-1,-1,900); // Taxi 2
  551.     AddStaticVehicleEx(420,1791.7245,-1864.8146,13.3530,0,-1,-1,900); // Taxi 3
  552.     //GROVE
  553.     AddStaticVehicleEx(550,2489.4717,-1682.6398,13.1574,270.4214,86,86,900); // Sunrise 1
  554.     AddStaticVehicleEx(550,2487.4917,-1655.0593,13.1558,90.0239,86,86,900); // Sunrise 2
  555.     AddStaticVehicleEx(492,2506.0317,-1676.8611,13.1585,325.6313,86,36,900); // Greenwood 3
  556.     AddStaticVehicleEx(492,2508.3210,-1666.6718,13.1791,13.1814,86,36,900); // Greenwood 4
  557.     AddStaticVehicleEx(509,2525.9890,-1663.8104,16.0,90.0,86,36,900); // Grove Street LowRiderbike #1
  558.     AddStaticVehicleEx(509,2527.8147,-1663.8104,16.0,90.0,86,36,900); // Grove Street LowRiderbike #2
  559.     //BALLAS
  560.     AddStaticVehicleEx(566,2015.3771,-1130.9552,24.7592,89.4981,85,85,900); // Tahoma 1
  561.     AddStaticVehicleEx(566,1993.3444,-1130.9552,25.3730,89.4981,85,85,900); // Tahoma 2
  562.     AddStaticVehicleEx(566,2013.4194,-1094.5210,24.4616,339.1252,85,85,900); // Tahoma 3
  563.     AddStaticVehicleEx(566,2008.5813,-1092.7949,24.4593,339.3990,85,85,900); // Tahoma 4
  564.     //TRAIN
  565.     AddStaticVehicleEx(538,1700.7551,-1953.6531,14.8756,200.0,-1,-1,900); // Train
  566.     return 1;
  567. }
  568.  
  569. public OnGameModeExit()
  570. {
  571.     return 1;
  572. }
  573.  
  574. public OnPlayerRequestClass(playerid, classid)
  575. {
  576.     return 1;
  577. }
  578.  
  579. public OnPlayerConnect(playerid)
  580. {
  581.     new string[128];
  582.     if(fexist(UserPath(playerid)))
  583.     {
  584.         INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  585.         ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"Login","Welcome back to CHANGEME.\n\nThat name is registered. Please enter your password below.","Login","Quit"); //login
  586.         format(string, sizeof(string), ""COL_WHITE"Welcome back to "COL_YELLOW"CHANGEME, "COL_WHITE"%s!", GetPlayerFirstName(playerid));
  587.         SendClientMessage(playerid, -1, string);
  588.     }
  589.     else
  590.     {
  591.         ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"Register","Welcome to CHANGEME.\n\nPlease register your account by typing the password below.","Register","Quit");
  592.         format(string, sizeof(string), ""COL_WHITE"Welcome to "COL_YELLOW"CHANGEME, "COL_WHITE"%s!", GetPlayerFirstName(playerid));
  593.         SendClientMessage(playerid, -1, string);
  594.     }
  595.     if(!IsValidName(playerid) && !IsPlayerNPC(playerid) && PlayerInfo[playerid][pAdmin] < 2)
  596.     {
  597.         format(string, sizeof(string), "AdmCmd: %s has been kicked by NameChecker, reason: Invalid name format.", GetName(playerid));
  598.         SendClientMessage(playerid, COLOR_LIGHTRED, "You've been kicked by NameChecker, reason: Invalid name format. (Firstname_Lastname)");
  599.         Kick(playerid);
  600.     }
  601.     SetPlayerInterior(playerid,0);
  602.     TogglePlayerSpectating(playerid, 1);
  603.     gPlayerLogged[playerid] = 1;
  604.     return 1;
  605. }
  606.  
  607. public OnPlayerDisconnect(playerid, reason)
  608. {
  609.     new discstring[128];
  610.     switch(reason)
  611.     {
  612.         case 0: format(discstring, sizeof(discstring), "* %s has left the server. (Timeout)", GetName(playerid));
  613.         case 1: format(discstring, sizeof(discstring), "* %s has left the server. (Leaving)", GetName(playerid));
  614.         case 2: format(discstring, sizeof(discstring), "* %s has left the server. (Kicked)", GetName(playerid));
  615.     }
  616.     ProxDetector(30.0, playerid, discstring, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW, COLOR_YELLOW);
  617.     SaveAccountInfo(playerid);
  618.     return 1;
  619. }
  620.  
  621. public OnPlayerSpawn(playerid)
  622. {
  623.     return 1;
  624. }
  625.  
  626. public OnPlayerDeath(playerid, killerid, reason)
  627. {
  628.     PlayerInfo[killerid][pKills]++;
  629.     PlayerInfo[playerid][pDeaths]++;
  630.     SetPlayerPos(playerid,  982.1890, -1624.2583, 14.9526);
  631.     SetPlayerFacingAngle(playerid, 90);
  632.     return 1;
  633. }
  634.  
  635. public OnVehicleSpawn(vehicleid)
  636. {
  637.     return 1;
  638. }
  639.  
  640. public OnVehicleDeath(vehicleid, killerid)
  641. {
  642.     return 1;
  643. }
  644.  
  645. public OnPlayerText(playerid, text[])
  646. {
  647.     if (realchat)
  648.     {
  649.         new string[128];
  650.         format(string, sizeof(string), "%s says: %s", GetName(playerid), text);
  651.         ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  652.         format(string, sizeof(string), "says: %s", text);
  653.         SetPlayerChatBubble(playerid,string,COLOR_WHITE,5.0,5000);
  654.         ApplyAnimation(playerid,"PED","IDLE_CHAT",2.0,1,0,0,1,1);
  655.         return 0;
  656.     }
  657.     return 1;
  658. }
  659.  
  660. public OnPlayerCommandText(playerid, cmdtext[])
  661. {
  662.     if (strcmp("/mycommand", cmdtext, true, 10) == 0)
  663.     {
  664.         // Do something here
  665.         return 1;
  666.     }
  667.     return 0;
  668. }
  669.  
  670. public OnPlayerEnterVehicle(playerid, vehicleid, ispassenger)
  671. {
  672.     return 1;
  673. }
  674.  
  675. public OnPlayerExitVehicle(playerid, vehicleid)
  676. {
  677.     return 1;
  678. }
  679.  
  680. public OnPlayerStateChange(playerid, newstate, oldstate)
  681. {
  682.     return 1;
  683. }
  684.  
  685. public OnPlayerEnterCheckpoint(playerid)
  686. {
  687.     return 1;
  688. }
  689.  
  690. public OnPlayerLeaveCheckpoint(playerid)
  691. {
  692.     return 1;
  693. }
  694.  
  695. public OnPlayerEnterRaceCheckpoint(playerid)
  696. {
  697.     return 1;
  698. }
  699.  
  700. public OnPlayerLeaveRaceCheckpoint(playerid)
  701. {
  702.     return 1;
  703. }
  704.  
  705. public OnRconCommand(cmd[])
  706. {
  707.     return 1;
  708. }
  709.  
  710. public OnPlayerRequestSpawn(playerid)
  711. {
  712.     return 1;
  713. }
  714.  
  715. public OnObjectMoved(objectid)
  716. {
  717.     return 1;
  718. }
  719.  
  720. public OnPlayerObjectMoved(playerid, objectid)
  721. {
  722.     return 1;
  723. }
  724.  
  725. public OnPlayerPickUpPickup(playerid, pickupid)
  726. {
  727.     return 1;
  728. }
  729.  
  730. public OnVehicleMod(playerid, vehicleid, componentid)
  731. {
  732.     return 1;
  733. }
  734.  
  735. public OnVehiclePaintjob(playerid, vehicleid, paintjobid)
  736. {
  737.     return 1;
  738. }
  739.  
  740. public OnVehicleRespray(playerid, vehicleid, color1, color2)
  741. {
  742.     return 1;
  743. }
  744.  
  745. public OnPlayerSelectedMenuRow(playerid, row)
  746. {
  747.     return 1;
  748. }
  749.  
  750. public OnPlayerExitedMenu(playerid)
  751. {
  752.     return 1;
  753. }
  754.  
  755. public OnPlayerInteriorChange(playerid, newinteriorid, oldinteriorid)
  756. {
  757.     return 1;
  758. }
  759.  
  760. public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
  761. {
  762.     return 1;
  763. }
  764.  
  765. public OnRconLoginAttempt(ip[], password[], success)
  766. {
  767.     return 1;
  768. }
  769.  
  770. public OnPlayerUpdate(playerid)
  771. {
  772.     return 1;
  773. }
  774.  
  775. public OnPlayerStreamIn(playerid, forplayerid)
  776. {
  777.     return 1;
  778. }
  779.  
  780. public OnPlayerStreamOut(playerid, forplayerid)
  781. {
  782.     return 1;
  783. }
  784.  
  785. public OnVehicleStreamIn(vehicleid, forplayerid)
  786. {
  787.     return 1;
  788. }
  789.  
  790. public OnVehicleStreamOut(vehicleid, forplayerid)
  791. {
  792.     return 1;
  793. }
  794.  
  795. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  796. {
  797.     new tmp2[256];
  798.     if(IsPlayerConnected(playerid))
  799.     {
  800.         if(dialogid == 1)
  801.         {
  802.             if (!response) return Kick(playerid);
  803.             if(response)
  804.             {
  805.                 if(!strlen(inputtext)) return ShowPlayerDialog(playerid,1,DIALOG_STYLE_PASSWORD,"Register","Welcome to CHANGEME.\n\nPlease register your account by typing the password below.","Register","Quit");
  806.                 new INI:File = INI_Open(UserPath(playerid));
  807.                 INI_SetTag(File,"data");
  808.                 INI_WriteInt(File,"Password",udb_hash(inputtext));
  809.                 INI_WriteInt(File,"Cash",0);
  810.                 INI_WriteInt(File,"Skin",0);
  811.                 INI_WriteInt(File,"Level",0);
  812.                 INI_WriteInt(File,"Int",0);
  813.                 INI_WriteInt(File,"VW",0);
  814.                 INI_WriteInt(File,"Admin",0);
  815.                 INI_WriteInt(File,"SecKey",0);
  816.                 INI_WriteInt(File,"Kills",0);
  817.                 INI_WriteInt(File,"Deaths",0);
  818.                 INI_WriteFloat(File,"FacingAngle",0);
  819.                 INI_WriteFloat(File,"Health",0);
  820.                 INI_WriteFloat(File,"Armour",0);
  821.                 INI_WriteFloat(File,"LastX",0);
  822.                 INI_WriteFloat(File,"LastY",0);
  823.                 INI_WriteFloat(File,"LastZ",0);
  824.                 INI_Close(File);
  825.                 SetSpawnInfo(playerid, 0, 299, 982.1890, -1624.2583, 14.9526, 90, 0, 0, 0, 0, 0, 0);
  826.                 SpawnPlayer(playerid);
  827.                 ResetPlayerWeapons(playerid);
  828.                 SetPlayerInterior(playerid,0);
  829.                 SetPlayerVirtualWorld(playerid, 0);
  830.                 SetPlayerScore(playerid, 1);
  831.                 GivePlayerMoney(playerid, 1000);
  832.                 SetCameraBehindPlayer(playerid);
  833.                 PlayerInfo[playerid][pSkin] = 299;
  834.                 PlayerInfo[playerid][pInt] = 0;
  835.                 PlayerInfo[playerid][pVW] = 0;
  836.                 PlayerInfo[playerid][pLevel] = 1;
  837.                 SendClientMessage(playerid, COLOR_YELLOW, "Account registered, you have been logged in automatically.");
  838.                 format(tmp2, sizeof(tmp2), "~w~Welcome ~n~~y~   %s", GetName(playerid));
  839.                 GameTextForPlayer(playerid, tmp2, 5000, 1);
  840.                 TogglePlayerSpectating(playerid, 0);
  841.             }
  842.         }
  843.         if(dialogid == 2)
  844.         {
  845.             if ( !response ) return Kick ( playerid );
  846.             if( response )
  847.             {
  848.                 if(udb_hash(inputtext) == PlayerInfo[playerid][pPass])
  849.                 {
  850.                     INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  851.                     SetSpawnInfo(playerid, 0, PlayerInfo[playerid][pSkin], PlayerInfo[playerid][pLastX], PlayerInfo[playerid][pLastY], PlayerInfo[playerid][pLastZ], PlayerInfo[playerid][pFacingAngle], 0, 0, 0, 0, 0, 0);
  852.                     SpawnPlayer(playerid);
  853.                     GivePlayerMoney(playerid, PlayerInfo[playerid][pCash]);
  854.                     SetPlayerSkin(playerid, PlayerInfo[playerid][pSkin]);
  855.                     SetPlayerScore(playerid, PlayerInfo[playerid][pLevel]);
  856.                     SetPlayerHealth(playerid, PlayerInfo[playerid][pHealth]);
  857.                     SetPlayerArmour(playerid, PlayerInfo[playerid][pArmour]);
  858.                     SetPlayerInterior(playerid, PlayerInfo[playerid][pInt]);
  859.                     SetPlayerVirtualWorld(playerid, PlayerInfo[playerid][pVW]);
  860.                     format(tmp2, sizeof(tmp2), "~w~Welcome ~n~~y~   %s", GetName(playerid));
  861.                     GameTextForPlayer(playerid, tmp2, 5000, 1);
  862.                     TogglePlayerSpectating(playerid, 0);
  863.                     if(PlayerInfo[playerid][pAdmin] >= 1)
  864.                     {
  865.                         format(tmp2, sizeof(tmp2), "SERVER: You are logged in as a Level %d Admin.",PlayerInfo[playerid][pAdmin]);
  866.                         SendClientMessage(playerid, COLOR_WHITE,tmp2);
  867.                         ShowPlayerDialog(playerid, 3,DIALOG_STYLE_INPUT,"Admin Login","Please provide your security code for your admin account to be authorized.\n\nPlease enter your security code below.","Login","Quit"); //admin authorization
  868.                     }
  869.                 }
  870.                 else
  871.                 {
  872.                     ShowPlayerDialog(playerid,2,DIALOG_STYLE_PASSWORD,"Login","Welcome back to CHANGEME.\n\nThat name is registered. Please enter your password below.","Login","Quit");
  873.                 }
  874.                 return 1;
  875.             }
  876.         }
  877.         if(dialogid == 3)
  878.         {
  879.             if(gAdminAuthorized[playerid] == 1)
  880.             {
  881.                 SendClientMessage(playerid, COLOR_WHITE, "SERVER: Your admin account has already been authorized.");
  882.                 return 1;
  883.             }
  884.             if(response)
  885.             {
  886.                 if(!strlen(inputtext))
  887.                 {
  888.                     ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Admin Login","Please provide your security code for your admin account to be authorized.\n\nPlease enter your security code below.","Login","Quit"); //admin authorization
  889.                     SendClientMessage(playerid, COLOR_WHITE, "SERVER: You must enter your security code.");
  890.                     return 1;
  891.                 }
  892.                 if(strlen(inputtext) >= 50)
  893.                 {
  894.                     ShowPlayerDialog(playerid,3,DIALOG_STYLE_INPUT,"Admin Login","Please provide your security code for your admin account to be authorized.\n\nPlease enter your security code below.","Login","Quit"); //admin authorization
  895.                     SendClientMessage(playerid, COLOR_WHITE, "SERVER: Security code is too long.");
  896.                     return 0;
  897.                 }
  898.                 if(fexist(UserPath(playerid)))
  899.                 {
  900.                     new tmp;
  901.                     new seckey = strval(inputtext);
  902.                     tmp = PlayerInfo[playerid][pSecKey];
  903.                     if(tmp == 0)
  904.                     {
  905.                         SendClientMessage(playerid, COLOR_RED, "SERVER: You do not have a valid Security Key.");
  906.                         Kick(playerid);
  907.                         return 1;
  908.                     }
  909.                     if(seckey != tmp)
  910.                     {
  911.                         SendClientMessage(playerid, COLOR_RED, "SERVER: Security Key does not match. You have been kicked as a result.");
  912.                         Kick(playerid);
  913.                         return 1;
  914.                     }
  915.                     else
  916.                     {
  917.                         gAdminAuthorized[playerid] = 1;
  918.                         SendClientMessage(playerid, COLOR_WHITE, "SERVER: Your admin account has successfully been authorized.");
  919.                         format(tmp2, sizeof(tmp2), "~w~Welcome ~n~~y~   %s", GetName(playerid));
  920.                         GameTextForPlayer(playerid, tmp2, 5000, 1);
  921.                         TogglePlayerSpectating(playerid, 0);
  922.                         return 1;
  923.                     }
  924.                 }
  925.             }
  926.             else
  927.             {
  928.                 Kick(playerid);
  929.             }
  930.         }
  931.     }
  932.     return 1;
  933. }
  934.  
  935. public OnPlayerClickPlayer(playerid, clickedplayerid, source)
  936. {
  937.     return 1;
  938. }
  939.  
  940. //______________ADMIN COMMANDS____________________
  941. CMD:ah(playerid, params[]) return cmd_ahelp(playerid, params);
  942.  
  943. CMD:ahelp(playerid, params[])
  944. {
  945.     new alevel = PlayerInfo[playerid][pAdmin];
  946.  
  947.     if(PlayerInfo[playerid][pAdmin] >= 1)
  948.     {
  949.         SendClientMessage(playerid, COLOR_GREEN,"____________________________________________");
  950.         if(alevel >= 1)
  951.         {
  952.             SendClientMessage(playerid, COLOR_GRAD1, "1 Moderator: (/ah)elp");
  953.         }
  954.         if(alevel >= 2)
  955.         {
  956.             SendClientMessage(playerid, COLOR_GRAD2, "2 Junior Admin: /kick /ban /goto /sendtols /gotols /spawn");
  957.         }
  958.         if(alevel >= 3)
  959.         {
  960.             SendClientMessage(playerid, COLOR_GRAD3, "3 General Admin: /noooc /setskin /givegun /gotoint");
  961.         }
  962.         if(alevel >= 4)
  963.         {
  964.             SendClientMessage(playerid, COLOR_GRAD4, "4 Senior Admin: /veh /sethp /setarmor /givemoney");
  965.         }
  966.         if(alevel >= 1337)
  967.         {
  968.             SendClientMessage(playerid, COLOR_GRAD5, "1337+ Admin: /rac ");
  969.         }
  970.         if(alevel >= 99999)
  971.         {
  972.             SendClientMessage(playerid, COLOR_GRAD5, "99999+ Executive Admin: /makeadmin");
  973.         }
  974.         if(IsPlayerAdmin(playerid))
  975.         {
  976.             SendClientMessage(playerid, COLOR_GRAD5, "RCON Admin: /rcon cmdlist");
  977.         }
  978.         SendClientMessage(playerid, COLOR_GREEN,"____________________________________________");
  979.     }
  980.     else SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
  981.     return 1;
  982. }
  983.  
  984. CMD:veh(playerid, params[])
  985. {
  986.     new car,color,color2;
  987.     if(PlayerInfo[playerid][pAdmin] >= 4)
  988.     {
  989.         if(sscanf(params, "iii", car,color,color2)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /veh [model] [color1] [color2]");
  990.         if(car < 400 || car > 611) return SendClientMessage(playerid,COLOR_GRAD2, "Invalid vehicle ID specified !(411 - 611)");
  991.         if(color> 255 || color< 0) return SendClientMessage(playerid, COLOR_GRAD2, "Car color ID's: 0-255");
  992.         if(color2> 255 || color2< 0) return SendClientMessage(playerid, COLOR_GRAD2, "Car color ID's: 0-255");
  993.         if(IsPlayerInAnyVehicle(playerid)) return RemovePlayerFromVehicle(playerid);
  994.         new Float:X, Float:Y, Float:Z, Float:A;
  995.         GetPlayerPos(playerid, X,Y,Z);
  996.         GetPlayerFacingAngle(playerid,A);
  997.         new carid = CreateVehicle(car, X,Y,Z,A, color, color2, -1);
  998.         PutPlayerInVehicle(playerid,carid, 0);
  999.         LinkVehicleToInterior(carid,GetPlayerInterior(playerid));
  1000.     }
  1001.     else return SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
  1002.     return 1;
  1003. }
  1004.  
  1005.  
  1006. CMD:makeadmin(playerid, params[])
  1007. {
  1008.     new pID, value;
  1009.  
  1010.     if(PlayerInfo[playerid][pAdmin] < 99999 && !IsPlayerAdmin(playerid)) return SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
  1011.     else if (sscanf(params, "ui", pID, value)) return SendClientMessage(playerid, -1,"USAGE: /makeadmin [playerid/PartOfName] [level 1-99999]");
  1012.     else if (value < 0 || value > 99999) return SendClientMessage(playerid, COLOR_GRAD2, "Invalid level specified !(1-99999)");
  1013.     else if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GRAD2,"Invalid player specified !");
  1014.     else
  1015.     {
  1016.         new tName[MAX_PLAYER_NAME], string[128];
  1017.         new rand = random(9999);
  1018.         GetPlayerName(pID, tName, MAX_PLAYER_NAME);
  1019.         strreplace(tName, '_', ' ');
  1020.         gAdminAuthorized[pID] = 1;
  1021.         PlayerInfo[pID][pSecKey] = rand;
  1022.         format(string, sizeof(string), "* You've promoted %s to an level %d Administrator.", tName, value);
  1023.         SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  1024.         format(string, sizeof(string), "* You've been promoted to an level %d Administrator by %s, your security key is %d.", value, GetName(playerid), PlayerInfo[pID][pSecKey]);
  1025.         SendClientMessage(pID, COLOR_LIGHTBLUE, string);
  1026.         printf("AdmCmd: %s has promoted %s to a level %d admin.", GetName(playerid), tName, value);
  1027.         PlayerInfo[pID][pAdmin] = value;
  1028.     }
  1029.     return 1;
  1030. }
  1031.  
  1032. CMD:noooc(playerid, params[])
  1033. {
  1034.  
  1035.     if(PlayerInfo[playerid][pAdmin] >= 3)
  1036.     {
  1037.         if(PlayerInfo[playerid][pAdmin] >= 3 && (!noooc))
  1038.         {
  1039.             noooc = 1;
  1040.             SendClientMessageToAll(COLOR_GRAD2, "OOC chat channel disabled by an Admin !");
  1041.         }
  1042.         else if(PlayerInfo[playerid][pAdmin] >= 3 && (noooc))
  1043.         {
  1044.             noooc = 0;
  1045.             SendClientMessageToAll(COLOR_GRAD2, "OOC chat channel enabled by an Admin !");
  1046.         }
  1047.     }
  1048.     else return SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
  1049.     return 1;
  1050. }
  1051.  
  1052. CMD:kick(playerid,params[])
  1053. {
  1054.  
  1055.     new id,name1[MAX_PLAYER_NAME], reason[35], string[128], logstring[256];
  1056.     if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GRAD2,NOTADMIN);
  1057.     else if(sscanf(params,"uz",id,reason)) return SendClientMessage(playerid, COLOR_WHITE,"USAGE: /kick [playerid/PartOfName] [reason]");
  1058.     else if(!IsPlayerConnected(id)) return SendClientMessage(playerid, COLOR_GREY,"Invalid player specified !");
  1059.     else if(PlayerInfo[id][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_GRAD2, " You can't ban higher level administrators !");
  1060.     else
  1061.     {
  1062.         new year, month, day;
  1063.         getdate(year, month, day);
  1064.         GetPlayerName(id,name1,sizeof(name1));
  1065.         format(string, sizeof(string),"AdmCmd: %s has been kicked by %s, reason: %s",name1, GetName(playerid), reason);
  1066.         SendClientMessageToAll(COLOR_LIGHTRED,string);
  1067.         Kick(id);
  1068.         format(logstring, sizeof(logstring), "AdmCmd: %s was kicked by %s, reason: %s (%d-%d-%d).", name1, GetName(playerid), reason, month, day, year);
  1069.         KickLog(logstring);
  1070.     }
  1071.     return 1;
  1072. }
  1073.  
  1074. CMD:ban(playerid, params[])
  1075. {
  1076.  
  1077.     new id, reason[35], name2[MAX_PLAYER_NAME], name1[MAX_PLAYER_NAME], string[128];
  1078.     if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GRAD2,NOTADMIN);
  1079.     if(sscanf(params,"uz", id, reason)) return SendClientMessage(playerid, COLOR_WHITE,"USAGE: /ban [playerid/PartOfName] [Reason]");
  1080.     if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_GREY,"Invalid player specified !");
  1081.     else
  1082.     {
  1083.         if(PlayerInfo[id][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_GRAD2, " You can't ban higher level administrators !");
  1084.         new year, month, day;
  1085.         new logstring[256];
  1086.         getdate(year, month, day);
  1087.         GetPlayerName(id, name2, sizeof(name2));
  1088.         GetPlayerName(playerid, name1, sizeof(name1));
  1089.         format(string, sizeof(string), "AdmCmd: %s has been banned by %s, reason: %s", name2, GetName(playerid), reason);
  1090.         format(logstring, sizeof(logstring), "AdmCmd: %s was kicked by %s, reason: %s (%d-%d-%d).", name2, GetName(playerid), reason, month, day, year);
  1091.         BanLog(logstring);
  1092.         SendClientMessageToAll(COLOR_LIGHTRED, string);
  1093.         new plrIP[16];
  1094.         GetPlayerIp(id,plrIP, sizeof(plrIP));
  1095.         SendClientMessage(id,COLOR_YELLOW,"|___________[BAN INFO]___________|");
  1096.         format(string, sizeof(string), "Your name: %s.",name2);
  1097.         SendClientMessage(id, COLOR_WHITE, string);
  1098.         format(string, sizeof(string), "Your IP: %s.",plrIP);
  1099.         SendClientMessage(id, COLOR_WHITE, string);
  1100.         format(string, sizeof(string), "Who banned you: %s.",name1);
  1101.         SendClientMessage(id, COLOR_WHITE, string);
  1102.         format(string, sizeof(string), "Reason: %s.",reason);
  1103.         SendClientMessage(id, COLOR_WHITE, string);
  1104.         SendClientMessage(id,COLOR_YELLOW,"|___________[BAN INFO]___________|");
  1105.         format(string,sizeof(string),"Please take a screenshot of this message (F8) and include it in your ban appeal.",GetName(playerid));
  1106.         SendClientMessage(playerid, COLOR_YELLOW,string);
  1107.         Ban(id);
  1108.     }
  1109.     return 1;
  1110. }
  1111.  
  1112. CMD:goto(playerid, params[])
  1113. {
  1114.     new ID;
  1115.     if(PlayerInfo[playerid][pAdmin] >= 2)
  1116.     {
  1117.         if(sscanf(params, "u", ID)) SendClientMessage(playerid, -1, "USAGE: /goto [playerid]");//checks if you have written something after /goto if no it sends error
  1118.         else if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_GRAD2, "Invalid player specified !");
  1119.         else if(playerid == ID) return SendClientMessage(playerid, COLOR_GRAD2, "You can't goto yourself !");//checks if the player you are teleporting to is connected or if it is yourself if yes then comes an error
  1120.         else//ELSE what will happen if no errors
  1121.         {
  1122.             new pinterior = GetPlayerInterior(ID);
  1123.             new Float:x, Float:y, Float:z;//creates new floats
  1124.             GetPlayerPos(ID, x, y, z);//gets the player id(which we have entered after /goto position and like saves them into x,y,z defined above as floats
  1125.             SetPlayerPos(playerid, x+1, y+1, z);//sets the player position the id of that player +1 in x +1 in y and z remains same as it defines height
  1126.             SetPlayerInterior(playerid, pinterior);
  1127.         }
  1128.     }
  1129.     else return SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
  1130.     return 1;
  1131. }
  1132.  
  1133. CMD:gotols(playerid, params[])
  1134. {
  1135.     if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
  1136.     else
  1137.     {
  1138.         PlayerInfo[playerid][pInt] = 0;
  1139.         SetPlayerInterior(playerid, 0);
  1140.         SetPlayerPos(playerid, 1529.6, -1691.2, 13.3);
  1141.         SendClientMessage(playerid, COLOR_GRAD1, "   You have been teleported to Los Santos!");
  1142.     }
  1143.     return 1;
  1144. }
  1145.  
  1146. CMD:givegun(playerid, params[])
  1147. {
  1148.     if(PlayerInfo[playerid][pAdmin] >= 3)
  1149.     {
  1150.         new target, gun, string[128];
  1151.         if(sscanf(params, "ud", target, gun))
  1152.         {
  1153.             SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givegun [playerid] [weaponid]");
  1154.             SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
  1155.             SendClientMessage(playerid, COLOR_GRAD1, "1: Brass Knuckles 2: Golf Club 3: Nite Stick 4: Knife 5: Baseball Bat 6: Shovel 7: Pool Cue 8: Katana 9: Chainsaw");
  1156.             SendClientMessage(playerid, COLOR_GRAD2, "10: Purple Dildo 11: Small White Vibrator 12: Large White Vibrator 13: Silver Vibrator 14: Flowers 15: Cane 16: Frag Grenade");
  1157.             SendClientMessage(playerid, COLOR_GRAD3, "17: Tear Gas 18: Molotov Cocktail 19: Vehicle Missile 20: Hydra Flare 21: Jetpack 22: 9mm 23: Silenced 9mm 24: Deagle 25: Shotgun");
  1158.             SendClientMessage(playerid, COLOR_GRAD4, "26: Sawnoff Shotgun 27: Combat Shotgun 28: Micro SMG (Mac 10) 29: SMG (MP5) 30: AK-47 31: M4 32: Tec9 33: Country Rifle");
  1159.             SendClientMessage(playerid, COLOR_GRAD5, "34: Sniper Rifle 35: Rocket Launcher 36: HS Rocket Launcher 37: Flamethrower 38: Minigun 39: Satchel Charge");
  1160.             SendClientMessage(playerid, COLOR_GRAD6, "40: Detonator 41: Spraycan 42: Fire Extinguisher 43: Camera 44: Nightvision Goggles 45: Infared Goggles 46: Parachute");
  1161.             SendClientMessage(playerid, COLOR_GREEN,"_______________________________________");
  1162.             return 1;
  1163.         }
  1164.         if(gun < 1 || gun > 46) { SendClientMessage(playerid, COLOR_GREY, "Don't go below 1 or above 47."); return 1; }
  1165.         if(IsPlayerConnected(target))
  1166.         {
  1167.             if(target != INVALID_PLAYER_ID)
  1168.             {
  1169.                 if(gun == 21)
  1170.                 {
  1171.                     SetPlayerSpecialAction(target, SPECIAL_ACTION_USEJETPACK);
  1172.                 }
  1173.                 GivePlayerWeapon(target, gun, 999999);
  1174.                 format(string, sizeof(string), "   You have given gun %d to %s!", gun, GetName(target));
  1175.                 SendClientMessage(playerid, COLOR_GRAD1, string);
  1176.             }
  1177.         }
  1178.     }
  1179.     else
  1180.     {
  1181.         SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command!");
  1182.         return 1;
  1183.     }
  1184.     return 1;
  1185. }
  1186.  
  1187. CMD:gotoint(playerid, params[])
  1188. {
  1189.     new Interior, Float: X, Float: Y, Float: Z;
  1190.     if( sscanf( params, "dfff", Interior, X, Y, Z ) )
  1191.     {
  1192.         if (PlayerInfo[playerid][pAdmin] >= 4)
  1193.         {
  1194.             SendClientMessage( playerid, COLOR_WHITE, "USAGE: /gotoint [Interior ID] [x point] [y point] [z point]" );
  1195.         }
  1196.     }
  1197.     else
  1198.     {
  1199.         if (PlayerInfo[playerid][pAdmin] >= 4)
  1200.         {
  1201.             SetPlayerPos( playerid, X, Y, Z );
  1202.             SetPlayerInterior( playerid, Interior );
  1203.             SendClientMessage( playerid, COLOR_GRAD2, "You have been teleported to the defined position !" );
  1204.         }
  1205.     }
  1206.     return 1;
  1207. }
  1208.  
  1209. CMD:rac(playerid, params[])
  1210. {
  1211.     if(PlayerInfo[playerid][pAdmin] >= 1337)
  1212.     {
  1213.         SendClientMessageToAll(COLOR_GRAD2, "SERVER: An admin has initiated an all vehicle respawn !");
  1214.         for(new i = 1; i <= MAX_VEHICLES; i++)
  1215.         {
  1216.             SetVehicleToRespawn(i);
  1217.         }
  1218.     }
  1219.     else return SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
  1220.     return 1;
  1221. }
  1222.  
  1223. CMD:givemoney(playerid, params[])
  1224. {
  1225.     if (PlayerInfo[playerid][pAdmin] >= 4)
  1226.     {
  1227.         new string[128], giveplayerid, money;
  1228.         if(sscanf(params, "ud", giveplayerid, money)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givemoney [playerid] [money]");
  1229.  
  1230.         if(IsPlayerConnected(giveplayerid))
  1231.         {
  1232.             GivePlayerMoney(giveplayerid, money);
  1233.             format(string, sizeof(string), "* You have set %s's cash to an amount of $%d.",GetName(giveplayerid),money);
  1234.             SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  1235.             new ip[32], ipex[32];
  1236.             new i_dateTime[2][3];
  1237.             gettime(i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2]);
  1238.             getdate(i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2]);
  1239.             GetPlayerIp(playerid, ip, sizeof(ip));
  1240.             GetPlayerIp(giveplayerid, ipex, sizeof(ipex));
  1241.             format(string, sizeof(string), "[%i/%i/%i - %i:%i:%i] %s (IP:%s) has paid $%d to %s (IP:%s)", i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2], i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2], GetName(playerid), ip, money, GetName(giveplayerid), ipex);
  1242.             PayLog(string);
  1243.             PlayerInfo[playerid][pCash] = money;
  1244.  
  1245.         }
  1246.     }
  1247.     else
  1248.     {
  1249.         SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  1250.     }
  1251.     return 1;
  1252. }
  1253.  
  1254. CMD:setarmor(playerid, params[])
  1255. {
  1256.     new string[128], playa, health;
  1257.     if(sscanf(params, "ud", playa, health))
  1258.     {
  1259.         SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setarmor [playerid] [armor]");
  1260.         return 1;
  1261.     }
  1262.     if(PlayerInfo[playa][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_GRAD2, " You can't set higher level administrator's armor !");
  1263.     if (PlayerInfo[playerid][pAdmin] >= 4)
  1264.     {
  1265.         if(IsPlayerConnected(playa))
  1266.         {
  1267.             if(playa != INVALID_PLAYER_ID)
  1268.             {
  1269.                 SetPlayerArmour(playa, health);
  1270.                 format(string, sizeof(string), "* You have set %s's armor to %d.", GetName(playa), health);
  1271.                 SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  1272.             }
  1273.         }
  1274.     }
  1275.     else
  1276.     {
  1277.         SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  1278.     }
  1279.     return 1;
  1280. }
  1281.  
  1282.  
  1283. CMD:sethp(playerid, params[])
  1284. {
  1285.     new string[128], playa, health;
  1286.     if(sscanf(params, "ud", playa, health))
  1287.     {
  1288.         SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sethp [playerid] [health]");
  1289.         return 1;
  1290.     }
  1291.     if(PlayerInfo[playa][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, COLOR_GRAD2, " You can't set higher level administrator's HP !");
  1292.     if (PlayerInfo[playerid][pAdmin] >= 4) {
  1293.         if(IsPlayerConnected(playa)) {
  1294.             if(playa != INVALID_PLAYER_ID)
  1295.             {
  1296.                 SetPlayerHealth(playa, health);
  1297.                 format(string, sizeof(string), "* You have set %s's health to %d.", GetName(playa), health);
  1298.                 SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  1299.             }
  1300.         }
  1301.         else SendClientMessage(playerid, COLOR_GRAD1, "Invalid player specified.");
  1302.     }
  1303.     else {
  1304.         SendClientMessage(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
  1305.     }
  1306.     return 1;
  1307. }
  1308.  
  1309. CMD:setskin(playerid, params[])
  1310. {
  1311.      new name[MAX_PLAYER_NAME], targetname[MAX_PLAYER_NAME], id, skinid, string[128];
  1312.      if(PlayerInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
  1313.      else if(sscanf(params, "ui", id, skinid)) return SendClientMessage(playerid, -1, "USAGE: /setskin [playerid] [skinid]");
  1314.      GetPlayerName(playerid, name, MAX_PLAYER_NAME);
  1315.      GetPlayerName(id, targetname, MAX_PLAYER_NAME);
  1316.      if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "Invalid player specified !");
  1317.      if(skinid < 1 || skinid > 299) { SendClientMessage(playerid, COLOR_GREY, "   Skin can't be below 1 or above 299 ! (SkinID 0 is not accepted)"); return 1; }
  1318.      else
  1319.      {
  1320.          SetPlayerSkin(id, skinid);
  1321.          format(string, 128, "* Admin %s has set your skinid to skinid %d.", name, skinid);
  1322.          SendClientMessage(id, COLOR_LIGHTBLUE, string);
  1323.          format(string, 128, "* You have set player %s their skinid to %d.", targetname, skinid);
  1324.          SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
  1325.      }
  1326.      PlayerInfo[id][pSkin] = skinid;
  1327.      return 1;
  1328. }
  1329.  
  1330. CMD:spawn(playerid, params[])
  1331. {
  1332.     new ID;
  1333.     if(PlayerInfo[playerid][pAdmin] >= 2)
  1334.     {
  1335.         if(sscanf(params, "u", ID)) SendClientMessage(playerid, -1, "USAGE: /spawn [playerid]");//checks if you have written something after /goto if no it sends error
  1336.         else if(!IsPlayerConnected(ID)) return SendClientMessage(playerid, COLOR_GRAD2, "Invalid player specified !");
  1337.         else//ELSE what will happen if no errors
  1338.         {
  1339.             SetPlayerPos(ID, 982.1890, -1624.2583, 14.9526);
  1340.             SetPlayerFacingAngle(ID, 90);
  1341.             SetPlayerInterior(ID, 0);
  1342.         }
  1343.     }
  1344.     else return SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
  1345.     return 1;
  1346. }
  1347.  
  1348. CMD:gethere(playerid,params[])
  1349. {
  1350.     if(PlayerInfo[playerid][pAdmin] >= 2)
  1351.     {
  1352.         new targetid, Float:x, Float:y, Float:z;//defines floats and [U]targetid(same which we did as id above)[/U]
  1353.         new vw = GetPlayerVirtualWorld(playerid);
  1354.         if(sscanf(params, "u", targetid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /gethere [playerid]");//checks if there is something written after /gethere if no sends the usage error
  1355.         else if(playerid == targetid) return SendClientMessage(playerid, COLOR_GRAD2, "You are already at yourself !");
  1356.         if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_GRAD2, "Invalid player specified !");//checks if the player you are teleporting to is conne not teleporting ourselves to our self :P if we are it sends error
  1357.         new interior = GetPlayerInterior(playerid);
  1358.         GetPlayerPos(playerid, x, y, z);//gets player pos PLAYER POS not targetid
  1359.         SetPlayerPos(targetid, x+1, y+1, z);
  1360.         GetPlayerVirtualWorld(playerid);
  1361.         SetPlayerVirtualWorld(targetid, vw);
  1362.         SetPlayerInterior(targetid, interior);
  1363.     }
  1364.     else return SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
  1365.     return 1;
  1366. }
  1367.  
  1368. //____________________________________________________________
  1369.  
  1370.  
  1371. //___________________PLAYER COMMANDS_____________________
  1372. CMD:help(playerid, params[])
  1373. {
  1374.     SendClientMessage(playerid, COLOR_WHITE,"*** CHAT *** (/w)hisper (/o)oc (/s)hout (/l)ow /b /me /do /togwhisper");
  1375.     SendClientMessage(playerid, COLOR_WHITE,"*** GENERAL *** /pay /time /id /kill");
  1376.     return 1;
  1377. }
  1378.  
  1379. CMD:sendtols(playerid, params[])
  1380. {
  1381.     new id;
  1382.  
  1383.     if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, COLOR_GRAD2, NOTADMIN);
  1384.     if(sscanf(params,"u", id)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sendtols [playerid/PartOfName]");
  1385.     if(id != INVALID_PLAYER_ID)
  1386.     {
  1387.         PlayerInfo[id][pInt] = 0;
  1388.         SetPlayerInterior(id, 0);
  1389.         SetPlayerVirtualWorld(id, 0);
  1390.         SetPlayerPos(id, 1529.6, -1691.2, 13.3);
  1391.         SendClientMessage(id, COLOR_GRAD1, "   You have been teleported !");
  1392.     }
  1393.     else return SendClientMessage(playerid, COLOR_GRAD2, "Invalid player specified !");
  1394.     return 1;
  1395. }
  1396.  
  1397. CMD:kill(playerid, params[])
  1398. {
  1399.     SetPlayerHealth(playerid, 0);
  1400.     ResetPlayerWeapons(playerid);
  1401.     return 1;
  1402. }
  1403.  
  1404.  
  1405. CMD:id(playerid, params[])
  1406. {
  1407.     new string[128], giveplayerid;
  1408.  
  1409.     if(sscanf(params, "u", giveplayerid)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /id [playerid]");
  1410.  
  1411.     if(IsPlayerConnected(giveplayerid))
  1412.     {
  1413.         format(string, sizeof(string), "(ID: %d) - (Name: %s) - (Level: %d) - (Ping: %d)", giveplayerid, GetName(giveplayerid),  PlayerInfo[giveplayerid][pLevel], GetPlayerPing(giveplayerid));
  1414.         SendClientMessage(playerid, COLOR_WHITE, string);
  1415.     }
  1416.     else
  1417.     {
  1418.         SendClientMessage(playerid, COLOR_GRAD1, "Invalid player specified !");
  1419.     }
  1420.     return 1;
  1421. }
  1422.  
  1423. CMD:time(playerid, params[])
  1424. {
  1425.     new string[128];
  1426.     new mtext[20];
  1427.     new year, month,day;
  1428.     getdate(year, month, day);
  1429.  
  1430.     if(month == 1) { mtext = "January"; }
  1431.     else if(month == 2) { mtext = "February"; }
  1432.     else if(month == 3) { mtext = "March"; }
  1433.     else if(month == 4) { mtext = "April"; }
  1434.     else if(month == 5) { mtext = "May"; }
  1435.     else if(month == 6) { mtext = "June"; }
  1436.     else if(month == 7) { mtext = "July"; }
  1437.     else if(month == 8) { mtext = "August"; }
  1438.     else if(month == 9) { mtext = "September"; }
  1439.     else if(month == 10) { mtext = "October"; }
  1440.     else if(month == 11) { mtext = "November"; }
  1441.     else if(month == 12) { mtext = "December"; }
  1442.     new hour,minuite,second;
  1443.     gettime(hour,minuite,second);
  1444.     FixHour(hour);
  1445.     hour = shifthour;
  1446.     if(minuite < 10)
  1447.     {
  1448.         format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:0%d~g~|", day, mtext, hour, minuite);
  1449.     }
  1450.     else
  1451.     {
  1452.         format(string, sizeof(string), "~y~%d %s~n~~g~|~w~%d:%d~g~|", day, mtext, hour, minuite);
  1453.     }
  1454.     if(!IsPlayerInAnyVehicle(playerid))
  1455.     {
  1456.         GameTextForPlayer(playerid, string, 5000, 1);
  1457.         ApplyAnimation(playerid, "COP_AMBIENT", "Coplook_watch",4.0,0,0,0,0,0);
  1458.     }
  1459.     else
  1460.     {
  1461.         GameTextForPlayer(playerid, string, 5000, 1);
  1462.     }
  1463.     return 1;
  1464. }
  1465.  
  1466.  
  1467. CMD:pay(playerid, params[])
  1468. {
  1469.     new
  1470.         iTargetID, iCashAmount;
  1471.  
  1472.  
  1473.     if(sscanf(params, "ui", iTargetID, iCashAmount)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /pay [playerid] [amount]");
  1474.  
  1475.     if(iTargetID == playerid)
  1476.     {
  1477.         SendClientMessage(playerid, COLOR_GRAD1, "You can not use this command on yourself !");
  1478.         return 1;
  1479.     }
  1480.     if(iCashAmount > 1000 && PlayerInfo[playerid][pLevel] < 2)
  1481.     {
  1482.         SendClientMessage(playerid, COLOR_GRAD1, "You must be level 2 to pay over $1,000 !");
  1483.         return 1;
  1484.     }
  1485.     if(iCashAmount < 1 || iCashAmount > 10000)
  1486.     {
  1487.         SendClientMessage(playerid, COLOR_GRAD1, "Don't go below $1, or above $10,000 at once !");
  1488.         return 1;
  1489.     }
  1490.     if (IsPlayerConnected(iTargetID))
  1491.     {
  1492.         if (ProxDetectorS(5.0, playerid, iTargetID))
  1493.         {
  1494.             new
  1495.                 string[128], giveplayer[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME], playermoney = GetPlayerMoney(playerid);
  1496.  
  1497.             giveplayer = GetName(iTargetID);
  1498.             sendername = GetName(playerid);
  1499.             if(GetPlayerMoney(playerid) < playermoney) return SendClientMessage(playerid, COLOR_GRAD1, "   Invalid transaction amount.");
  1500.             else
  1501.             {
  1502.                 GivePlayerMoney(playerid, -iCashAmount);
  1503.                 GivePlayerMoney(iTargetID, iCashAmount);
  1504.                 format(string, sizeof(string), "   You have paid $%d to %s.", iCashAmount, GetName(iTargetID));
  1505.                 PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
  1506.                 SendClientMessage(playerid, COLOR_GRAD1, string);
  1507.                 format(string, sizeof(string), "   You have recieved $%d from %s.", iCashAmount, GetName(playerid));
  1508.                 SendClientMessage(iTargetID, COLOR_GRAD1, string);
  1509.                 new ip[32], ipex[32];
  1510.                 new i_dateTime[2][3];
  1511.                 gettime(i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2]);
  1512.                 getdate(i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2]);
  1513.                 GetPlayerIp(playerid, ip, sizeof(ip));
  1514.                 GetPlayerIp(iTargetID, ipex, sizeof(ipex));
  1515.                 format(string, sizeof(string), "[%i/%i/%i - %i:%i:%i] %s (IP:%s) has paid $%d to %s (IP:%s)", i_dateTime[1][0], i_dateTime[1][1], i_dateTime[1][2], i_dateTime[0][0], i_dateTime[0][1], i_dateTime[0][2], GetName(playerid), ip, iCashAmount, GetName(iTargetID), ipex);
  1516.                 PayLog(string);
  1517.  
  1518.                 if(PlayerInfo[playerid][pAdmin] >= 2)
  1519.                 {
  1520.                     format(string, sizeof(string), "[Admin] %s (IP:%s) has paid $%d to %s (IP:%s)", GetName(playerid), ip, iCashAmount, GetName(iTargetID), ipex);
  1521.                     format(string, sizeof(string), "AdmWarning: %s (IP:%s) has paid $%d to %s (IP:%s)", GetName(playerid), ip, iCashAmount, GetName(iTargetID), ipex);
  1522.                     ABroadCast(COLOR_YELLOW, string, 2);
  1523.                 }
  1524.  
  1525.                 PayWarn[playerid][iTargetID] += iCashAmount;
  1526.                 if(PayWarn[playerid][iTargetID] >= 100000 && PlayerInfo[playerid][pLevel] <= 3)
  1527.                 {
  1528.                     format(string, sizeof(string), "%s (IP:%s) has paid %s (IP:%s) $%d in this session.", GetName(playerid), ip, GetName(iTargetID), ipex, PayWarn[playerid][iTargetID]);
  1529.                     ABroadCast(COLOR_YELLOW, string, 2);
  1530.                 }
  1531.  
  1532.                 if(iCashAmount >= 1000000)
  1533.                 {
  1534.                     ABroadCast(COLOR_YELLOW,string,2);
  1535.                 }
  1536.  
  1537.                 PlayerPlaySound(iTargetID, 1052, 0.0, 0.0, 0.0);
  1538.                 format(string, sizeof(string), "* %s takes out some cash, and hands it to %s.", GetName(playerid) ,GetName(iTargetID));
  1539.                 ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1540.             }
  1541.         }
  1542.         else
  1543.         {
  1544.             SendClientMessage(playerid, COLOR_GREY, "That player isn't near you.");
  1545.         }
  1546.     }
  1547.     else SendClientMessage(playerid, COLOR_GRAD1, "Invalid player specified.");
  1548.     return 1;
  1549. }
  1550.  
  1551. CMD:togwhisper(playerid, params[])
  1552. {
  1553.     if (!HidePM[playerid])
  1554.     {
  1555.         HidePM[playerid] = 1;
  1556.         SendClientMessage(playerid, COLOR_GRAD2, "You have disabled whisper chat !");
  1557.     }
  1558.     else
  1559.     {
  1560.         HidePM[playerid] = 0;
  1561.         SendClientMessage(playerid, COLOR_GRAD2, "You have enabled whisper chat !");
  1562.     }
  1563.     return 1;
  1564. }
  1565.  
  1566. CMD:low(playerid, params[]) {
  1567.     return cmd_l(playerid, params);
  1568. }
  1569.  
  1570. CMD:l(playerid, params[])
  1571. {
  1572.     if(isnull(params)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/l)ow [quiet chat]");
  1573.  
  1574.     new string[128];
  1575.     format(string, sizeof(string), "%s says quietly: %s", GetName(playerid), params);
  1576.     ProxDetector(5.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  1577.     format(string, sizeof(string), "(quietly) %s", params);
  1578.     SetPlayerChatBubble(playerid,string,COLOR_WHITE,5.0,5000);
  1579.     return 1;
  1580. }
  1581.  
  1582. CMD:w(playerid, params[]) {
  1583.     return cmd_whisper(playerid, params);
  1584. }
  1585.  
  1586. CMD:whisper(playerid, params[])
  1587. {
  1588.     new giveplayerid, whisper[128];
  1589.  
  1590.     if(sscanf(params, "us[128]", giveplayerid, whisper))
  1591.     {
  1592.         SendClientMessage(playerid, COLOR_WHITE, "USAGE: (/w)hisper [playerid] [message]");
  1593.         return 1;
  1594.     }
  1595.     if (IsPlayerConnected(giveplayerid))
  1596.     {
  1597.         if(HidePM[giveplayerid] > 0)
  1598.         {
  1599.             SendClientMessage(playerid, COLOR_GREY, "That player is blocking whispers!");
  1600.             return 1;
  1601.         }
  1602.         new giveplayer[MAX_PLAYER_NAME], sendername[MAX_PLAYER_NAME], string[128];
  1603.         sendername = GetName(playerid);
  1604.         giveplayer = GetName(giveplayerid);
  1605.         if(ProxDetectorS(5.0, playerid, giveplayerid) || PlayerInfo[playerid][pAdmin] >= 2)
  1606.         {
  1607.             format(string, sizeof(string), "%s(ID: %d) whispers: %s", GetName(playerid), playerid, whisper);
  1608.             SendClientMessage(giveplayerid,COLOR_YELLOW, string);
  1609.            
  1610.             format(string, sizeof(string), "Whisper to %s(ID: %d): %s", GetName(giveplayerid), giveplayerid, whisper);
  1611.             SendClientMessage(playerid,COLOR_YELLOW, string);
  1612.             return 1;
  1613.         }
  1614.         else
  1615.         {
  1616.             SendClientMessage(playerid, COLOR_GREY, "That player isn't near you !");
  1617.         }
  1618.         return 1;
  1619.     }
  1620.     else
  1621.     {
  1622.         SendClientMessage(playerid, COLOR_GRAD1, "Invalid player specified !");
  1623.     }
  1624.     return 1;
  1625. }
  1626.  
  1627. CMD:me(playerid, params[])
  1628. {
  1629.  
  1630.     new string[128];
  1631.     if(isnull(params)) return SendClientMessage(playerid,-1,"USAGE: /me [action]");
  1632.     format(string, sizeof(string), "* %s %s", GetName(playerid), params);
  1633.     ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1634.     return 1;
  1635. }
  1636.  
  1637. CMD:do(playerid, params[])
  1638. {
  1639.     new string[128];
  1640.  
  1641.     if(isnull(params)) return SendClientMessage(playerid,-1,"USAGE: /do [local chat]");
  1642.     format(string, sizeof(string), "* %s (( %s ))", params, GetName(playerid));
  1643.     ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
  1644.     return 1;
  1645. }
  1646.  
  1647. CMD:s(playerid,params[])
  1648. {
  1649.     new string[128];
  1650.  
  1651.     if(isnull(params)) return SendClientMessage(playerid,-1,"USAGE: (/s)hout [local chat]");
  1652.     format(string, sizeof(string), "%s shouts: %s!", GetName(playerid), params);
  1653.     ProxDetector(30.0, playerid, string,COLOR_WHITE,COLOR_WHITE,COLOR_WHITE,COLOR_FADE1,COLOR_FADE2);
  1654.     return 1;
  1655. }
  1656.  
  1657. CMD:shout(playerid, params[]) return cmd_s(playerid, params);
  1658.  
  1659. CMD:b(playerid,params[])
  1660. {
  1661.  
  1662.     new string[128];
  1663.     if(isnull(params)) return SendClientMessage(playerid, -1,"USAGE: /b [local ooc]");
  1664.     format(string, sizeof(string), "%s: (( %s ))", GetName(playerid), params);
  1665.     ProxDetector(30.0, playerid, string,COLOR_FADE1,COLOR_FADE2,COLOR_FADE3,COLOR_FADE4,COLOR_FADE5);
  1666.     return 1;
  1667. }
  1668.  
  1669. CMD:ooc(playerid, params[])
  1670. {
  1671.     new string[160];
  1672.  
  1673.     if(isnull(params)) return SendClientMessage(playerid, -1,"USAGE: /ooc [chat]");
  1674.     if ((noooc) && PlayerInfo[playerid][pAdmin] < 1 && gOOC[playerid] == 0)
  1675.     {
  1676.         SendClientMessage(playerid, COLOR_GREY, "The OOC channel has been disabled by an Admin !");
  1677.         return 1;
  1678.     }
  1679.     else
  1680.     {
  1681.         format(string,160,"(( %s: %s ))", GetName(playerid), params);
  1682.         printf("(( %s: %s ))", GetName(playerid), string);
  1683.         OOCOff(COLOR_OOC,string);
  1684.     }
  1685.     if(gOOC[playerid] == 1)
  1686.     {
  1687.         SendClientMessage(playerid, COLOR_GREY, "You have the channel toggled, /togooc to re-enable!");
  1688.         return 1;
  1689.     }
  1690.     return 1;
  1691. }
  1692.  
  1693. CMD:o(playerid, params[]) return cmd_ooc(playerid, params);
  1694. //___________________________________________________
  1695. public OnPlayerCommandPerformed(playerid, cmdtext[], success)
  1696. {
  1697.     if(!success) SendClientMessage(playerid, COLOR_WHITE, "SERVER: Invalid command, please use the available commands in /help.");
  1698.     else if(gPlayerLogged[playerid] == 0) { SendClientMessage(playerid, COLOR_GREY, "You're not logged in."); }
  1699.     return 1;
  1700. }
Add Comment
Please, Sign In to add comment