Guest User

0.5 DEventSystem

a guest
Sep 15th, 2013
311
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 27.96 KB | None | 0 0
  1. /*
  2.  
  3. -* ChangeLog
  4.  
  5. -* 0.1 Release
  6.  
  7. -* 0.2 Nick the player does not appear when you type /Event ( Bug Fixed )
  8. -* 0.2 Small change in the code in itself.
  9.  
  10.  
  11. -* 0.3 Added the command /ExitEvent
  12. -* 0.3 Now the player who is not at the event can then use the same command again.
  13.  
  14. -* 0.4 Updated bug fixed not existent command.
  15.  
  16.  
  17. -* 0.5 Added the commands /first [id] /second [id] /third [id] /espawn
  18. -* 0.5 Now players who die in the event will get the message to all
  19. -* 0.5 Colors Random for players entering the event
  20. -* 0.5 Name added to the cars when the player between them
  21. -* 0.5 Added the command /Esetweather [ id ]
  22.  
  23. */
  24.  
  25. #include <a_samp>
  26. #include <zcmd>
  27. #include <sscanf2>
  28. // =============================================================================
  29. new bool:EvenTStats , bool:TheEvenT[ MAX_PLAYERS ] , Float:EventoPos [ 4 ] , EventoInt , EventoVW , bool:EventoRecarregarLife = false , iString2[129+1] ;
  30.  
  31. new ColorsNicks [ 51 ] =
  32. {
  33.     0xFF8C13AA,0xC715FFAA,0x20B2AAAA,0xDC143CAA,0x6495EDAA,
  34.     0xf0e68cAA,0x778899AA,0xFF1493AA,0xF4A460AA,0xEE82EEAA,
  35.     0xFFD720AA,0x8b4513AA,0x4949A0AA,0x148b8bAA,0x14ff7fAA,
  36.     0x556b2fAA,0x0FD9FAAA,0x10DC29AA,0x534081AA,0x0495CDAA,
  37.     0xEF6CE8AA,0xBD34DAAA,0x247C1BAA,0x0C8E5DAA,0x635B03AA,
  38.     0xCB7ED3AA,0x65ADEBAA,0x5C1ACCAA,0xF2F853AA,0x11F891AA,
  39.     0x7B39AAAA,0x53EB10AA,0x54137DAA,0x275222AA,0xF09F5BAA,
  40.     0x3D0A4FAA,0x22F767AA,0xD63034AA,0x9A6980AA,0xDFB935AA,
  41.     0x3793FAAA,0x90239DAA,0xE9AB2FAA,0xAF2FF3AA,0x057F94AA,
  42.     0xB98519AA,0x388EEAAA,0x028151AA,0xA55043AA,0x1A30BFAA
  43. };
  44.  
  45. new VehicleNames [ 212 ] [ ] =
  46. {
  47.     "Landstalker","Bravura","Buffalo","Linerunner","Pereniel","Sentinel","Dumper","Firetruck","Trashmaster","Stretch","Manana","Infernus" , "Voodoo","Pony","Mule","Cheetah","Ambulance","Leviathan","Moonbeam","Esperanto","Taxi","Washington","Bobcat","Mr Whoopee","BF Injection",
  48.     "Hunter","Premier","Enforcer","Securicar","Banshee","Predator","Bus","Rhino","Barracks","Hotknife","Trailer","Previon","Coach","Cabbie" , "Stallion","Rumpo","RC Bandit","Romero","Packer","Monster","Admiral","Squalo","Seasparrow","Pizzaboy","Tram","Trailer","Turismo","Speeder",
  49.     "Reefer","Tropic","Flatbed","Yankee","Caddy","Solair","Berkley's RC Van","Skimmer","PCJ-600","Faggio","Freeway","RC Baron","RC Raider" , "Glendale","Oceanic","Sanchez","Sparrow","Patriot","Quad","Coastguard","Dinghy","Hermes","Sabre","Rustler","ZR3 50","Walton","Regina",
  50.     "Comet","BMX","Burrito","Camper","Marquis","Baggage","Dozer","Maverick","News Chopper","Rancher","FBI Rancher","Virgo","Greenwood" , "Jetmax","Hotring","Sandking","Blista Compact","Police Maverick","Boxville","Benson","Mesa","RC Goblin","Hotring Racer A","Hotring Racer B",
  51.     "Bloodring Banger","Rancher","Super GT","Elegant","Journey","Bike","Mountain Bike","Beagle","Cropdust","Stunt","Tanker","RoadTrain" , "Nebula","Majestic","Buccaneer","Shamal","Hydra","FCR-900","NRG-500","HPV1000","Cement Truck","Tow Truck","Fortune","Cadrona","FBI Truck",
  52.     "Willard","Forklift","Tractor","Combine","Feltzer","Remington","Slamvan","Blade","Freight","Streak","Vortex","Vincent","Bullet","Clover" , "Sadler","Firetruck","Hustler","Intruder","Primo","Cargobob","Tampa","Sunrise","Merit","Utility","Nevada","Yosemite","Windsor","Monster A",
  53.     "Monster B","Uranus","Jester","Sultan","Stratum","Elegy","Raindance","RC Tiger","Flash","Tahoma","Savanna","Bandito","Freight","Trailer" , "Kart","Mower","Duneride","Sweeper","Broadway","Tornado","AT-400","DFT-30","Huntley","Stafford","BF-400","Newsvan","Tug","Trailer A","Emperor",
  54.     "Wayfarer","Euros","Hotdog","Club","Trailer B","Trailer C","Andromada","Dodo","RC Cam","Launch","Police Car (LSPD)","Police Car (SFPD)" , "Police Car (LVPD)","Police Ranger","Picador","S.W.A.T. Van","Alpha","Phoenix","Glendale","Sadler","Luggage Trailer A","Luggage Trailer B",
  55.     "Stair Trailer","Boxville","Farm Plow","Utility Trailer"
  56. };
  57. // =============================================================================
  58. #define version                                                                 "0.4"
  59. //==============================================================================
  60. forward Count(Contagem);
  61. // =============================================================================
  62. public OnFilterScriptInit()
  63. {
  64.     print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  65.     print("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t");
  66.     print("TEventSystem Made By : Tw0.P4c__. Or Diogo123");
  67.     print("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n");
  68.     print("\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t");
  69.     print("Load Version : "version"");
  70.     return 1;
  71. }
  72. // =============================================================================
  73. public OnFilterScriptExit() return print("UnLoad");
  74. public OnPlayerConnect(playerid) return TheEvenT [ playerid ] = false ;
  75. public OnPlayerDisconnect(playerid, reason) return TheEvenT [ playerid ] = false ;
  76. public OnPlayerSpawn(playerid) return TheEvenT [ playerid ] = false ;
  77. // =============================================================================
  78. public OnPlayerStateChange(playerid, newstate, oldstate)
  79. {
  80.     if ( newstate == PLAYER_STATE_DRIVER && oldstate != PLAYER_STATE_DRIVER )
  81.     {
  82.         new str [ 50 ] ;
  83.         format ( str , sizeof ( str ) , "~r~%s" , VehicleNames [ GetVehicleModel ( GetPlayerVehicleID ( playerid ) ) -400 ] ) ;
  84.         GameTextForPlayer ( playerid , str , 6000 , 1 ) ;
  85.     }
  86.     return 1;
  87. }
  88. // =============================================================================
  89. public OnPlayerDeath(playerid, killerid, reason)
  90. {
  91.     TheEvenT [ playerid ] = false ;
  92.    
  93.     for ( new v , b = GetMaxPlayers(); v != b; v++ )
  94.     {
  95.         if ( TheEvenT [ v ] )
  96.         {
  97.             format ( iString2 , sizeof ( iString2 ) , "{FFFFFF}The Player {FF230A}%s{FFFFFF}({FF230A}ID:%d{FFFFFF}) Died in the event.", GetPName ( playerid ) , playerid ) ;
  98.             SendClientMessageToAll ( -1 , iString2 ) ;
  99.             SendDeathMessage ( killerid , playerid , reason ) ;
  100.         }
  101.     }
  102.    
  103.     if ( TheEvenT [ killerid ] == true )
  104.     {
  105.         if ( EventoRecarregarLife == true )
  106.         {
  107.             SetPlayerHealth ( killerid , 100.0 ) ;
  108.             SetPlayerArmour ( killerid , 100.0 ) ;
  109.         }
  110.     }
  111.     return 1;
  112. }
  113. // ================================= [ EVENT SYSTEM ] ==========================
  114. CMD:openevent(playerid)
  115. {
  116.     if ( EvenTStats )
  117.         return SendClientMessage ( playerid , 0x00C0FFFF , "The event is already open." ) ;
  118.  
  119.     if ( !IsPlayerAdmin ( playerid ) )
  120.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  121.  
  122.     EvenTStats = true;
  123.     TheEvenT[playerid] = true;
  124.     GetPlayerPos ( playerid , EventoPos [ 0 ] , EventoPos [ 1 ] , EventoPos [ 2 ] ) ;
  125.     GetPlayerFacingAngle ( playerid , EventoPos [ 3 ] ) ;
  126.     EventoInt = GetPlayerInterior ( playerid ) ;
  127.     EventoVW = GetPlayerVirtualWorld ( playerid ) ;
  128.  
  129.     SendClientMessageToAll ( 0xFFFFFFFF," " ) ;
  130.     SendClientMessageToAll ( 0xFF00FFFF,"[ EVENT ] : EVENT OPEN BY ADMIN ENTER ' /EVENT ' !" ) ;
  131.     SendClientMessageToAll ( 0xFFFFFFFF," " ) ;
  132.  
  133.     return 1;
  134. }
  135. // =============================================================================
  136. CMD:eclose(playerid)
  137. {
  138.     if ( !EvenTStats )
  139.         return SendClientMessage ( playerid , 0x00C0FFFF , "The event is already closed." ) ;
  140.  
  141.     if ( !IsPlayerAdmin ( playerid ) )
  142.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  143.  
  144.     for ( new v , b = GetMaxPlayers(); v != b; v++ )
  145.     {
  146.         if ( TheEvenT [ v ] )
  147.         {
  148.             TheEvenT [ v ] = true ;
  149.             EvenTStats = false ;
  150.         }
  151.     }
  152.     return 1;
  153. }
  154. // =============================================================================
  155. CMD:frist(playerid,params[])
  156. {
  157.     new ID;
  158.    
  159.     if ( !EvenTStats )
  160.         return SendClientMessage ( playerid , 0x00C0FFFF , "The event is already closed." ) ;
  161.    
  162.     if ( !IsPlayerAdmin ( playerid ) )
  163.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  164.        
  165.     if ( sscanf ( params , "i", ID ) )
  166.         return SendClientMessage ( playerid , -1 ,"{F81414}/Frist [ ID ]" ) ;
  167.        
  168.     if ( !IsPlayerConnected ( ID ) )
  169.         return SendClientMessage ( playerid , -1 , "{F81414}Player is not connected" ) ;
  170.        
  171.     if ( !TheEvenT [ ID ] )
  172.         return SendClientMessage ( playerid , 0x00C0FFFF , "This player is not in the event." ) ;
  173.    
  174.     format ( iString2 , sizeof ( iString2 ) , "{FFFFFF}The first was placed {FF230A} %s ({FF230A}ID:%d{FFFFFF})!!!", GetPName ( playerid ) , playerid ) ;
  175.     SendClientMessageToAll ( -1 , iString2 ) ;
  176.    
  177.     SendClientMessage ( ID , -1 , "You took first place and received R$ 5.000!" ) ;
  178.     GivePlayerMoney ( ID , 5000 ) ;
  179.     return 1;
  180. }
  181. // =============================================================================
  182. CMD:second(playerid,params[])
  183. {
  184.     new ID;
  185.    
  186.     if ( !EvenTStats )
  187.         return SendClientMessage ( playerid , 0x00C0FFFF , "The event is already closed." ) ;
  188.  
  189.     if ( !IsPlayerAdmin ( playerid ) )
  190.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  191.  
  192.     if ( sscanf ( params , "i", ID ) )
  193.         return SendClientMessage ( playerid , -1 ,"{F81414}/Frist [ ID ]" ) ;
  194.  
  195.     if ( !IsPlayerConnected ( ID ) )
  196.         return SendClientMessage ( playerid , -1 , "{F81414}Player is not connected" ) ;
  197.  
  198.     if ( !TheEvenT [ ID ] )
  199.         return SendClientMessage ( playerid , 0x00C0FFFF , "This player is not in the event." ) ;
  200.    
  201.     format ( iString2 , sizeof ( iString2 ) , "{FFFFFF}The second was placed {FF230A} %s ({FF230A}ID:%d{FFFFFF})!!!", GetPName ( playerid ) , playerid ) ;
  202.     SendClientMessageToAll ( -1 , iString2 ) ;
  203.    
  204.     SendClientMessage (ID , -1 , "You took second place and received R$ 2.500!" ) ;
  205.     GivePlayerMoney ( ID , 2500 ) ;
  206.     return 1;
  207. }
  208. // =============================================================================
  209. CMD:third(playerid,params[])
  210. {
  211.     new ID;
  212.    
  213.     if ( !EvenTStats )
  214.         return SendClientMessage ( playerid , 0x00C0FFFF , "The event is already closed." ) ;
  215.  
  216.     if ( !IsPlayerAdmin ( playerid ) )
  217.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  218.  
  219.     if ( sscanf ( params , "i", ID ) )
  220.         return SendClientMessage ( playerid , -1 ,"{F81414}/Frist [ ID ]" ) ;
  221.  
  222.     if ( !IsPlayerConnected ( ID ) )
  223.         return SendClientMessage ( playerid , -1 , "{F81414}Player is not connected" ) ;
  224.  
  225.     if ( !TheEvenT [ ID ] )
  226.         return SendClientMessage ( playerid , 0x00C0FFFF , "This player is not in the event." ) ;
  227.  
  228.    
  229.     format ( iString2 , sizeof ( iString2 ) , "{FFFFFF}The third was placed {FF230A} %s ({FF230A}ID:%d{FFFFFF})!!!", GetPName ( playerid ) , playerid ) ;
  230.     SendClientMessageToAll ( -1 , iString2 ) ;
  231.    
  232.     SendClientMessage ( ID , -1 , "You came in third place and received R$ 1.000!" ) ;
  233.     GivePlayerMoney ( ID , 1000 ) ;
  234.     return 1;
  235. }
  236.  
  237.  
  238. // =============================================================================
  239. CMD:espawn(playerid)
  240. {
  241.     if ( !EvenTStats )
  242.         return SendClientMessage ( playerid , 0x00C0FFFF , "The event is already closed." ) ;
  243.  
  244.     if ( !IsPlayerAdmin ( playerid ) )
  245.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  246.  
  247.     for ( new v , b = GetMaxPlayers(); v != b; v++ )
  248.     {
  249.         if ( TheEvenT [ v ] )
  250.         {
  251.             SpawnPlayer ( v ) ;
  252.             ResetPlayerWeapons ( v ) ;
  253.            
  254.             format ( iString2 , sizeof ( iString2 ) , "The Admin {FF230A}%s{FFFFFF} ({FF230A}ID:%d{FFFFFF}) Gave spawn in every event {FF230A}Event", GetPName ( playerid ) , playerid ) ;
  255.             SendClientMessageToAll ( -1 , iString2 ) ;
  256.         }
  257.     }
  258.     return 1;
  259. }
  260. // =============================================================================
  261. CMD:exitevent(playerid)
  262. {
  263.     if ( TheEvenT [ playerid ] == true )
  264.     {
  265.         new Float:Health;
  266.         GetPlayerHealth ( playerid , Health ) ;
  267.  
  268.         if ( Health < 30.0 )
  269.             return SendClientMessage ( playerid, 0xFF0000FF, "{F81414}[ERROR] Your life is too low." ) ;
  270.            
  271.         SpawnPlayer ( playerid ) ;
  272.        
  273.         ResetPlayerWeapons ( playerid ) ;
  274.        
  275.         TheEvenT [ playerid ] = false ;
  276.        
  277.         SetPlayerVirtualWorld ( playerid , 0 ) ;
  278.        
  279.         SetPlayerInterior ( playerid , 0 ) ;
  280.        
  281.         ResetPlayerWeapons ( playerid ) ;
  282.        
  283.         PlayerPlaySound ( playerid , 1057 , 0.0 , 0.0 , 0.0 ) ;
  284.     }
  285.     return 1;
  286. }
  287. // =============================================================================
  288. CMD:esetweather(playerid,params[])
  289. {
  290.     if ( !EvenTStats )
  291.         return SendClientMessage ( playerid , 0x00C0FFFF , "The event is already closed." ) ;
  292.  
  293.     if ( !IsPlayerAdmin ( playerid ) )
  294.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  295.        
  296.     new
  297.         weather
  298.     ;
  299.    
  300.     if ( sscanf ( params ,"i" , weather ) )
  301.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}/Esetweather (weather)" ) ;
  302.        
  303.     for ( new v, b = GetMaxPlayers(); v != b; v++ )
  304.     {
  305.         if ( TheEvenT [ v ] )
  306.         {
  307.             SetPlayerWeather ( v , weather ) ;
  308.         }
  309.     }
  310.     return 1;
  311. }
  312. // =============================================================================
  313. CMD:event(playerid)
  314. {
  315.     if ( TheEvenT [ playerid ] == true )
  316.         return SendClientMessage ( playerid , 0x9FFF00FF , "{F81414}[ERROR]: You can not enter commands in event, type /ExitEvent out!" ) ;
  317.        
  318.     if ( !EvenTStats )
  319.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}[ERROR]: The event is not open." ) ;
  320.  
  321.     new Float:Health;
  322.     GetPlayerHealth ( playerid , Health ) ;
  323.  
  324.     if ( Health < 30.0 )
  325.         return SendClientMessage ( playerid, 0xFF0000FF, "{F81414}[ERROR] You can not teleport with little life." ) ;
  326.  
  327.     TheEvenT [ playerid ] = true ;
  328.     ResetPlayerWeapons ( playerid ) ;
  329.    
  330.     format ( iString2 , sizeof ( iString2 ) , "{FFFFFF}' %s ' {F81414}It was for the event {FFFFFF}( /EVENT )", GetPName ( playerid ) ) ;
  331.     SendClientMessageToAll ( 0x88FF9FFF , iString2 ) ;
  332.    
  333.     SetPlayerPos ( playerid , EventoPos [ 0 ] , EventoPos [ 1 ] , EventoPos [ 2 ] ) ;
  334.     SetPlayerFacingAngle ( playerid , EventoPos [ 3 ] ) ;
  335.     SetPlayerInterior ( playerid , EventoInt ) ;
  336.     SetPlayerVirtualWorld ( playerid , EventoVW ) ;
  337.    
  338.     SetPlayerColor ( playerid , ColorsNicks [ playerid ] ) ;
  339.  
  340.     return 1;
  341. }
  342. // =============================================================================
  343. CMD:ecar(playerid, params[])
  344. {
  345.     if ( !EvenTStats )
  346.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}[ERROR]: The event is not open." ) ;
  347.  
  348.     if ( !IsPlayerAdmin ( playerid ) )
  349.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  350.  
  351.     new
  352.         Modelo,
  353.         Cor1,
  354.         Cor2
  355.     ;
  356.  
  357.     if ( sscanf ( params , "ddd" , Modelo , Cor1 , Cor2 ) )
  358.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}/Ecar [ ID ] [ IDCOLOR1 ] [ IRCOLOR2 ]" ) ;
  359.  
  360.     new Float:CarPos[4], CarID;
  361.  
  362.     for ( new v, b = GetMaxPlayers(); v != b; v++ )
  363.     {
  364.         if ( TheEvenT [ v ] )
  365.         {
  366.             GetPlayerFacingAngle ( v , CarPos [ 3 ] ) ;
  367.             GetPlayerPos ( v , CarPos [ 0 ] , CarPos [ 1 ] , CarPos [ 2 ] ) ;
  368.             CarID = CreateVehicle ( Modelo , CarPos [ 0 ] +2 , CarPos [ 1 ] , CarPos [ 2 ] , CarPos [ 3 ] , Cor1 , Cor2 , 0x00C0FFFF ) ;
  369.             LinkVehicleToInterior ( CarID , EventoInt ) ;
  370.             SetVehicleVirtualWorld ( CarID , EventoVW ) ;
  371.             PutPlayerInVehicle ( v , CarID , 0 ) ;
  372.         }
  373.     }
  374.     return 1;
  375. }
  376. // =============================================================================
  377. CMD:eweapon(playerid, params[])
  378. {
  379.     if ( !EvenTStats )
  380.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}[ERROR]: The event is not open." ) ;
  381.  
  382.     if ( !IsPlayerAdmin ( playerid ) )
  383.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  384.  
  385.     new
  386.         Arma,
  387.         Municao
  388.     ;
  389.  
  390.     if ( sscanf ( params , "dd" , Arma , Municao ) )
  391.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}/Eweapon [ WEAPON ID ] [ AMMUNITION ]" ) ;
  392.  
  393.     for ( new v, b = GetMaxPlayers(); v != b; v++ )
  394.     {
  395.         if ( TheEvenT [ v ] )
  396.         {
  397.             GivePlayerWeapon ( v , Arma , Municao ) ;
  398.         }
  399.     }
  400.     return 1;
  401. }
  402. // =============================================================================
  403. CMD:earmour(playerid, params[])
  404. {
  405.     if ( !EvenTStats )
  406.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}[ERROR]: The event is not open." ) ;
  407.  
  408.     if ( !IsPlayerAdmin ( playerid ) )
  409.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  410.  
  411.     new Float:Colete;
  412.  
  413.     if ( sscanf ( params , "f", Colete ) )
  414.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}/Earmor [ 0 - 100 ]" ) ;
  415.  
  416.     for ( new v, b = GetMaxPlayers(); v != b; v++ )
  417.     {
  418.         if ( TheEvenT [ v ] )
  419.         {
  420.             SetPlayerArmour ( v , Colete ) ;
  421.         }
  422.     }
  423.     return 1;
  424. }
  425. // =============================================================================
  426. CMD:ekitrun(playerid, params[])
  427. {
  428.     if ( !EvenTStats )
  429.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}[ERROR]: The event is not open." ) ;
  430.  
  431.     if ( !IsPlayerAdmin ( playerid ) )
  432.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  433.  
  434.     for ( new v, b = GetMaxPlayers(); v != b; v++ )
  435.     {
  436.         if ( TheEvenT [ v ] )
  437.         {
  438.             GivePlayerWeapon( v , 22 , 150);
  439.             GivePlayerWeapon( v , 26 , 150);
  440.             GivePlayerWeapon( v , 28 , 150);
  441.             ResetPlayerWeapons( v );
  442.             GivePlayerWeapon( v , 22 , 150);
  443.             GivePlayerWeapon( v , 26 , 150);
  444.             GivePlayerWeapon( v , 28 , 150);
  445.         }
  446.     }
  447.     return 1;
  448. }
  449. // =============================================================================
  450. CMD:ereclife(playerid, params[])
  451. {
  452.     if ( !EvenTStats )
  453.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}[ERROR]: The event is not open." ) ;
  454.  
  455.     if ( !IsPlayerAdmin ( playerid ) )
  456.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  457.  
  458.     if(EventoRecarregarLife == false)
  459.     {
  460.         EventoRecarregarLife = true;
  461.         SendClientMessage(playerid, -1, "The players who kill in the event will have the life vest or restored");
  462.     }
  463.         else
  464.     {
  465.         EventoRecarregarLife = false;
  466.         SendClientMessage(playerid,-1, "The players who kill in the event does not have the life vest or restored");
  467.     }
  468.     for ( new i, b = GetMaxPlayers(); i != b; i++ )
  469.     {
  470.         if ( TheEvenT [ i ] )
  471.         {
  472.             GameTextForPlayer(playerid,"~n~~n~~n~~n~~n~~n~~r~TO KILL ALL RECHARGE LIFE AND ARMOUR!", 5000, 5);
  473.         }
  474.     }
  475.     return 1;
  476. }
  477. // =============================================================================
  478. CMD:ekitwalk(playerid, params[])
  479. {
  480.     if ( !EvenTStats )
  481.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}[ERROR]: The event is not open." ) ;
  482.  
  483.     if ( !IsPlayerAdmin ( playerid ) )
  484.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  485.  
  486.     for ( new v, b = GetMaxPlayers(); v != b; v++ )
  487.     {
  488.         if ( TheEvenT [ v ] )
  489.         {
  490.             GivePlayerWeapon( v , 24 , 150);
  491.             GivePlayerWeapon( v , 25 , 150);
  492.             GivePlayerWeapon( v , 34 , 150);
  493.             ResetPlayerWeapons( v );
  494.             GivePlayerWeapon( v , 24 , 150);
  495.             GivePlayerWeapon( v , 25 , 150);
  496.             GivePlayerWeapon( v , 34 , 150);
  497.         }
  498.     }
  499.     return 1;
  500. }
  501. // =============================================================================
  502. CMD:ekitgrenades(playerid, params[])
  503. {
  504.     if ( !EvenTStats )
  505.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}[ERROR]: The event is not open." ) ;
  506.  
  507.     if ( !IsPlayerAdmin ( playerid ) )
  508.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  509.  
  510.     for ( new v, b = GetMaxPlayers(); v != b; v++ )
  511.     {
  512.         if ( TheEvenT [ v ] )
  513.         {
  514.             GivePlayerWeapon( v , 16 , 250);
  515.             ResetPlayerWeapons( v );
  516.             GivePlayerWeapon( v , 16 , 250);
  517.         }
  518.     }
  519.     return 1;
  520. }
  521. // =============================================================================
  522. CMD:evw(playerid, params[])
  523. {
  524.     if ( !EvenTStats )
  525.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}[ERROR]: The event is not open." ) ;
  526.  
  527.     if ( !IsPlayerAdmin ( playerid ) )
  528.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  529.  
  530.     new world;
  531.  
  532.     if ( sscanf ( params , "i" , world ) )
  533.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}/Evw [ World ]" ) ;
  534.  
  535.     for ( new v, b = GetMaxPlayers(); v != b; v++ )
  536.     {
  537.         if ( TheEvenT [ v ] )
  538.         {
  539.             SetPlayerVirtualWorld ( v , world ) ;
  540.         }
  541.     }
  542.     return 1;
  543. }
  544. // =============================================================================
  545. CMD:elife(playerid, params[])
  546. {
  547.     if ( !EvenTStats )
  548.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}[ERROR]: The event is not open." ) ;
  549.  
  550.     if ( !IsPlayerAdmin ( playerid ) )
  551.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  552.  
  553.     new Float:Vida;
  554.     if ( sscanf ( params , "f" , Vida ) )
  555.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}/Elife [ 0 - 100 ]" ) ;
  556.  
  557.     for ( new v, b = GetMaxPlayers(); v != b; v++ )
  558.     {
  559.         if ( TheEvenT [ v ] )
  560.         {
  561.             SetPlayerHealth ( v , Vida ) ;
  562.         }
  563.     }
  564.     return 1;
  565. }
  566. // =============================================================================
  567. CMD:count(playerid)
  568. {
  569.     if ( !EvenTStats )
  570.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}[ERROR]: The event is not open." ) ;
  571.  
  572.     if ( !IsPlayerAdmin ( playerid ) )
  573.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  574.  
  575.     Count ( 5 ) ;
  576.     return 1;
  577. }
  578. // =============================================================================
  579. CMD:ekick(playerid, params[])
  580. {
  581.     if ( !EvenTStats )
  582.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}[ERROR]: The event is not open." ) ;
  583.  
  584.     if ( !IsPlayerAdmin ( playerid ) )
  585.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  586.  
  587.     new ID;
  588.     if ( sscanf ( params , "r" , ID ) )
  589.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}/Ekick [ ID ]" ) ;
  590.  
  591.     if ( !TheEvenT [ ID ] )
  592.         return SendClientMessage ( playerid , 0x00C0FFFF , "This player is not in the event." ) ;
  593.  
  594.     SpawnPlayer ( ID ) ;
  595.     SendClientMessage ( ID , 0x00C0FFFF , "[INFO]: You have been kicked from the event." ) ;
  596.     TheEvenT [ ID ] = false ;
  597.     return 1;
  598. }
  599. // =============================================================================
  600. CMD:efreeze(playerid)
  601. {
  602.     if ( !EvenTStats )
  603.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}[ERROR]: The event is not open." ) ;
  604.  
  605.     if ( !IsPlayerAdmin ( playerid ) )
  606.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  607.  
  608.     for ( new v, b = GetMaxPlayers(); v != b; v++ )
  609.     {
  610.         if ( TheEvenT [ v ] )
  611.         {
  612.             TogglePlayerControllable ( v , false ) ;
  613.         }
  614.     }
  615.     return 1;
  616. }
  617. // =============================================================================
  618. CMD:edefrost(playerid)
  619. {
  620.     if ( !EvenTStats )
  621.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}[ERROR]: The event is not open." ) ;
  622.  
  623.     if ( !IsPlayerAdmin ( playerid ) )
  624.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  625.  
  626.     for ( new v, b = GetMaxPlayers(); v != b; v++ )
  627.     {
  628.         if ( TheEvenT [ v ] )
  629.         {
  630.             TogglePlayerControllable ( v , true ) ;
  631.         }
  632.     }
  633.     return 1;
  634. }
  635. // =============================================================================
  636. CMD:edisarm(playerid)
  637. {
  638.     if ( !EvenTStats )
  639.         return SendClientMessage ( playerid , 0x00C0FFFF , "[ERROR]: The event is not open." ) ;
  640.  
  641.     if ( !IsPlayerAdmin ( playerid ) )
  642.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  643.  
  644.     for ( new v, b = GetMaxPlayers(); v != b; v++ )
  645.     {
  646.         if ( TheEvenT [ v ] )
  647.         {
  648.             ResetPlayerWeapons ( v ) ;
  649.         }
  650.     }
  651.     return 1;
  652. }
  653. // =============================================================================
  654. CMD:eskin(playerid, params[])
  655. {
  656.     if ( !EvenTStats )
  657.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}[ERROR]: The event is not open." ) ;
  658.  
  659.     if ( !IsPlayerAdmin ( playerid ) )
  660.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  661.  
  662.     new Skin;
  663.     if ( sscanf ( params , "d" , Skin ) )
  664.         return SendClientMessage ( playerid , 0x00C0FFFF , "{F81414}/Eskin [ ID Skin ]" ) ;
  665.  
  666.     for ( new v, b = GetMaxPlayers(); v != b; v++ )
  667.     {
  668.         if ( TheEvenT [ v ] )
  669.         {
  670.             SetPlayerSkin ( v , Skin ) ;
  671.         }
  672.     }
  673.     return 1;
  674. }
  675. // =============================================================================
  676. CMD:ecmd(playerid, params[])
  677. {
  678.     if ( !IsPlayerAdmin ( playerid ) )
  679.         return SendClientMessage ( playerid , 0x00C0FFFF , "You can not use this command..") ;
  680.        
  681.     new EvenTHelP[1450];
  682.    
  683.     strcat(EvenTHelP,"{FFFFFF}======================================================================\n");
  684.     strcat(EvenTHelP,"{c6a65a}Commands Event\n");
  685.     strcat(EvenTHelP,"{c6a65a}/evw {FFFFFF}Arrow In the Virtual World All In Event.\n");
  686.     strcat(EvenTHelP,"{c6a65a}/openevent {FFFFFF}Opens the Event.\n");
  687.     strcat(EvenTHelP,"{c6a65a}/event {FFFFFF}Going To The Event\n");
  688.     strcat(EvenTHelP,"{c6a65a}/frist /second /third {FFFFFF}To give the reward to the first second and third place\n");
  689.     strcat(EvenTHelP,"{c6a65a}/Esetweather {FFFFFF}To set the mood of everyone at the event.\n");
  690.     strcat(EvenTHelP,"{c6a65a}/ecar {FFFFFF}Create a Car For Every Event.\n");
  691.     strcat(EvenTHelP,"{c6a65a}/espawn {FFFFFF}To be reborn every event.\n");
  692.     strcat(EvenTHelP,"{c6a65a}/eweapon {FFFFFF}Of a Weapon For All Event.\n");
  693.     strcat(EvenTHelP,"{c6a65a}/earmour {FFFFFF}The Armour For All Event.\n");
  694.     strcat(EvenTHelP,"{c6a65a}/elife {FFFFFF}The Life For All Event\n");
  695.     strcat(EvenTHelP,"{c6a65a}/Count {FFFFFF}Start a Countdown\n{c6a65a}/ekick {FFFFFF}Kicks a Player Event\n");
  696.     strcat(EvenTHelP,"{c6a65a}/efreeze {FFFFFF}Freezes The Player In The Event\n{c6a65a}/edefrost Unfreeze The Player At The Event\n");
  697.     strcat(EvenTHelP,"{c6a65a}/edisarm {FFFFFF}Disarms All Event\n{c6a65a}/eskin {FFFFFF}Arrow The Skin Of Everyone At The Event\n");
  698.     strcat(EvenTHelP,"{c6a65a}/eclose {FFFFFF}Finalize The Event\n{c6a65a}/ekitrun {FFFFFF}Of One Kit Running (Weapons Id > 22 , 26 , 28 < )\n{c6a65a}/ekitwalk {FFFFFF}Of One Kit Walking (Weapons Id > 24 , 25 , 34 < )\n");
  699.     strcat(EvenTHelP,"{c6a65a}/ekitgrenades {FFFFFF}Of One Grenades\n{c6a65a}/ereclife {FFFFFF}To Kill And Recover Life And Armour\n{c6a65a}/exitevent {FFFFFF}To exit the event");
  700.     strcat(EvenTHelP,"{FFFFFF}======================================================================\n");
  701.    
  702.     ShowPlayerDialog(playerid,7897,DIALOG_STYLE_MSGBOX,"{FFFF00}Help Event",EvenTHelP,"Fechar","");
  703.    
  704.     strdel(EvenTHelP,0,sizeof(EvenTHelP));
  705.    
  706.     return 1;
  707. }
  708. // =============================================================================
  709. public Count(Contagem)
  710. {
  711.     format ( iString2 , 3 , "%d" , Contagem ) ;
  712.     if ( Contagem > 0 )
  713.     {
  714.         GameTextForAll ( iString2 , 700 , 5 ) ;
  715.         SetTimerEx ( "Count" , 1000 , false , "i" , Contagem-1 ) ;
  716.     }
  717.     else GameTextForAll ( "~r~Go Go Go!" , 1000 , 5 ) ;
  718. }
  719. // =============================================================================
  720. stock GetPName ( playerid )
  721. {
  722.     new gName [ MAX_PLAYER_NAME ] ;
  723.     GetPlayerName ( playerid , gName , sizeof gName ) ;
  724.     return gName;
  725. }
Advertisement
Add Comment
Please, Sign In to add comment