Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ///////////////////////////////////////
- ///////////Events System//////////////
- ////////Made By Ahmed_Nezoo////////
- ////////////////////////////////////
- #define FILTERSCRIPT
- #include <a_samp>
- #include <zcmd>
- #include <sscanf2>
- #if defined FILTERSCRIPT
- #endif
- ////////////////
- #define COLOR_RED 0xFF0000AA
- #define COLOR_GREEN 0x00FF00FF
- ////////////////
- new bool:Event;
- new bool:Eopend;
- new bool:InEvent[MAX_PLAYERS];
- new bool:mute[MAX_PLAYERS];
- ///////////////
- new VehicleList[212][] =
- {
- {"Landstalker"},
- {"Bravura"},
- {"Buffalo"},
- {"Linerunner"},
- {"Perrenial"},
- {"Sentinel"},
- {"Dumper"},
- {"Firetruck"},
- {"Trashmaster"},
- {"Stretch"},
- {"Manana"},
- {"Infernus"},
- {"Voodoo"},
- {"Pony"},
- {"Mule"},
- {"Cheetah"},
- {"Ambulance"},
- {"Leviathan"},
- {"Moonbeam"},
- {"Esperanto"},
- {"Taxi"},
- {"Washington"},
- {"Bobcat"},
- {"Mr Whoopee"},
- {"BF Injection"},
- {"Hunter"},
- {"Premier"},
- {"Enforcer"},
- {"Securicar"},
- {"Banshee"},
- {"Predator"},
- {"Bus"},
- {"Rhino"},
- {"Barracks"},
- {"Hotknife"},
- {"Trailer 1"},
- {"Previon"},
- {"Coach"},
- {"Cabbie"},
- {"Stallion"},
- {"Rumpo"},
- {"RC Bandit"},
- {"Romero"},
- {"Packer"},
- {"Monster"},
- {"Admiral"},
- {"Squalo"},
- {"Seasparrow"},
- {"Pizzaboy"},
- {"Tram"},
- {"Trailer 2"},
- {"Turismo"},
- {"Speeder"},
- {"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"},
- {"ZR-350"},
- {"Walton"},
- {"Regina"},
- {"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"},
- {"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"},
- {"Willard"},
- {"Forklift"},
- {"Tractor"},
- {"Combine"},
- {"Feltzer"},
- {"Remington"},
- {"Slamvan"},
- {"Blade"},
- {"Freight"},
- {"Streak"},
- {"Vortex"},
- {"Vincent"},
- {"Bullet"},
- {"Clover"},
- {"Sadler"},
- {"Firetruck LA"},
- {"Hustler"},
- {"Intruder"},
- {"Primo"},
- {"Cargobob"},
- {"Tampa"},
- {"Sunrise"},
- {"Merit"},
- {"Utility"},
- {"Nevada"},
- {"Yosemite"},
- {"Windsor"},
- {"Monster A"},
- {"Monster B"},
- {"Uranus"},
- {"Jester"},
- {"Sultan"},
- {"Stratum"},
- {"Elegy"},
- {"Raindance"},
- {"RC Tiger"},
- {"Flash"},
- {"Tahoma"},
- {"Savanna"},
- {"Bandito"},
- {"Freight Flat"},
- {"Streak Carriage"},
- {"Kart"},
- {"Mower"},
- {"Duneride"},
- {"Sweeper"},
- {"Broadway"},
- {"Tornado"},
- {"AT-400"},
- {"DFT-30"},
- {"Huntley"},
- {"Stafford"},
- {"BF-400"},
- {"Newsvan"},
- {"Tug"},
- {"Trailer 3"},
- {"Emperor"},
- {"Wayfarer"},
- {"Euros"},
- {"Hotdog"},
- {"Club"},
- {"Freight Carriage"},
- {"Trailer 3"},
- {"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"},
- {"Stair Trailer"},
- {"Boxville"},
- {"Farm Plow"},
- {"Utility Trailer"}
- };
- /////////
- public OnFilterScriptInit()
- {
- print("\n--------------------------------------");
- print(" Event System By Ahmed_Nezoo");
- print("--------------------------------------\n");
- return 1;
- }
- public OnFilterScriptExit()
- {
- return 1;
- }
- public OnPlayerText(playerid, text[])
- {
- if(mute[playerid] == true)
- {
- SendClientMessage(playerid, COLOR_RED, "You are still muted! You can't chat with others");
- return 0;
- }
- return 1;
- }
- stock GetVehicleModelIDFromName(name[])
- {
- for(new i = 0; i < 211; i++)
- {
- if(strfind(VehicleList[i], name, true) != -1) return i + 400;
- }
- return -1;
- }
- CMD:crevent(playerid, params[])
- {
- if(Event == true) return SendClientMessage(playerid, COLOR_RED, "There is an event right now");
- Eopend = false;
- SetPlayerVirtualWorld(playerid, 1);
- SendClientMessage(playerid, COLOR_GREEN, "An event created! use /eopen to enable players to join");
- Event = true;
- InEvent[playerid] = true;
- return 1;
- }
- CMD:finish(playerid, params[])
- {
- if(Event == false) return SendClientMessage(playerid, COLOR_RED, "There isn't any running event!");
- Event = false;
- SendClientMessage(playerid, COLOR_GREEN, "Event finsihed!");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
- {
- SetPlayerHealth(i, 0);
- SetPlayerVirtualWorld(i, 0);
- InEvent[i] = false;
- }
- }
- for(new x = 1; x <= MAX_VEHICLES;x++)
- {
- if(GetVehicleVirtualWorld(x) == GetPlayerVirtualWorld(playerid))
- {
- DestroyVehicle(x);
- }
- }
- Eopend = false;
- return 1;
- }
- CMD:join(playerid, params[])
- {
- if(Event == false) return SendClientMessage(playerid, COLOR_RED, "There isn't any hosted event right now !");
- if(InEvent[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "You are already in an event !");
- if(Eopend == false) return SendClientMessage(playerid, COLOR_RED, "The event is closed!");
- SetPlayerVirtualWorld(playerid, 1);
- SendClientMessage(playerid, COLOR_GREEN, "You have joined an event!");
- InEvent[playerid] = true;
- return 1;
- }
- CMD:leave(playerid, params[])
- {
- if(InEvent[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "You aren't in event to leave it!");
- SetPlayerHealth(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- InEvent[playerid] = false;
- return 1;
- }
- CMD:eweapon(playerid, params[])
- {
- new gunid;
- new ammo;
- if(sscanf(params, "ii", gunid, ammo)) return SendClientMessage(playerid, COLOR_RED, "Give all player in the event gun: /egun [Gun ID] (Ammo)");
- if(InEvent[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "You aren't in an event");
- for(new i = 0; i < MAX_PLAYERS;i++)
- {
- if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
- {
- GivePlayerWeapon(i, gunid, ammo);
- }
- }
- return 1;
- }
- CMD:earmour(playerid, params[])
- {
- if(InEvent[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "You aren't in an event");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(GetPlayerVirtualWorld(i) == playerid)
- {
- SetPlayerArmour(i, 100.0);
- }
- }
- return 1;
- }
- CMD:ehealth(playerid, params[])
- {
- if(InEvent[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "You aren't in an event");
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(GetPlayerVirtualWorld(i) == GetPlayerVirtualWorld(playerid))
- {
- SetPlayerHealth(i, 100.0);
- }
- }
- return 1;
- }
- CMD:rv(playerid, params[])
- {
- if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_RED, "You aren't in any vehicle");
- new veh = GetPlayerVehicleID(playerid);
- DestroyVehicle(veh);
- return 1;
- }
- CMD:eopen(playerid, params[])
- {
- if(InEvent[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "You didn't join any event to open it !");
- if(Eopend == true) return SendClientMessage(playerid, COLOR_RED, "You already opened the event");
- Eopend = true;
- SendClientMessage(playerid, COLOR_GREEN, "Event Opened !");
- return 1;
- }
- CMD:eclose(playerid, params[])
- {
- if(InEvent[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "You didn't join any event to close it !");
- if(Eopend == false) return SendClientMessage(playerid, COLOR_RED, "The event is already closed!");
- Eopend = false;
- SendClientMessage(playerid, COLOR_GREEN, "Event Closed!");
- return 1;
- }
- forward unmute(playerid);
- public unmute(playerid)
- {
- mute[playerid] = false;
- SendClientMessage(playerid, COLOR_RED, "Unmuted !");
- return 1;
- }
- CMD:emute(playerid, params[])
- {
- new targetid;
- new time;
- if(sscanf(params,"ui", targetid, time)) return SendClientMessage(playerid, -1, "Usage: /emute [ID] (Time)");
- if(InEvent[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "You aren't in a event");
- if(InEvent[targetid] == false) return SendClientMessage(playerid, COLOR_RED, "This player is not in the event");
- if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, COLOR_RED, "This player is not connected");
- new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- if(mute[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "%s has already muted");
- mute[targetid] = true;
- format(string, sizeof(string), "%s muted from talking in the event for %i.", name, time);
- SendClientMessageToAll(COLOR_RED, string);
- SetTimerEx("unmute", time*60000, false, "i", targetid);
- return 1;
- }
- CMD:ec(playerid, params[])
- {
- new msg[128];
- if(sscanf(params, "s[128]", msg)) return SendClientMessage(playerid, COLOR_RED, "Talk in the event: /ec [Message]");
- if(InEvent[playerid] == false) return SendClientMessage(playerid, COLOR_RED, "You aren't in an event!");
- if(mute[playerid] == true) return SendClientMessage(playerid, COLOR_RED, "You muted from talking in the event");
- new name[MAX_PLAYER_NAME], string[24+MAX_PLAYER_NAME];
- GetPlayerName(playerid, name, sizeof(name));
- for(new i = 0; i < MAX_PLAYERS; i++)
- {
- if(InEvent[i] == true)
- {
- format(string,sizeof(string),"%s: %s",name,msg);
- SendClientMessage(i, 0xE0427F80, string);
- }
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement