21.03.2013, 19:34
Commands with params won't work. Below is example of command (rather - script), which not work:
pawn Код:
#include <a_samp>
#include <LIFE-CMD>
new gVehicleNames[212][] =
{
"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", "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", "Reefer", "Tropic", "Flatbed", "Yankee", "Caddy",
"Solair", "Berkley's RC Van", "Skimmer", "PCJ-600", "Faggio", "Harley", "RC Baron", "RC Raider", "Glendale", "Oceanic",
"Sanchez", "Sparrow", "Patriot", "Quad", "Coastguard", "Dinghy", "Hermes", "Sabre", "Rustler", "ZR3 50", "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", "Hotring Racer", "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", "Traktor",
"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", "Monster", "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", "Emperor", "Wayfarer", "Euros", "Hotdog", "Club", "Trailer", "Trailer",
"Andromeda", "Dodo", "RC Cam", "Launch", "Radiowoz", "Radiowoz", "Radiowoz", "Radiowoz", "Picador", "S.W.A.T. Van",
"Alpha", "Phoenix", "Glendale", "Sadler", "Luggage Trailer", "Luggage Trailer", "Stair Trailer", "Boxville", "Farm Plow", "Utility Trailer"
};
playaName(playerid)
{
static Name[MAX_PLAYER_NAME];
GetPlayerName(playerid, Name, sizeof(Name));
return Name;
}
CreatePlayerVehicle(playerid, modelid)
{
new vehicle, Float: X, Float: Y, Float: Z, Float: angle;
if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
{
vehicle = GetPlayerVehicleID(playerid);
GetVehiclePos(vehicle, X, Y, Z);
GetVehicleZAngle(vehicle, angle);
DestroyVehicle(vehicle);
}
else
{
GetPlayerPos(playerid, X, Y, Z);
GetPlayerFacingAngle(playerid, angle);
}
vehicle = AddStaticVehicle(modelid, X, Y, Z + 1, angle, -1, -1);
LinkVehicleToInterior(vehicle, GetPlayerInterior(playerid));
SetVehicleVirtualWorld(vehicle, GetPlayerVirtualWorld(playerid));
SetVehicleNumberPlate(vehicle, playaName(playerid));
PutPlayerInVehicle(playerid, vehicle, 0);
return 1;
}
str_del_free_space (string[], _char = ' ')
{
new len = strlen (string);
if (len)
{
new begin = -1, end = len;
while (string[++begin] == _char) {}
if (string[begin] == EOS)
{
string [0] = 0;
return 1;
}
while (string[--end] == _char) {}
strmid (string, string, begin, end+1, len+1);
}
return 1;
}
GetVehicleModelIdByName(vehiclename[])
{
for(new i = 0; i < 211; i++)
if (strfind(gVehicleNames[i], vehiclename, true) != -1) return i + 400;
return -1;
}
CMD:v(playerid, params[])
{
str_del_free_space(params);
if(isnull(params)) return SendClientMessage(playerid, -1, "Write /v CarName");
CreatePlayerVehicle(playerid, GetVehicleModelIdByName(params));
return 1;
}