Don't like ads? PRO users don't see any ads ;-)
Guest

Promote

By: RedJohn111 on Aug 13th, 2012  |  syntax: PAWN  |  size: 46.45 KB  |  hits: 21  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. //Credits to Y_Less, Dracoblue and Kush.
  2. #include <a_samp>
  3. #include <sscanf2>
  4. #include <YSI\y_ini>
  5. #include <zcmd>
  6. #include <cardefines>
  7. #include <strtok>
  8.  
  9. #define DIALOG_REGISTER 1
  10. #define DIALOG_LOGIN 2
  11. #define DIALOG_SUCCESS_1 3
  12. #define DIALOG_SUCCESS_2 4
  13.  
  14. #define PATH "/aAdmin/Users/%s.ini"
  15.  
  16. #define COL_GREY           "{C3C3C3}"
  17. #define COL_CYAN           "{00FFEE}"
  18. #define COL_RED            "{FF0000}"
  19. #define red "{FF0000}"
  20. #define yellow "{CCCCCC}"
  21. #define grey 0xC0C0C0AA
  22. #define COLOR_RED 0xFF0000FF
  23. #define COLOR_WHITE 0xFFFFFFFF
  24. #define COLOR_PINK 0xFF66FFAA
  25. #define COLOR_GREEN 0x21DD00FF
  26. #define COLOR_PURPLE 0xB360FDFF
  27. #define COLOR_BLUE 0x2641FEAA
  28. #define COLOR_BLACK 0x000000FF
  29. #define COLOR_ORANGE 0xFF830000
  30. #define COLOR_YELLOW 0xF5DEB3AA
  31. #define COLOR_LIGHTBLUE 0x00C2ECFF
  32. #define COLOR_GREY 0xD8D8D8FF
  33. #define COLOR_VIOLET 0xEE82EEFF
  34.  
  35. enum PlayerPosition
  36. {
  37.     Float:XPos,
  38.     Float:YPos,
  39.     Float:ZPos,
  40.     Float:PAngle,
  41.     SavedPosition
  42. }
  43. enum pInfo
  44. {
  45.     aPass,
  46.     aCash,
  47.     aAdmin,
  48.     aKills,
  49.     aDeaths,
  50.     aBanned,
  51.         aSpawnVehicle,
  52.         HasVehicleSpawned,
  53.     bool:aCanSpawnVehicle,
  54. }
  55. new pName[MAX_PLAYER_NAME];
  56. new IsPlayerAway[MAX_PLAYERS];
  57. new PPosition[MAX_PLAYERS][PlayerPosition];
  58. new PlayerInfo[MAX_PLAYERS][pInfo];
  59. //new pInfo [MAX_PLAYERS] [PlayerInfo];
  60. new PMEnabled[MAX_PLAYER_NAME];
  61. new Text:Textdraw1;
  62. new  Float:pX,
  63. Float:pY, Float:pZ, Float:pAngle;
  64.  
  65. //---========Station Names==========---
  66. //-If you want to change the station name just change the name between the brackets " ".
  67. #define station1 "Frag.FM (Live)"
  68. #define station2 "Filth.FM (Dubstep)"
  69. #define station3 "Drum & Bass"
  70. #define station4 "Trance"
  71. #define station5 "Hardstyle"
  72. #define station6 "Rap and Hiphop"
  73. #define station7 "AS.FM(Serb random radio)
  74. //---=====Audio Streaming URLS======---
  75. //-If you want to change the Audio streaming url change the url from the brackets. Make sure it goes with station#.
  76. #define station1stream "http://stream.fragradio.co.uk:8000/live"
  77. #define station2stream "http://lemon.citrus3.com:8062/listen.pls"
  78. #define station3stream "http://di.fm/mp3/drumandbass.pls"
  79. #define station4stream "http://di.fm/mp3/trance.pls"
  80. #define station5stream "http://di.fm/mp3/hardstyle.pls"
  81. #define station6stream "http://105-stream-02.datacomm.ch:8000/105dope"
  82. #define station7stream "http://webstreaming128.radioas.fm/"
  83. //---===============================---
  84.  
  85. forward GetVehicleModelIDFromName(vname[]);
  86. new VehicleNames[212][] = {
  87. {"Landstalker"},{"Bravura"},{"Buffalo"},{"Linerunner"},{"Perrenial"},{"Sentinel"},{"Dumper"},
  88. {"Firetruck"},{"Trashmaster"},{"Stretch"},{"Manana"},{"Infernus"},{"Voodoo"},{"Pony"},{"Mule"},
  89. {"Cheetah"},{"Ambulance"},{"Leviathan"},{"Moonbeam"},{"Esperanto"},{"Taxi"},{"Washington"},
  90. {"Bobcat"},{"Mr Whoopee"},{"BF Injection"},{"Hunter"},{"Premier"},{"Enforcer"},{"Securicar"},
  91. {"Banshee"},{"Predator"},{"Bus"},{"Rhino"},{"Barracks"},{"Hotknife"},{"Trailer 1"},{"Previon"},
  92. {"Coach"},{"Cabbie"},{"Stallion"},{"Rumpo"},{"RC Bandit"},{"Romero"},{"Packer"},{"Monster"},
  93. {"Admiral"},{"Squalo"},{"Seasparrow"},{"Pizzaboy"},{"Tram"},{"Trailer 2"},{"Turismo"},
  94. {"Speeder"},{"Reefer"},{"Tropic"},{"Flatbed"},{"Yankee"},{"Caddy"},{"Solair"},{"Berkley's RC Van"},
  95. {"Skimmer"},{"PCJ-600"},{"Faggio"},{"Freeway"},{"RC Baron"},{"RC Raider"},{"Glendale"},{"Oceanic"},
  96. {"Sanchez"},{"Sparrow"},{"Patriot"},{"Quad"},{"Coastguard"},{"Dinghy"},{"Hermes"},{"Sabre"},
  97. {"Rustler"},{"ZR-350"},{"Walton"},{"Regina"},{"Comet"},{"BMX"},{"Burrito"},{"Camper"},{"Marquis"},
  98. {"Baggage"},{"Dozer"},{"Maverick"},{"News Chopper"},{"Rancher"},{"FBI Rancher"},{"Virgo"},{"Greenwood"},
  99. {"Jetmax"},{"Hotring"},{"Sandking"},{"Blista Compact"},{"Police Maverick"},{"Boxville"},{"Benson"},
  100. {"Mesa"},{"RC Goblin"},{"Hotring Racer A"},{"Hotring Racer B"},{"Bloodring Banger"},{"Rancher"},
  101. {"Super GT"},{"Elegant"},{"Journey"},{"Bike"},{"Mountain Bike"},{"Beagle"},{"Cropdust"},{"Stunt"},
  102. {"Tanker"}, {"Roadtrain"},{"Nebula"},{"Majestic"},{"Buccaneer"},{"Shamal"},{"Hydra"},{"FCR-900"},
  103. {"NRG-500"},{"HPV1000"},{"Cement Truck"},{"Tow Truck"},{"Fortune"},{"Cadrona"},{"FBI Truck"},
  104. {"Willard"},{"Forklift"},{"Tractor"},{"Combine"},{"Feltzer"},{"Remington"},{"Slamvan"},
  105. {"Blade"},{"Freight"},{"Streak"},{"Vortex"},{"Vincent"},{"Bullet"},{"Clover"},{"Sadler"},
  106. {"Firetruck LA"},{"Hustler"},{"Intruder"},{"Primo"},{"Cargobob"},{"Tampa"},{"Sunrise"},{"Merit"},
  107. {"Utility"},{"Nevada"},{"Yosemite"},{"Windsor"},{"Monster A"},{"Monster B"},{"Uranus"},{"Jester"},
  108. {"Sultan"},{"Stratum"},{"Elegy"},{"Raindance"},{"RC Tiger"},{"Flash"},{"Tahoma"},{"Savanna"},
  109. {"Bandito"},{"Freight Flat"},{"Streak Carriage"},{"Kart"},{"Mower"},{"Duneride"},{"Sweeper"},
  110. {"Broadway"},{"Tornado"},{"AT-400"},{"DFT-30"},{"Huntley"},{"Stafford"},{"BF-400"},{"Newsvan"},
  111. {"Tug"},{"Trailer 3"},{"Emperor"},{"Wayfarer"},{"Euros"},{"Hotdog"},{"Club"},{"Freight Carriage"},
  112. {"Trailer 3"},{"Andromada"},{"Dodo"},{"RC Cam"},{"Launch"},{"Police Car (LSPD)"},{"Police Car (SFPD)"},
  113. {"Police Car (LVPD)"},{"Police Ranger"},{"Picador"},{"S.W.A.T. Van"},{"Alpha"},{"Phoenix"},{"Glendale"},
  114. {"Sadler"},{"Luggage Trailer A"},{"Luggage Trailer B"},{"Stair Trailer"},{"Boxville"},{"Farm Plow"},
  115. {"Utility Trailer"}};
  116.  
  117. public LoadUser_data(playerid,name[],value[])
  118. {
  119.     INI_Int("aPassword",PlayerInfo[playerid][aPass]);
  120.     INI_Int("aCash",PlayerInfo[playerid][aCash]);
  121.     INI_Int("aAdmin",PlayerInfo[playerid][aAdmin]);
  122.     INI_Int("aKills",PlayerInfo[playerid][aKills]);
  123.     INI_Int("aDeaths",PlayerInfo[playerid][aDeaths]);
  124.     INI_Int("aBanned",PlayerInfo[playerid][aBanned]);
  125.     return 1;
  126. }
  127. //==============================
  128. //-----------FORWARDS-----------
  129. //==============================
  130. forward LoadUser_data(playerid,name[],value[]);
  131. forward ChangeHostName();
  132. forward MessageToAdmins(color,const string[]);
  133. forward RandomMessages();
  134. //==============================
  135. //------------STOCKS------------
  136. //==============================
  137. public MessageToAdmins(color,const string[])
  138. {
  139.         for(new i = 0; i < MAX_PLAYERS; i++)
  140.         {
  141.                 if(IsPlayerConnected(i) == 1) if (PlayerInfo[i][aAdmin] > 1) SendClientMessage(i, color, string);
  142.         }
  143.         return 1;
  144. }
  145.  
  146. stock UserPath(playerid)
  147. {
  148.     new string[128],uPlayername[MAX_PLAYER_NAME];
  149.     GetPlayerName(playerid,uPlayername,sizeof(uPlayername));
  150.     format(string,sizeof(string),PATH,uPlayername);
  151.     return string;
  152. }
  153. stock PlayerName(playerid)
  154. {
  155.         new pName[25];
  156.         GetPlayerName(playerid, pName, sizeof(pName));
  157.         return pName;
  158. }
  159.  
  160. stock PlayerName2(playerid) {
  161.   new name[MAX_PLAYER_NAME];
  162.   GetPlayerName(playerid, name, sizeof(name));
  163.   return name;
  164. }
  165.  
  166. stock udb_hash(buf[]) {
  167.     new length=strlen(buf);
  168.     new s1 = 1;
  169.     new s2 = 0;
  170.     new n;
  171.     for (n=0; n<length; n++)
  172.     {
  173.        s1 = (s1 + buf[n]) % 65521;
  174.        s2 = (s2 + s1)     % 65521;
  175.     }
  176.     return (s2 << 16) + s1;
  177. }
  178. //==============================
  179. //--------SCRIPT START----------
  180. //==============================
  181. main()
  182. {   // Gamemode "text"
  183.         print("\n-----------------------------------------");
  184.         print(" Avail's gamemode, like 2.0 already? ");
  185.         print("-----------------------------------------\n");
  186. }
  187.  
  188. public OnGameModeInit()
  189. {
  190.         // name changing
  191.         SetTimer("ChangeHostName",500,1);
  192.         // random messages
  193.         SetTimer("RandomMessages", 30000, true);
  194.         // Gamemode "Name"
  195.         SetGameModeText("v2");
  196.         // Player classes
  197.         for(new i = 0; i < 299; i++)
  198.     {
  199.             switch(i)
  200.             {
  201.               case (3,4,5,6,8,42,65,74,86,119,149,208,268,273,289): continue;
  202.               default: AddPlayerClass(i, 1241.0105, -2052.6873, 59.9975, 2.8144, -1, -1, -1, -1, -1, -1);
  203.             }
  204.     }
  205.         return 1;
  206. }
  207.  
  208. public OnPlayerRequestClass(playerid, classid)
  209. {
  210.         SetPlayerPos(playerid,1095.3811,-2036.9301,82.7055);
  211.         SetPlayerFacingAngle(playerid,271.5483);
  212.         SetPlayerCameraPos(playerid, 1106.181518, -2036.951049, 82.758186);
  213.         SetPlayerCameraLookAt(playerid, 1101.183349, -2037.086181, 82.758186);
  214.         return 1;
  215. }
  216.  
  217. public OnPlayerConnect(playerid)
  218. {
  219.         PMEnabled[playerid] = 1;
  220.     if(fexist(UserPath(playerid)))
  221.     {
  222.         INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  223.         if(PlayerInfo[playerid][aBanned] == 1) return SendClientMessage(playerid, -1, ""#COL_GREY"You are "#COL_RED"banned "#COL_GREY"from the server.");
  224.                 if(PlayerInfo[playerid][aBanned] == 1) return Ban(playerid);
  225.         ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_CYAN"Login",""COL_GREY"Type your password below to login.","Login","Quit");
  226.     }
  227.     else
  228.     {
  229.         ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT,""COL_CYAN"Registering...",""COL_GREY"Type your password below to register a new account.","Register","Quit");
  230.     }
  231.         new pname[MAX_PLAYER_NAME], string[22 + MAX_PLAYER_NAME];
  232.     GetPlayerName(playerid, pname, sizeof(pname));
  233.     format(string, sizeof(string), ""#COL_RED"%s "#COL_GREY"joined.", pname);
  234.     SendClientMessageToAll(-1, string);
  235.         // spawn message
  236.         SendClientMessage(playerid,-1,""#COL_GREY"Welcome to "#COL_RED"WorldWide"#COL_GREY",read the "#COL_RED"/rules!");
  237.         // SAVE-LOAD
  238.         PPosition[playerid][SavedPosition] = 0;
  239.         // user color
  240.         //SetPlayerColor(playerid, 0xFFFF00AA); //Affects all players who join the server.
  241.         // admin color
  242.         if(PlayerInfo[playerid][aAdmin] > 2)
  243.         {
  244.         SetPlayerColor(playerid, 0x00FFEEEE);
  245.         }
  246.         //textdraw
  247.         Textdraw1 = TextDrawCreate(9.000000, 425.000000, "  ~r~U~w~nknown ~r~D~w~rifters");
  248.         TextDrawBackgroundColor(Textdraw1, 255);
  249.         TextDrawFont(Textdraw1, 1);
  250.         TextDrawLetterSize(Textdraw1, 0.410000, 2.299999);
  251.         TextDrawColor(Textdraw1, -1);
  252.         TextDrawSetOutline(Textdraw1, -1);
  253.         TextDrawSetProportional(Textdraw1, 1);
  254.         TextDrawShowForPlayer(playerid, Textdraw1);
  255.         return 1;
  256. }
  257.  
  258. public OnPlayerSpawn(playerid)
  259. {
  260.         SendClientMessage(playerid,COLOR_GREY, ""#COL_RED"WorldWide: "#COL_GREY"Type "#COL_RED"/help "#COL_GREY"if you need help..");
  261.         return 1;
  262. }
  263. // hostname changing
  264. public ChangeHostName()
  265. {
  266.    new var = random(2);
  267.    switch (var)
  268.    {
  269.      case 0: SendRconCommand("hostname [0.3e]World Wide Drifting");
  270.      case 1: SendRconCommand("hostname [0.3e]World Wide Drifting - UPDATED ! ! !");
  271.    }
  272. }
  273. // random messages
  274. new randomMessages[][] =
  275.     {
  276.         ""#COL_RED"[SERVER]"#COL_GREY" If you want to listen to some music, type "#COL_RED"/radio!",
  277.         ""#COL_RED"[SERVER]"#COL_GREY" If you need any help type "#COL_RED"/help"#COL_GREY" or ask an admin!",
  278.         ""#COL_RED"[SERVER]"#COL_GREY" Thanks extreme-precision.net for hosting the server!",
  279.         ""#COL_RED"[SERVER]"#COL_GREY" If you need an admin, type "#COL_RED"/contactadmins",
  280.         ""#COL_RED"[SERVER]"#COL_GREY" Enjoy your time here!",
  281.         ""#COL_RED"[SERVER]"#COL_GREY" If you need a vehicle, don't jack one, type /car [name] instead!",
  282.         ""#COL_RED"[SERVER]"#COL_GREY" Please don't ram other people!",
  283.         ""#COL_RED"[SERVER]"#COL_GREY" Enjoy your stay at World Wide Drifting!",
  284.         ""#COL_RED"[SERVER]"#COL_GREY" Respect all players!",
  285.         ""#COL_RED"[SERVER]"#COL_GREY" Please don't spam!",
  286.         ""#COL_RED"[SERVER]"#COL_GREY" Hi there! I'm a bot! :D",
  287.                 ""#COL_RED"[SERVER]"#COL_GREY" MEOW! :D"
  288.     };
  289.  
  290. public RandomMessages()
  291. {
  292.     new randomMsg = random(sizeof(randomMessages));
  293.     SendClientMessageToAll(-1, randomMessages[randomMsg]); //this will send the content of our array to EVERYBODY on the server
  294. }
  295.  
  296. public OnPlayerDisconnect(playerid, reason)
  297. {
  298.     new pname[MAX_PLAYER_NAME], string[39 + MAX_PLAYER_NAME];
  299.     GetPlayerName(playerid, pname, sizeof(pname));
  300.     switch(reason)
  301.     {
  302.         case 0: format(string, sizeof(string), ""#COL_RED"%s"#COL_GREY" lost connection.", pname);
  303.         case 1: format(string, sizeof(string), ""#COL_RED"%s"#COL_GREY" has left the server.", pname);
  304.         case 2: format(string, sizeof(string), ""#COL_RED"%s"#COL_GREY" got kicked/banned.", pname);
  305.     }
  306.     SendClientMessageToAll(-1, string);
  307.     //===========
  308.     new INI:File = INI_Open(UserPath(playerid));
  309.     INI_SetTag(File,"data");
  310.     INI_WriteInt(File,"aCash",GetPlayerMoney(playerid));
  311.     INI_WriteInt(File,"aAdmin",PlayerInfo[playerid][aAdmin]);
  312.     INI_WriteInt(File,"aKills",PlayerInfo[playerid][aKills]);
  313.     INI_WriteInt(File,"aDeaths",PlayerInfo[playerid][aDeaths]);
  314.     INI_WriteInt(File,"aBanned",PlayerInfo[playerid][aBanned]);
  315.     INI_Close(File);
  316.     return 1;
  317. }
  318.  
  319. forward SendMessageToAdmins(color,const string[]);
  320. public SendMessageToAdmins(color,const string[])
  321. {
  322.     for(new i = 0; i < MAX_PLAYERS; i++)
  323.     {
  324.         if(IsPlayerConnected(i) == 1)
  325.         if(PlayerInfo[i][aAdmin] > 1)
  326.         SendClientMessage(i, color, string);
  327.     }
  328.     return 1;
  329. }
  330.  
  331. public OnPlayerDeath(playerid, killerid, reason)
  332. {
  333.     PlayerInfo[killerid][aKills]++;
  334.     PlayerInfo[playerid][aDeaths]++;
  335.     return 1;
  336. }
  337.  
  338. public OnPlayerText(playerid, text[])
  339. {
  340.         if(text[0] == '#' && PlayerInfo[playerid][aAdmin] > 1) {
  341.             new string[128]; GetPlayerName(playerid,string,sizeof(string));
  342.                 format(string,sizeof(string),""#COL_RED"WorldWide:"#COL_GREY" %s "#COL_RED": %s",string,text[1]); MessageToAdmins(-1,string);
  343.             return 0;
  344.         }
  345.         return 1;
  346. }
  347. //==============================
  348. //---------COMMANDS-------------
  349. //==============================
  350.  
  351. CMD:acmds(playerid,params[])
  352. {
  353.         if(PlayerInfo[playerid][aAdmin] > 2)
  354.         {
  355.                 SendClientMessage(playerid, -1,""#COL_RED"[SERVER]"#COL_GREY" /promote - /car - /kick - /ban - /t - /w - /vw");
  356.                 SendClientMessage(playerid, -1,""#COL_RED"[SERVER]"#COL_GREY" /respawncars - /spam - /cardel - /goto - /pm - /pmoff");
  357.                 SendClientMessage(playerid, -1,""#COL_RED"[SERVER]"#COL_GREY" /admins - # (Admin chat) - /report - /");
  358.                 return 1;
  359.         }
  360.         else SendClientMessage(playerid, -1,""#COL_RED"[SERVER]"#COL_GREY" You have to be an admin to use /acmds!");
  361.         return 1;
  362. }
  363. //======================================================================================================
  364. CMD:tagsoff(playerid,params[])
  365. {
  366. for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, false);
  367. SendClientMessage(playerid, -1, ""#COL_GREY"Tags turned "#COL_RED"off");
  368. return 1;
  369. }
  370. //=======================================================================================================
  371. CMD:tagson(playerid,params[])
  372. {
  373. for(new i = 0; i < MAX_PLAYERS; i++) ShowPlayerNameTagForPlayer(playerid, i, true);
  374. SendClientMessage(playerid, -1, ""#COL_GREY"Tags turned "#COL_RED"on");
  375. return 1;
  376. }
  377. //=======================================================================================================
  378. CMD:hidetd(playerid,params[])
  379. {
  380. TextDrawHideForPlayer(playerid, Textdraw1);
  381. return 1;
  382. }
  383. //=======================================================================================================
  384. CMD:showtd(playerid,params[])
  385. {
  386. TextDrawShowForPlayer(playerid, Textdraw1);
  387. return 1;
  388. }
  389. //=======================================================================================================
  390. CMD:help(playerid,params[])
  391. {
  392. SendClientMessage(playerid,0xAA3333AA," ");
  393. SendClientMessage(playerid,0xD8D8D8FF," ");
  394. SendClientMessage(playerid,-1,""#COL_GREY"================="#COL_RED"WorldWide"#COL_GREY"==================");
  395. SendClientMessage(playerid,COLOR_GREY," Remember to read the rules! ("#COL_RED"/rules"#COL_GREY")");
  396. SendClientMessage(playerid,COLOR_GREY," To see a list of available commands,type "#COL_RED"/cmds");
  397. SendClientMessage(playerid,COLOR_GREY," To see a list of available teleports,type "#COL_RED"/teles");
  398. SendClientMessage(playerid,-1,""#COL_GREY"================="#COL_RED"WorldWide"#COL_GREY"==================");
  399. return 1;
  400. }
  401. //=======================================================================================================
  402. CMD:cmds(playerid,params[])
  403. {
  404. SendClientMessage(playerid,0xAA3333AA," ");
  405. SendClientMessage(playerid,0xD8D8D8FF," ");
  406. SendClientMessage(playerid,-1,""#COL_GREY"================="#COL_RED"WorldWide"#COL_GREY"==================");
  407. SendClientMessage(playerid,COLOR_GREY,"Commands :");
  408. SendClientMessage(playerid,COLOR_GREY," /flip - /fr - /report - /teles - /cc - /pj1 - /pj2 - /pj3");
  409. SendClientMessage(playerid,COLOR_GREY," /god - /godcar - /cash - /car - /radio - /radiostop - /t - /w");
  410. SendClientMessage(playerid,COLOR_GREY," /credits - /pm - /admins - /rules - /s - /r ");
  411. SendClientMessage(playerid,COLOR_GREY," /afk - /back - /goto - /contactadmins ");
  412. SendClientMessage(playerid,-1,""#COL_GREY"================="#COL_RED"WorldWide"#COL_GREY"==================");
  413. return 1;
  414. }
  415. //======================================================================================================
  416. CMD:afk(playerid,params[])
  417. {
  418. new string[48];
  419. GetPlayerName(playerid, pName, sizeof(pName));
  420. format(string, sizeof(string), "%s is now Away from his/her keyboard.", pName);
  421. SendClientMessageToAll(COLOR_GREY, string);
  422. SetPlayerFacingAngle(playerid,0);
  423. TogglePlayerControllable(playerid, 0);
  424. IsPlayerAway[playerid] = 1;
  425. return 1;
  426. }
  427. //=======================================================================================================
  428. CMD:back(playerid,params[])
  429. {
  430. new string[48];
  431. GetPlayerName(playerid, pName, sizeof(pName));
  432. format(string, sizeof(string), "%s is now back!", pName);
  433. SendClientMessageToAll(COLOR_GREY, string);
  434. SetPlayerFacingAngle(playerid, 264.3768);
  435. TogglePlayerControllable(playerid, 1);
  436. IsPlayerAway[playerid] = 0;
  437. return 1;
  438. }
  439. //=======================================================================================================
  440. CMD:contactadmins(playerid,params[])
  441. {
  442. SendClientMessage(playerid, -1,""#COL_GREY"================="#COL_RED"WorldWide"#COL_GREY"==================");
  443. SendClientMessage(playerid, -1,""#COL_RED" Avail "#COL_GREY"- "#COL_RED" avail.gta");
  444. SendClientMessage(playerid, -1,""#COL_RED" Ryouichi "#COL_GREY"- "#COL_RED" alexpk_xd_boy");
  445. SendClientMessage(playerid, -1,""#COL_RED" SpulX "#COL_GREY" - "#COL_RED"  ");
  446. SendClientMessage(playerid, -1,""#COL_RED" SKYPE ONLY");
  447. SendClientMessage(playerid, -1,""#COL_GREY"================="#COL_RED"WorldWide"#COL_GREY"==================");
  448. return 1;
  449. }
  450.  
  451.  
  452. //=======================================================================================================
  453. CMD:rules(playerid,params[])
  454. {
  455. SendClientMessage(playerid,-1,""#COL_GREY"================="#COL_RED"WorldWide"#COL_GREY"==================");
  456. SendClientMessage(playerid,COLOR_GREY,"1.ENGLISH ONLY IN THE CHAT");
  457. SendClientMessage(playerid,COLOR_GREY,"2.No Deathmatch (Will result in a kick)");
  458. SendClientMessage(playerid,COLOR_GREY,"3.No Carjacking (Jail/kick)");
  459. SendClientMessage(playerid,COLOR_GREY,"4.Don't spam or you WILL get kicked.");
  460. SendClientMessage(playerid,COLOR_GREY,"5.No hacks allowed,except sobeit for handlings.");
  461. SendClientMessage(playerid,COLOR_GREY,"6.Respect all players/admins and have fun!");
  462. SendClientMessage(playerid,-1,""#COL_GREY"================="#COL_RED"WorldWide"#COL_GREY"==================");
  463. return 1;
  464. }
  465. //=======================================================================================================
  466. CMD:credits(playerid,params[])
  467. {
  468. SendClientMessage(playerid,-1,""#COL_GREY"================="#COL_RED"WorldWide"#COL_GREY"==================");
  469. SendClientMessage(playerid,-1,""#COL_RED"Avail"#COL_GREY", making the admin script + whole server");
  470. SendClientMessage(playerid,-1,"1) "#COL_RED"PlayHard"#COL_GREY", for PlayHard radio.");
  471. SendClientMessage(playerid,-1,"2) "#COL_RED"TwistedInsane"#COL_GREY", for the random messages, /pm");
  472. SendClientMessage(playerid,-1,"3) "#COL_RED"DonLimito"#COL_GREY", for nitro filterscript, and generally helping me.");
  473. SendClientMessage(playerid,-1,"4) "#COL_RED"[EDT]Quattro"#COL_GREY", for /cc, /fr, teleports");
  474. SendClientMessage(playerid,-1,""#COL_GREY"================="#COL_RED"WorldWide"#COL_GREY"==================");
  475. return 1;
  476. }
  477. //=======================================================================================================
  478. CMD:teles(playerid,params[])
  479. {
  480. SendClientMessage(playerid,-1,""#COL_GREY"================"#COL_RED"WorldWide"#COL_GREY"===================");
  481. SendClientMessage(playerid,COLOR_GREY," /drift1 - 53");
  482. SendClientMessage(playerid,COLOR_GREY," /ls - /lv - /sf");
  483. SendClientMessage(playerid,COLOR_GREY," /lsap - /lvap - /lsap");
  484. SendClientMessage(playerid,-1,""#COL_GREY"================"#COL_RED"WorldWide"#COL_GREY"===================");
  485. return 1;
  486. }
  487. //=======================================================================================================
  488. CMD:radio(playerid,params[])
  489. {
  490. ShowPlayerDialog(playerid,354,DIALOG_STYLE_LIST,""red"Stations List","1. "station1"\r\n2. "station2"\r\n3. "station3"\r\n4. "station4"\r\n5. "station5"\r\n6. "station6"\r\n7."station7","Select", "Cancel");
  491. return 1;
  492. }
  493. //=======================================================================================================
  494. CMD:radiostop(playerid,params[])
  495. {
  496. StopAudioStreamForPlayer(playerid);
  497. return 1;
  498. }
  499. //=======================================================================================================
  500. CMD:cash(playerid,params[])
  501. {
  502. ResetPlayerMoney(playerid);
  503. GivePlayerMoney(playerid,2000000);
  504. return 1;
  505. }
  506. //=======================================================================================================
  507. CMD:pj1(playerid,params[])
  508. {
  509. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, ""#COL_RED"SERVER: "COL_GREY"You have to be in a vehicle");
  510. ChangeVehiclePaintjob(GetPlayerVehicleID(playerid),0);
  511. return 1;
  512. }
  513. //=======================================================================================================
  514. CMD:pj2(playerid,params[])
  515. {
  516. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, ""#COL_RED"SERVER: "COL_GREY"You have to be in a vehicle");
  517. ChangeVehiclePaintjob(GetPlayerVehicleID(playerid),1);
  518. return 1;
  519. }
  520. //=======================================================================================================
  521. CMD:pj3(playerid,params[])
  522. {
  523. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, ""#COL_RED"SERVER: "COL_GREY"You have to be in a vehicle");
  524. ChangeVehiclePaintjob(GetPlayerVehicleID(playerid),2);
  525. return 1;
  526. }
  527. //=======================================================================================================
  528. CMD:pj4(playerid,params[])
  529. {
  530. if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, -1, ""#COL_RED"SERVER: "COL_GREY"You have to be in a vehicle");
  531. ChangeVehiclePaintjob(GetPlayerVehicleID(playerid),3);
  532. return 1;
  533. }
  534. //=======================================================================================================
  535. CMD:fr(playerid,params[])
  536. {
  537. new vehicleid=GetPlayerVehicleID(playerid);
  538. RepairVehicle(vehicleid);
  539. SendClientMessage(playerid,-1, ""#COL_RED"SERVER: "COL_GREY"Your Vehicle has been fixed!");
  540. return 1;
  541. }
  542. //=======================================================================================================
  543. CMD:flip(playerid,params[])
  544. {
  545.         if(IsPlayerInAnyVehicle(playerid))
  546.         {
  547.                 new currentveh;
  548.                 new Float:angle;
  549.                 currentveh = GetPlayerVehicleID(playerid);//with this we will get the vehicle id
  550.                 GetVehicleZAngle(currentveh, angle);//we will get to know the current Z angle of vehicle, i.e. Z angle of the vehicle which will let us know how the vehicle is.
  551.                 SetVehicleZAngle(currentveh, angle);//if we use this the Z angel of the vehicle will become the opposite of the Z angle of wat we got from the above function
  552.                 SendClientMessage(playerid, -1, ""#COL_GREY"Your vehicle has been flipped.");
  553.                 return 1;
  554.         }
  555.         else
  556.         {
  557.                 SendClientMessage(playerid, -1, ""#COL_GREY"You are not in any vehicle!");
  558.                 return 1;
  559.         }
  560. }
  561. //=======================================================================================================
  562. CMD:me(playerid,params[])
  563. {
  564. if(!params[2])return SendClientMessage(playerid, -1, ""#COL_GREY"USAGE: /me [action]");
  565. new str[128];
  566. GetPlayerName(playerid, str, sizeof(str));
  567. format(str, sizeof(str), "* %s %s", str, params[0]);
  568. SendClientMessageToAll(0xFFFF00AA, str);
  569. return 1;
  570. }
  571. //=======================================================================================================
  572. CMD:cc(playerid,params[])
  573. {
  574. if(IsPlayerInAnyVehicle(playerid))
  575. {
  576.    new tmp[128], idx;
  577.         new color1, color2;
  578.         tmp = strtok(params, idx);
  579.         if(!strlen(tmp)) return SendClientMessage(playerid, -1, ""#COL_RED"SERVER: "COL_GREY"/cc (color1) (color2)");
  580.         color1 = strval(tmp);
  581.         tmp = strtok(params, idx);
  582.         if(!strlen(tmp)) return SendClientMessage(playerid, -1, ""#COL_RED"SERVER: "COL_GREY"/cc (color1) (color2)");
  583.         color2 = strval(tmp);
  584.         ChangeVehicleColor(GetPlayerVehicleID(playerid), color1, color2);
  585. }
  586. else
  587. {
  588.         SendClientMessage(playerid, -1, ""#COL_RED"SERVER: "COL_GREY"You are not in a vehicle!");
  589. }
  590. return 1;
  591. }
  592. //=======================================================================================================
  593. CMD:s(playerid,params[])
  594. {
  595. new Float:x,Float:y,Float:z,Float:angle;
  596. if(IsPlayerInAnyVehicle(playerid))
  597. {
  598.         GetVehiclePos(GetPlayerVehicleID(playerid),x,y,z);
  599.         GetVehicleZAngle(GetPlayerVehicleID(playerid),angle);
  600.         PPosition[playerid][XPos] = x;
  601.         PPosition[playerid][YPos] = y;
  602.         PPosition[playerid][ZPos] = z;
  603.         PPosition[playerid][PAngle] = angle;
  604.         SendClientMessage(playerid,-1, ""#COL_RED"SERVER: "COL_GREY"Position saved! Type "#COL_RED"/r "#COL_GREY"to teleport back!");
  605. }
  606. else
  607. {
  608.         GetPlayerPos(playerid,x,y,z);
  609.         GetPlayerFacingAngle(playerid,angle);
  610.         PPosition[playerid][XPos] = x;
  611.         PPosition[playerid][YPos] = y;
  612.         PPosition[playerid][ZPos] = z;
  613.         PPosition[playerid][PAngle] = angle;
  614.         SendClientMessage(playerid,-1, ""#COL_RED"SERVER: "COL_GREY"Position saved! Type "#COL_RED"/r "#COL_GREY"to teleport back!");
  615. }
  616. PPosition[playerid][SavedPosition] = 1;
  617. return 1;
  618. }
  619. //=======================================================================================================
  620. CMD:r(playerid,params[])
  621. {
  622. if(PPosition[playerid][SavedPosition] == 0) return SendClientMessage(playerid,-1, ""#COL_RED"SERVER: "COL_GREY"You don't have any position saved! "#COL_RED"(/s)");
  623. if(IsPlayerInAnyVehicle(playerid))
  624. {
  625.         SetVehiclePos(GetPlayerVehicleID(playerid),PPosition[playerid][XPos],PPosition[playerid][YPos],PPosition[playerid][ZPos]);
  626.         SetVehicleZAngle(GetPlayerVehicleID(playerid),PPosition[playerid][PAngle]);
  627.         SendClientMessage(playerid,-1, ""#COL_RED"SERVER: "COL_GREY"Position loaded!");
  628. }
  629. else
  630. {
  631.         SetPlayerPos(playerid,PPosition[playerid][XPos],PPosition[playerid][YPos],PPosition[playerid][ZPos]);
  632.         SetPlayerFacingAngle(playerid,PPosition[playerid][PAngle]);
  633.         SendClientMessage(playerid,-1, ""#COL_RED"SERVER: "COL_GREY"Position loaded!");
  634. }
  635. return 1;
  636. }
  637. //==============================
  638. //------------ADMIN-------------
  639. //==============================
  640. CMD:admins(playerid,params[])
  641. {
  642.    
  643.         new Count[2], i, string[128];
  644.         for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i))
  645.         {
  646.                 if(PlayerInfo[i][aAdmin] > 0) Count[0]++;
  647.                 if(IsPlayerAdmin(i)) Count[1]++;
  648.         }
  649.  
  650.         if( (Count[0] == 0 && Count[1] == 0) || (Count[0] == 0 && Count[1] >= 1 && PlayerInfo[playerid][aAdmin] == 0) ) return SendClientMessage(playerid, grey, "No Administrators online");
  651.  
  652.         if(Count[0] == 1) {
  653.             for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][aAdmin] > 0) {
  654.                         format(string, sizeof(string), ""#COL_GREY"Admin:"COL_CYAN" (%d)%s [%d]", i, PlayerName2(i), PlayerInfo[i][aAdmin] ); SendClientMessage(playerid, grey, string);
  655.                 }
  656.         }
  657.  
  658.         if(Count[0] > 1) {
  659.             new x; format(string, sizeof(string), ""#COL_RED"Admins:"#COL_GREY" ");
  660.             for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && PlayerInfo[i][aAdmin] > 0)
  661.                 {
  662.                         format(string,sizeof(string),""#COL_GREY"%s(%d)%s [%d]",string,i,PlayerName2(i),PlayerInfo[i][aAdmin]);
  663.                         x++;
  664.                         if(x > 5) {
  665.                             SendClientMessage(playerid, grey, string); format(string, sizeof(string), ""#COL_RED"Admins:"#COL_GREY" "); x = 0;
  666.                         }
  667.                         else format(string, sizeof(string), ""#COL_GREY"%s,  ", string);
  668.             }
  669.                 if(x <= 4 && x > 0) {
  670.                         string[strlen(string)-3] = '.';
  671.                     SendClientMessage(playerid, grey, string);
  672.                 }
  673.         }
  674.  
  675.         if( (Count[1] == 1) && (PlayerInfo[playerid][aAdmin] > 0) ) {
  676.             for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i)) {
  677.                         format(string, sizeof(string), ""#COL_RED"RCON Admin: "#COL_GREY"(%d)%s", i, PlayerName2(i)); SendClientMessage(playerid, COLOR_WHITE, string);
  678.                 }
  679.         }
  680.         if(Count[1] > 1) {
  681.                 new x; format(string, sizeof(string), ""#COL_RED"RCON Admins:"#COL_GREY" ");
  682.             for(i = 0; i < MAX_PLAYERS; i++) if(IsPlayerConnected(i) && IsPlayerAdmin(i))
  683.                 {
  684.                         format(string,sizeof(string),""#COL_GREY"%s(%d)%s",string,i,PlayerName2(i));
  685.                         x++;
  686.                         if(x > 5) {
  687.                                 SendClientMessage(playerid, COLOR_WHITE, string); format(string, sizeof(string), ""#COL_RED"RCON Admins:"#COL_GREY" "); x = 0;
  688.                         }
  689.                         else format(string, sizeof(string), ""#COL_GREY"%s,  ", string);
  690.             }
  691.                 if(x < 4 && x > 0) {
  692.                         string[strlen(string)-3] = '.';
  693.                     SendClientMessage(playerid, COLOR_WHITE, string);
  694.                 }
  695.         }
  696.         return 1;
  697. }
  698. //=======================================================================================================
  699. CMD:promote(playerid,params[])
  700. {
  701.         new id, level;
  702.         if(IsPlayerAdmin(playerid))
  703.         {
  704.                 if(sscanf(params, "ud", id, level)) return SendClientMessage(playerid, COLOR_RED, "[USAGE]: /promote [playerid/name] [level]");
  705.                 else
  706.                 {
  707.                         if(level > 5) return SendClientMessage(playerid, COLOR_RED, "Only 1-5 levels allowed.");
  708.                         else
  709.                         {
  710.                                 new string[64];
  711.                                 GetPlayerName(playerid, pName, MAX_PLAYER_NAME);
  712.                                 format(string, sizeof string, "%s has been promote to administrator level: %d.", pName, level);
  713.                                 SendClientMessageToAll(COLOR_RED, string);
  714.                                 PlayerInfo[id][aAdmin] = level;
  715.                                 GameTextForPlayer(playerid,"Congratulations. You are promoted.",3000,6);
  716.                         }
  717.                 }
  718.         }
  719.         else return SendClientMessage(playerid, COLOR_RED, "Only admins can use this command.");
  720.         return 1;
  721. }
  722.  
  723. //=======================================================================================================
  724. CMD:report(playerid,params[])
  725. {
  726.  
  727.         new Target;
  728.         new Reason[128];
  729.         if(!sscanf(params, "us[32]",Target, Reason))
  730.         {
  731.                 if(Target == playerid) return SendClientMessage(playerid, COLOR_RED, "SERVER: Cant perform this command on yourself!");
  732.                 if(!IsPlayerConnected(Target))
  733.                 return SendClientMessage(playerid, COLOR_RED, "ERROR: Player is not connected!");
  734.                 new tname[MAX_PLAYER_NAME];
  735.                 new pname[MAX_PLAYER_NAME];
  736.                 GetPlayerName(Target,tname,sizeof(tname));
  737.                 GetPlayerName(playerid,pname,sizeof(pname));
  738.                 new rstring[256];
  739.                 format(rstring,sizeof(rstring),"* Player %s(%d) reported %s(%d)! (Reason: %s)", pname,playerid,tname,Target,Reason);
  740.                 SendMessageToAdmins(COLOR_WHITE,rstring);
  741.         }
  742.         else return SendClientMessage(playerid, COLOR_YELLOW, "USAGE: /report <playerid> <reason>");
  743.         return 1;
  744. }
  745. //=======================================================================================================
  746. CMD:t(playerid,params[])
  747. {
  748.         new string[128];
  749.         if(!strlen(params))
  750.         {
  751.                 SendClientMessage(playerid, -1, ""#COL_RED"[SERVER] "#COL_GREY"/t [0-24]");
  752.                 return 1;
  753.         }
  754.         new hour = strval(params);
  755.         if(hour < 0 || hour > 24)
  756.         {
  757.        SendClientMessage(playerid, -1, ""#COL_RED"[SERVER] "#COL_GREY"/t [0-24]");
  758.        return 1;
  759.         }
  760.    SetPlayerTime(playerid, hour, 0);
  761.    format(string,sizeof(string), ""#COL_RED"[SERVER] "#COL_GREY"You changed your time to %d:00 !", hour);
  762.    SendClientMessage(playerid, -1, string);
  763.         return 1;
  764. }
  765. //=======================================================================================================
  766. CMD:w(playerid,params[])
  767. {
  768.         new string[128];
  769.         if(!strlen(params))
  770.         {
  771.                 SendClientMessage(playerid, -1, ""#COL_RED"[SERVER] "#COL_GREY"/w [0-45]");
  772.                 return 1;
  773.         }
  774.         new weather = strval(params);
  775.         if(weather < 0 || weather > 45)
  776.         {
  777.        SendClientMessage(playerid, -1, ""#COL_RED"[SERVER] "#COL_GREY"/w [0-45]");
  778.        return 1;
  779.         }
  780.    SetPlayerWeather(playerid, weather);
  781.    format(string,sizeof(string), ""#COL_RED"[SERVER] "#COL_GREY"You changed your weather to ID:%d!", weather);
  782.    SendClientMessage(playerid, -1, string);
  783.         return 1;
  784. }
  785. //=======================================================================================================
  786. CMD:vw(playerid,params[])
  787. {
  788.         new string[128];
  789.         if(!strlen(params))
  790.         {
  791.                 SendClientMessage(playerid, -1, ""#COL_RED"[SERVER] "#COL_GREY"/virtualworld [0-128]");
  792.                 return 1;
  793.         }
  794.         new world = strval(params);
  795.         if(world < 0 || world > 128)
  796.         {
  797.        SendClientMessage(playerid, -1, ""#COL_RED"[SERVER] "#COL_GREY"/virtualworld [0-128]");
  798.        return 1;
  799.         }
  800.    SetPlayerVirtualWorld(playerid, world);
  801.    format(string,sizeof(string), ""#COL_RED"[SERVER] "#COL_GREY"You changed your world to: %d!", world);
  802.    SendClientMessage(playerid, -1, string);
  803.         return 1;
  804. }
  805. //=======================================================================================================
  806. CMD:kick(playerid, params[])
  807. {
  808. if(PlayerInfo[playerid][aAdmin] > 2)  {
  809.                 new PID;
  810.                 new reason[64];
  811.                 new str[128];
  812.                 new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
  813.                 GetPlayerName(playerid, Adminname, sizeof(Adminname));
  814.                 GetPlayerName(PID, Playername, sizeof(Playername));
  815.                 if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, -1, ""#COL_RED"[SERVER]"#COL_GREY" Usage: /kick [playerid] [reason]");
  816.                 if(!IsPlayerConnected(PID))
  817.                         return SendClientMessage(playerid, -1, ""#COL_GREY"Player is not connected!");
  818.                 format(str, sizeof(str), ""#COL_RED"'%s' "COL_GREY"has been kicked by administrator "#COL_RED"'%s'. "#COL_GREY"Reason: "#COL_RED"%s ", Playername, Adminname, reason);
  819.                 SendClientMessageToAll(-1, str);
  820.                 Kick(PID);
  821.                 }
  822.                 else
  823.                 {
  824.                         SendClientMessage(playerid, -1, "You have to be level 3 to use that command!");
  825.                 }
  826. return 1;
  827. }
  828. //=======================================================================================================
  829. CMD:ban(playerid, params[])
  830. {
  831. if(PlayerInfo[playerid][aAdmin] > 3)  {
  832.         new PID;
  833.         new reason[64];
  834.         new str[128];
  835.         new Playername[MAX_PLAYER_NAME], Adminname[MAX_PLAYER_NAME];
  836.         GetPlayerName(playerid, Adminname, sizeof(Adminname));
  837.         GetPlayerName(PID, Playername, sizeof(Playername));
  838.         if(sscanf(params, "us[64]", PID,reason)) return SendClientMessage(playerid, -1, ""#COL_RED"[SERVER]"#COL_GREY" Usage: /ban [playerid] [reason]");
  839.         if(!IsPlayerConnected(PID))
  840.                 return SendClientMessage(playerid, -1, ""#COL_GREY"Player is not connected!");
  841.         format(str, sizeof(str), ""#COL_RED"'%s' "#COL_GREY"has been banned by administrator "#COL_RED"'%s'. "#COL_GREY"Reason: "#COL_RED"%s ", Playername, Adminname, reason);
  842.         SendClientMessageToAll(-1, str);
  843.         Ban(PID);
  844.         }
  845.         else
  846.         {
  847.                 SendClientMessage(playerid, -1, "You have to be level 3 to use that command!");
  848.         }
  849. return 1;
  850. }
  851. //=======================================================================================================
  852.  
  853. CMD:goto(playerid,params[])
  854. {
  855. if(!strlen(params)) return SendClientMessage(playerid,-1,""#COL_RED"[SERVER]"#COL_GREY" /goto [playerid]");
  856. new player1, Message[60], string3[128];
  857. if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid)
  858. {
  859.         new Float:x, Float:y, Float:z;  GetPlayerPos(player1,x,y,z);
  860.         SetPlayerInterior(playerid,GetPlayerInterior(player1));
  861.         SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(player1));
  862.         if(GetPlayerState(playerid) == 2)
  863.         {
  864.                 SetVehiclePos(GetPlayerVehicleID(playerid),x+3,y,z);
  865.                 LinkVehicleToInterior(GetPlayerVehicleID(playerid),GetPlayerInterior(player1));
  866.                 SetVehicleVirtualWorld(GetPlayerVehicleID(playerid),GetPlayerVirtualWorld(player1));
  867.                 } else SetPlayerPos(playerid,x+2,y,z);
  868.         format(string3, sizeof(string3), ""#COL_RED"[SERVER]"#COL_GREY" You teleported to %s", pName, Message);
  869.         SendClientMessage(playerid, -1, string3);
  870.         } else return SendClientMessage(playerid, -1, ""#COL_RED"[SERVER] "#COL_GREY"Player is not connected or is yourself");
  871. return 1;
  872. }
  873. //=======================================================================================================
  874. CMD:pm(playerid,params[])
  875. {
  876.    if(IsPlayerConnected(playerid))
  877.    {
  878.        new pID, Message[60],zplayername[MAX_PLAYER_NAME],targetName[MAX_PLAYER_NAME],string[128],string2[128];
  879.        if(sscanf(params, "us[60]", pID, Message)) return SendClientMessage(playerid, 0xAFAFAFAA, "USAGE: /pm [PlayerID/PlayerName] [Message]");
  880.        if(pID == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xAFAFAFAA, "Invalid Player");
  881.        if(PMEnabled[playerid] == 0) return SendClientMessage(playerid, 0xAFAFAFAA, "PM Is Disabled");
  882.        GetPlayerName(pID, targetName, sizeof(targetName));
  883.        GetPlayerName(playerid, zplayername, sizeof(zplayername));
  884.        format(string, sizeof(string), "Private Message from %s: %s", zplayername, Message);
  885.        format(string2, sizeof(string2), "Private Message sent to %s: %s", targetName, Message);
  886.        SendClientMessage(playerid, 0xFFFF00AA, string2);
  887.        SendClientMessage(pID, 0xFFFF00AA, string);
  888.    }
  889.    return 1;
  890. }
  891. //=======================================================================================================
  892. CMD:togpm(playerid,params[])
  893. {
  894.    if(isnull(params)) return SendClientMessage(playerid, 0xFFFFFFFF, "CMD: /togpm [on/off]");
  895.    if(strcmp(params, "on", true ) == 0 )
  896.    {
  897.        PMEnabled[playerid] = 1;
  898.        SendClientMessage(playerid, 0x00FF00FF, "You have unblocked your Personal Messaging arrival.");
  899.    }
  900.    else if( strcmp( params, "off", true ) == 0 )
  901.    {
  902.        PMEnabled[playerid] = 0;
  903.        SendClientMessage(playerid, 0xAA3333AA, "You have blocked Personal Messages from arriving.");
  904.    }
  905.    else SendClientMessage(playerid, -1,"CMD: /togpm [on/off]");
  906.    return 1;
  907. }
  908. //=======================================================================================================
  909. CMD:respawncars(playerid, params[])
  910. {
  911.    if(!PlayerInfo[playerid][aAdmin]) return SendClientMessage(playerid, -1,""#COL_RED"[SERVER]"#COL_GREY" You are not an administrator.");
  912.    for(new v; v < MAX_VEHICLES; v++)
  913.    {
  914.        for(new i; i < MAX_PLAYERS; i++)
  915.        {
  916.            if(GetPlayerVehicleID(i) == v)
  917.            {
  918.                 SetVehicleToRespawn(v);
  919.                 SendClientMessageToAll(-1,""#COL_RED"[SERVER]"#COL_GREY" All unused vehicles have been respawned by an administrator.");
  920.                 return 1;
  921.            }
  922.        }
  923.    }
  924.    return 1;
  925. }
  926. //=======================================================================================================
  927. public GetVehicleModelIDFromName(vname[])
  928. {
  929.         for(new i = 0; i < 211; i++)
  930.         {
  931.                 if ( strfind(VehicleNames[i], vname, true) != -1 )
  932.                         return i + 400;
  933.         }
  934.         return -1;
  935. }
  936. CMD:car(playerid, params[])
  937. {
  938.         new Vehicle[32], VehicleID, ColorOne, ColorTwo;
  939.         PlayerInfo[playerid][aCanSpawnVehicle] = true;
  940.         if(sscanf(params, "s[32]D(1)D(1)", Vehicle, ColorOne, ColorTwo))
  941.         {
  942.             PlayerInfo[playerid][aCanSpawnVehicle] = true;
  943.             SendClientMessage(playerid, -1,""#COL_RED"[SERVER]"#COL_GREY"/car [name/id] [colour 1] [colour 2]");
  944.             return 1;
  945.         }
  946.  
  947.         if(PlayerInfo[playerid][aCanSpawnVehicle])
  948.         {
  949.             VehicleID = GetVehicleModelIDFromName(Vehicle);
  950.             if(VehicleID != 425 && VehicleID != 432 && VehicleID != 447 &&
  951.                VehicleID != 430 && VehicleID != 417 && VehicleID != 435 &&
  952.           VehicleID != 446 && VehicleID != 449 && VehicleID != 450 &&
  953.                VehicleID != 452 && VehicleID != 453 && VehicleID != 454 &&
  954.                    VehicleID != 460 && VehicleID != 464 && VehicleID != 465 &&
  955.                    VehicleID != 469 && VehicleID != 472 && VehicleID != 473 &&
  956.                    VehicleID != 476 && VehicleID != 484 && VehicleID != 487 &&
  957.                    VehicleID != 488 && VehicleID != 493 && VehicleID != 497 &&
  958.                    VehicleID != 501 && VehicleID != 511 && VehicleID != 512 &&
  959.                    /*stuntplane - VehicleID != 513 &&*/ VehicleID != 519 && // hydra - VehicleID != 520 &&
  960.                    VehicleID != 537 && VehicleID != 538 && VehicleID != 548 &&
  961.                    VehicleID != 553 && VehicleID != 563 && VehicleID != 564 &&
  962.                    VehicleID != 569 && VehicleID != 570 && VehicleID != 577 &&
  963.                    VehicleID != 584 && VehicleID != 590 && VehicleID != 591 &&
  964.                    VehicleID != 592 && VehicleID != 593 && VehicleID != 594 &&
  965.                    VehicleID != 595 && VehicleID != 606 && VehicleID != 607 &&
  966.                    VehicleID != 608 && VehicleID != 610 && VehicleID != 611) {
  967.                         if(VehicleID == -1 )
  968.                         {
  969.                                 VehicleID = strval(Vehicle);
  970.  
  971.                                 if(VehicleID < 400 || VehicleID > 611 )
  972.                                 {
  973.                                         return SendClientMessage(playerid, -1,""#COL_RED"[SERVER]"#COL_GREY"You entered an invalid vehiclename!");
  974.                                 }
  975.                         }
  976.  
  977.                         GetPlayerPos(playerid, pX, pY, pZ);
  978.                         GetPlayerFacingAngle(playerid, pAngle);
  979.  
  980.                         DestroyVehicle(PlayerInfo[playerid][aSpawnVehicle]);
  981.                         PlayerInfo[playerid][aSpawnVehicle] = CreateVehicle(VehicleID, pX, pY, pZ+2.0, pAngle, ColorOne, ColorTwo, -1);
  982.                         LinkVehicleToInterior(PlayerInfo[playerid][aSpawnVehicle], GetPlayerInterior(playerid));
  983.                         PutPlayerInVehicle(playerid, PlayerInfo[playerid][aSpawnVehicle], 0);
  984.                         SendClientMessage(playerid, -1, ""#COL_RED"[SERVER]"#COL_GREY"You succesfully spawned this vehicle!");
  985.                 }
  986.         }
  987.         return 1;
  988. }
  989. //=======================================================================================================
  990. CMD:spam(playerid, params[])
  991. {
  992.    if(PlayerInfo[playerid][aAdmin] > 1)
  993.    {
  994.        new Colour, msg[128],string[128];
  995.        if(sscanf(params, "is[128]", Colour, msg)) {
  996.        SendClientMessage(playerid, -1, ""#COL_RED"Usage: /spam [Colour] [Text]");
  997.        SendClientMessage(playerid, -1, ""#COL_GREY"Colours: [0]Black, [1]White, [2]Red, [3]Orange, [4]Yellow, [5]Green, [6]Blue, [7]Purple, [8]Brown, [9]Pink");
  998.        SendClientMessage(playerid, -1, ""#COL_GREY"Function: Will sending many messages in chat in specified Colour");
  999.        return 1; }
  1000.        if(Colour > 9) return SendClientMessage(playerid, COLOR_RED, "Colours: ....");
  1001.        format(string,sizeof(string),"%s",msg);
  1002.  
  1003.        if(Colour == 0)      for(new i; i < 50; i++) SendClientMessageToAll(COLOR_BLACK,string);
  1004.        else if(Colour == 1) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_WHITE,string);
  1005.        else if(Colour == 2) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_RED,string);
  1006.        else if(Colour == 3) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_ORANGE,string);
  1007.        else if(Colour == 4) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_YELLOW,string);
  1008.        else if(Colour == 5) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_GREEN,string);
  1009.        else if(Colour == 6) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_BLUE,string);
  1010.        else if(Colour == 7) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_PURPLE,string);
  1011.        else if(Colour == 8) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_LIGHTBLUE,string);
  1012.        else if(Colour == 9) for(new i; i < 50; i++) SendClientMessageToAll(COLOR_PINK,string);
  1013.        return 1;
  1014.    }
  1015.    SendClientMessage(playerid, -1, ""#COL_RED"[SERVER] "#COL_GREY"Error: You must be an administrator to do that.");
  1016.    return 1;
  1017. }
  1018.  
  1019. public OnPlayerCommandText(playerid,cmdtext[])
  1020. {
  1021. return SendClientMessage(playerid, -1, ""#COL_RED"[SERVER] "#COL_GREY"Sorry! That command doesn't exist!");
  1022. }
  1023. //==============================
  1024. //---------DIALOGS-------------
  1025. //==============================
  1026. public OnDialogResponse(playerid, dialogid, response, listitem, inputtext[])
  1027. {
  1028.    switch( dialogid )
  1029.    {
  1030.        case DIALOG_REGISTER:
  1031.        {
  1032.            if (!response) return Kick(playerid);
  1033.            if(response)
  1034.            {
  1035.                if(!strlen(inputtext)) return ShowPlayerDialog(playerid, DIALOG_REGISTER, DIALOG_STYLE_INPUT, ""COL_CYAN"Registering...",""COL_RED"You have entered an invalid password.\n"COL_GREY"Type your password below to register a new account.","Register","Quit");
  1036.                new INI:File = INI_Open(UserPath(playerid));
  1037.                INI_SetTag(File,"data");
  1038.                INI_WriteInt(File,"aPassword",udb_hash(inputtext));
  1039.                INI_WriteInt(File,"aCash",0);
  1040.                INI_WriteInt(File,"aAdmin",0);
  1041.                INI_WriteInt(File,"aKills",0);
  1042.                INI_WriteInt(File,"aDeaths",0);
  1043.                INI_Close(File);
  1044.                ShowPlayerDialog(playerid, DIALOG_SUCCESS_1, DIALOG_STYLE_MSGBOX,""COL_CYAN"Success!",""COL_GREY"Great! You have sucessfully registered. Relog to save your stats!","Ok","");
  1045.                         }
  1046.        }
  1047.  
  1048.        case DIALOG_LOGIN:
  1049.        {
  1050.            if ( !response ) return Kick ( playerid );
  1051.            if( response )
  1052.            {
  1053.                if(udb_hash(inputtext) == PlayerInfo[playerid][aPass])
  1054.                {
  1055.                    INI_ParseFile(UserPath(playerid), "LoadUser_%s", .bExtra = true, .extra = playerid);
  1056.                    GivePlayerMoney(playerid, PlayerInfo[playerid][aCash]);
  1057.                                         ShowPlayerDialog(playerid, DIALOG_SUCCESS_2, DIALOG_STYLE_MSGBOX,""COL_CYAN"Success!",""COL_GREY"You have successfully logged in!","Ok","");
  1058.                }
  1059.                else
  1060.                {
  1061.                    ShowPlayerDialog(playerid, DIALOG_LOGIN, DIALOG_STYLE_INPUT,""COL_CYAN"Login",""COL_RED"You have entered an incorrect password.\n"COL_GREY"Type your password below to login.","Login","Quit");
  1062.                }
  1063.                return 1;
  1064.            }
  1065.        }
  1066.         case 354:
  1067.                 {
  1068.                 if(!response) return SendClientMessage(playerid, COLOR_WHITE, "You have exited the player list.");
  1069.                         switch(listitem) {
  1070.                             case 0:
  1071.                                     PlayAudioStreamForPlayer(playerid, ""station1stream""),
  1072.                                     SendClientMessage(playerid, COLOR_WHITE, ""red"SERVER: "yellow"Type /radiostop to stop audio streaming.");
  1073.                                 case 1:
  1074.                                     PlayAudioStreamForPlayer(playerid, ""station2stream""),
  1075.                                     SendClientMessage(playerid, COLOR_WHITE, ""red"SERVER: "yellow"Type /radiostop to stop audio streaming.");
  1076.                                 case 2:
  1077.                                     PlayAudioStreamForPlayer(playerid, ""station3stream""),
  1078.                                     SendClientMessage(playerid, COLOR_WHITE, ""red"SERVER: "yellow"Type /radiostop to stop audio streaming.");
  1079.                                 case 3:
  1080.                                     PlayAudioStreamForPlayer(playerid, ""station4stream""),
  1081.                                     SendClientMessage(playerid, COLOR_WHITE, ""red"SERVER: "yellow"Type /radiostop to stop audio streaming.");
  1082.                                 case 4:
  1083.                                     PlayAudioStreamForPlayer(playerid, ""station5stream""),
  1084.                                     SendClientMessage(playerid, COLOR_WHITE, ""red"SERVER: "yellow"Type /radiostop to stop audio streaming.");
  1085.                                 case 5:
  1086.                                     PlayAudioStreamForPlayer(playerid, ""station6stream""),
  1087.                                     SendClientMessage(playerid, COLOR_WHITE, ""red"SERVER: "yellow"Type /radiostop to stop audio streaming.");
  1088.                                 case 6:
  1089.                                     PlayAudioStreamForPlayer(playerid, ""station7stream""),
  1090.                                     SendClientMessage(playerid, COLOR_WHITE, ""red"SERVER: "yellow"Type /radiostop to stop audio streaming.");
  1091.                                                         }
  1092.                 }
  1093.    }
  1094.    return 1;
  1095. }