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 MAX_EVENTS = 1;
- new Events = 0;
- new bobject;
- new barrier = 0;
- new MAX_BARRIER = 1;
- ///////////////
- 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;
- }
- stock GetVehicleModelIDFromName(name[])
- {
- for(new i = 0; i < 211; i++)
- {
- if(strfind(VehicleList[i], name, true) != -1) return i + 400;
- }
- return -1;
- }
- //Event System
- CMD:crevent(playerid, params[])
- {
- if(MAX_EVENTS > Events)
- {
- Events++;
- SetPlayerVirtualWorld(playerid, 1);
- SendClientMessage(playerid, COLOR_GREEN, "An event created !");
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "Sorry there is an event right now !");
- SetPlayerVirtualWorld(playerid, 0);
- }
- return 1;
- }
- CMD:finish(playerid, params[])
- {
- if(Events > 0)
- {
- Events -= 1;
- SendClientMessage(playerid, COLOR_GREEN, "Event finsihed !");
- SetPlayerVirtualWorld(playerid, 0);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "There isn't any running event !");
- }
- return 1;
- }
- CMD:join(playerid, params[])
- {
- new world = GetPlayerVirtualWorld(playerid);
- if(Events == 0)
- {
- SendClientMessage(playerid, COLOR_RED, "There isn't any hosted event right now !");
- }
- else if(world == 1)
- {
- SendClientMessage(playerid, COLOR_RED, "You are already in an event !");
- }
- else
- {
- SetPlayerVirtualWorld(playerid, 1);
- SendClientMessage(playerid, COLOR_GREEN, "You have joined an event !");
- }
- return 1;
- }
- CMD:leave(playerid, params[])
- {
- new world = GetPlayerVirtualWorld(playerid);
- if(world != 0)
- {
- SetPlayerHealth(playerid, 0);
- SetPlayerVirtualWorld(playerid, 0);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You didn't join any event !");
- }
- return 1;
- }
- CMD:ev(playerid, params[])
- {
- new world = GetPlayerVirtualWorld(playerid);
- if(world != 0)
- {
- new color1, color2, id[128], string[144];
- if(sscanf(params, "s[64]dd", id, color1, color2)) return SendClientMessage(playerid, ~1, "{FF0000}|!| {FF9500}Usage: {FFFFFF}/spawncar (Name) (color1) (color2)");
- new car = GetVehicleModelIDFromName(id);
- if(car < 400 || car > 611) return SendClientMessage(playerid, ~1, "Vehicle ID can't be below {FF0000}400 {FFFFFF}or above {FF0000}611");
- new Float:X, Float:Y, Float:Z, Float:A;
- GetPlayerPos(playerid, X, Y, Z);
- GetPlayerFacingAngle(playerid, A);
- X += (5 * floatsin(-A, degrees));
- Y += (5 * floatcos(-A, degrees));
- new cars = CreateVehicle(car, X, Y, Z, 0.0, color1, color2, -1);
- new pint = GetPlayerInterior(playerid);
- LinkVehicleToInterior(cars, pint);
- new pworld = GetPlayerVirtualWorld(playerid);
- SetVehicleVirtualWorld(cars, pworld);
- format(string, sizeof string, "Vehicle {FF9500}%s(%d) {FFFFFF}spawned.", VehicleList[GetVehicleModel(cars)-400], cars);
- SendClientMessage(playerid, ~1, string);
- printf(string);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You can't use this command right now !");
- }
- return 1;
- }
- CMD:rev(playerid, params[])
- {
- new world = GetPlayerVirtualWorld(playerid);
- if(world != 0)
- {
- new vehicleid;
- vehicleid= GetPlayerVehicleID(playerid);
- DestroyVehicle(vehicleid);
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You can't use this command right now !");
- }
- return 1;
- }
- CMD:barrier(playerid, params[])
- {
- new world = GetPlayerVirtualWorld(playerid);
- if(MAX_BARRIER >= barrier && world != 0)
- {
- new Float:x, Float:y, Float:z;
- new Float:a;
- GetPlayerPos(playerid, x, y, z);
- GetPlayerFacingAngle(playerid, a);
- bobject = CreateObject(978, x+5,y,z,0,0,a);
- SendClientMessage(playerid, -1, "You have spawned a barrier. Don't forget to remove it before starting the event !");
- barrier++;
- return 1;
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You can't use this command right now !");
- }
- return 1;
- }
- CMD:rbarrier(playerid,params[])
- {
- if(barrier == 1)
- {
- DestroyObject(bobject);
- SendClientMessage(playerid, -1, "You have removed the barrier");
- }
- else
- {
- SendClientMessage(playerid, COLOR_RED, "You didn't spawn a barrier !");
- }
- return 1;
- }
- CMD:eweapon(playerid, params[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- if(GetPlayerVirtualWorld(i)!= 0)
- {
- new gun;
- new ammo;
- if(sscanf(params,"ii", gun, ammo)) return SendClientMessage(playerid, -1,"USAGE: /eweapon [gunid] [ammo]");
- if(gun > 47 || gun < 1) return SendClientMessage(playerid, -1,"GUN ID'S: 1-47");
- if(ammo > 15000 || ammo < 1) return SendClientMessage(playerid, -1,"Ammo 1-15000");
- GivePlayerWeapon(i, gun, ammo);
- }
- else
- {
- new id, string[144];
- id = strval(params);
- new Float:pos[3];
- GetPlayerPos(id, pos[0], pos[1], pos[2]);
- SetPlayerPos(id, pos[0], pos[1], pos[2] + 10.0);
- PlayerPlaySound(id, 1190, pos[0], pos[1], pos[2]);
- }
- return 1;
- }
- CMD:earmour(playerid, params[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- if(GetPlayerVirtualWorld(i)!= 0)
- {
- SetPlayerArmour(playerid, 100.0);
- }
- else
- {
- //////
- }
- return 1;
- }
- CMD:ehealth(playerid, params[])
- {
- for(new i = 0; i < MAX_PLAYERS; i++)
- if(GetPlayerVirtualWorld(i)!= 0)
- {
- SetPlayerHealth(playerid, 100.0);
- }
- else
- {
- //////
- }
- return 1;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement