Jármű lehívó
Sziasztok! Ez az első szkriptem amit publikálok.
Készítő: én, Norbii16
Elkészítési idő: 45 perc
Sorok száma: 154
Szükséges include: zcmd
Szükséges plugin: sscanf
Használat: /v [Név / ID] [szín1] [szín2] [bele tegyen-e a járműbe 0/1] [sziréna 0/1]
0 = Nem
1 = Igen
+ Kiegészítés: Ha nem írsz be jármű színt akkor random választ, és a jármű szín korlátozva lett 0-256-ig. (256 = random) + enum kivéve.
#include <a_samp>
#include <zcmd>
#include <sscanf2>
new pVeh[MAX_PLAYERS];
forward GetVehicleModelIDFromName(vname[]);
new VehicleNames[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 OnPlayerDisconnect(playerid, reason)
{
DestroyVehicle(pVeh[playerid]);
return 1;
}
public GetVehicleModelIDFromName(vname[])
{
for(new i = 0; i < 211; i++)
{
if ( strfind(VehicleNames, vname, true) != -1 )
return i + 400;
}
return -1;
}
CMD:v(playerid, params[])
{
new VehicleID, Color1, Color2, PutInVeh, AddSiren, Float:pX, Float:pY, Float:pZ, Float:pA, Vehicle[32];
GetPlayerPos(playerid, pX, pY, pZ);
GetPlayerFacingAngle(playerid, pA);
if(sscanf(params, \"s[32]I(256)I(256)I(1)I(0)\", Vehicle, Color1, Color2, PutInVeh, AddSiren))
{
SendClientMessage( playerid, 0x4e71d9AA, \"HASZNÁLAT >> /v [Név / ID] [szín 1] [szín 2] [PutInVeh(0 / 1)] [sziréna(0 / 1)]\" );
}
else
{
if(Color1 <= -1 || Color1 >= 257)
{
SendClientMessage( playerid, 0xa31414AA, \"HIBA >> Rossz színID-t adtál meg, 0 és 256 között kell lennie!\" );
}
else
{
if(Color2 <= -1 || Color2 >= 257)
{
SendClientMessage( playerid, 0xa31414AA, \"HIBA >> Rossz színID-t adtál meg, 0 és 256 között kell lennie!\" );
}
else
{
if(Color1 == 256) Color1 = random(255);
if(Color2 == 256) Color2 = random(255);
VehicleID = GetVehicleModelIDFromName(Vehicle);
if(VehicleID == -1 )
{
VehicleID = strval(Vehicle);
if(PutInVeh == 0)
{
if(AddSiren == 0)
{
DestroyVehicle(pVeh[playerid]);
pVeh[playerid] = CreateVehicle(VehicleID, pX, pY + 2.0, pZ, pA, Color1, Color2, -1, 0);
LinkVehicleToInterior(pVeh[playerid], GetPlayerInterior(playerid));
}
else
{
DestroyVehicle(pVeh[playerid]);
pVeh[playerid] = CreateVehicle(VehicleID, pX, pY + 2.0, pZ, pA, Color1, Color2, -1, 1);
LinkVehicleToInterior(pVeh[playerid], GetPlayerInterior(playerid));
}
}
else
{
if(AddSiren == 0)
{
DestroyVehicle(pVeh[playerid]);
pVeh[playerid] = CreateVehicle(VehicleID, pX, pY + 2.0, pZ, pA, Color1, Color2, -1, 0);
LinkVehicleToInterior(pVeh[playerid], GetPlayerInterior(playerid));
PutPlayerInVehicle(playerid, pVeh[playerid], 0);
}
else
{
DestroyVehicle(pVeh[playerid]);
pVeh[playerid] = CreateVehicle(VehicleID, pX, pY + 2.0, pZ, pA, Color1, Color2, -1, 1);
LinkVehicleToInterior(pVeh[playerid], GetPlayerInterior(playerid));
PutPlayerInVehicle(playerid, pVeh[playerid], 0);
}
}
}
else if(VehicleID > 400 || VehicleID < 611 )
{
if(PutInVeh == 0)
{
if(AddSiren == 0)
{
DestroyVehicle(pVeh[playerid]);
pVeh[playerid] = CreateVehicle(VehicleID, pX, pY + 2.0, pZ, pA, Color1, Color2, -1, 0);
LinkVehicleToInterior(pVeh[playerid], GetPlayerInterior(playerid));
}
else
{
DestroyVehicle(pVeh[playerid]);
pVeh[playerid] = CreateVehicle(VehicleID, pX, pY + 2.0, pZ, pA, Color1, Color2, -1, 1);
LinkVehicleToInterior(pVeh[playerid], GetPlayerInterior(playerid));
}
}
else
{
if(AddSiren == 0)
{
DestroyVehicle(pVeh[playerid]);
pVeh[playerid] = CreateVehicle(VehicleID, pX, pY + 2.0, pZ, pA, Color1, Color2, -1, 0);
LinkVehicleToInterior(pVeh[playerid], GetPlayerInterior(playerid));
PutPlayerInVehicle(playerid, pVeh[playerid], 0);
}
else
{
DestroyVehicle(pVeh[playerid]);
pVeh[playerid] = CreateVehicle(VehicleID, pX, pY + 2.0, pZ, pA, Color1, Color2, -1, 1);
LinkVehicleToInterior(pVeh[playerid], GetPlayerInterior(playerid));
PutPlayerInVehicle(playerid, pVeh[playerid], 0);
}
}
}
else
{
SendClientMessage( playerid, 0xa31414AA, \"HIBA >> Rossz ID-t adtál meg!\" );
}
}
}
}
return 1;
}
Kép:
http://kephost.com/image/c0WaLetöltés ( PWN ):
http://www.solidfiles.com/d/8d459a862e/Letöltés ( AMX ):
http://www.solidfiles.com/d/393348b7ff/