vehicle system
#1

does anybody have any links of a good tutorial for making a vehicle system ? not the vehicle system that i buy/sell a car , the vehile system where i type /car <vehicle id/name> to spawn a car

thanks
Reply
#2

Something like this?:
https://sampforum.blast.hk/showthread.php?tid=495888
Reply
#3

Quote:
Originally Posted by bensmart469
Посмотреть сообщение
no the one i want is like a player spawns a vehicle , and then when he spawns another vehicle the 1st one disappears , i think the one u sent is an easier way to add static vehicles instead of saving positions
Reply
#4

try this?
PHP код:
#include <a_samp>
#include <zcmd>

new VehicleName[212][0] = {
   
"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"//artict1
   
"Previon",
   
"Coach",
   
"Cabbie",
   
"Stallion",
   
"Rumpo",
   
"RC Bandit",
   
"Romero",
   
"Packer",
   
"Monster Truck",
   
"Admiral",
   
"Squalo",
   
"Seasparrow",
   
"Pizzaboy",
   
"Tram",
   
"Trailer"//artict2
   
"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"//hotrina
   
"Hotring Racer"//hotrinb
   
"Bloodring Banger",
   
"Rancher",
   
"Super GT",
   
"Elegant",
   
"Journey",
   
"Bike",
   
"Mountain Bike",
   
"Beagle",
   
"Cropdust",
   
"Stunt",
   
"Tanker"//petro
   
"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"//firela
   
"Hustler",
   
"Intruder",
   
"Primo",
   
"Cargobob",
   
"Tampa",
   
"Sunrise",
   
"Merit",
   
"Utility",
   
"Nevada",
   
"Yosemite",
   
"Windsor",
   
"Monster Truck"//monstera
   
"Monster Truck"//monsterb
   
"Uranus",
   
"Jester",
   
"Sultan",
   
"Stratum",
   
"Elegy",
   
"Raindance",
   
"RC Tiger",
   
"Flash",
   
"Tahoma",
   
"Savanna",
   
"Bandito",
   
"Freight"//freiflat
   
"Trailer"//streakc
   
"Kart",
   
"Mower",
   
"Duneride",
   
"Sweeper",
   
"Broadway",
   
"Tornado",
   
"AT-400",
   
"DFT-30",
   
"Huntley",
   
"Stafford",
   
"BF-400",
   
"Newsvan",
   
"Tug",
   
"Trailer"//petrotr
   
"Emperor",
   
"Wayfarer",
   
"Euros",
   
"Hotdog",
   
"Club",
   
"Trailer"//freibox
   
"Trailer"//artict3
   
"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"//bagboxa
   
"Luggage Trailer"//bagboxb
   
"Stair Trailer"//tugstair
   
"Boxville",
   
"Farm Plow"//farmtr1
   
"Utility Trailer" //utiltr1
};

enum vInfo
{
    
modding,
    
model,
    
Float:x_spawn,
    
Float:y_spawn,
    
Float:z_spawn,
    
Float:za_spawn,
    
Float:ox_spawn,
    
Float:oy_spawn,
    
Float:oz_spawn,
    
Float:oza_spawn,
    
color_1,
    
color_2,
    
owner[128],
    
vehiclecost,
    
bought,
    
secure,
    
asecure,
    
vused,
    
buybar,
    
name[128],
    
mod1,
    
mod2,
    
mod3,
    
mod4,
    
mod5,
    
mod6,
    
mod7,
    
mod8,
    
mod9,
    
mod10,
    
mod11,
    
mod12,
    
mod13,
    
mod14,
    
mod15,
    
mod16,
    
mod17,
    
paintjob,
    
Temp,
};

new 
VehicleInfo[MAX_VEHICLES][vInfo];


CMD:car(playerid,params[]) {
        new 
tmp[128], tmp2[128], tmp3[128], Indextmp strtok(params,Index), tmp2 strtok(params,Index); tmp3 strtok(params,Index);
        if(
isnull(tmp)) return SendClientMessage(playerid, -1"USAGE: /car [Modelid/Name] [colour1] [colour2]");
        new 
carcolour1colour2string[128];
           if(!
IsNumeric(tmp)) car GetVehicleModelIDFromName(tmp); else car strval(tmp);
        if(
car 400 || car 611) return  SendClientMessage(playerid, -1"ERROR: Invalid Vehicle Model");
        if(
isnull(tmp2)) colour1 random(126); else colour1 strval(tmp2);
        if(
isnull(tmp3)) colour2 random(126); else colour2 strval(tmp3);
        new 
LVehicleID,Float:X,Float:Y,Float:ZFloat:Angle,int1;    GetPlayerPos(playeridX,Y,Z);    GetPlayerFacingAngle(playerid,Angle);   int1 GetPlayerInterior(playerid);
        
LVehicleID CreateVehicle(carX+3,Y,ZAnglecolour1colour2, -1); LinkVehicleToInterior(LVehicleID,int1);
        
format(stringsizeof(string), "You have spawned a \"%s\" (Model:%d) colour (%d, %d)"VehicleName[car-400], carcolour1colour2);
        
PutPlayerInVehicle(playeridLVehicleID0);
        
VehicleInfo[LVehicleID][Temp] = 1;
        return 
SendClientMessage(playerid,-1string);
        }

strtok(const string[], &index)
{
    new 
length strlen(string);
    while ((
index length) && (string[index] <= ' '))
    {
        
index++;
    }

    new 
offset index;
    new 
result[20];
    while ((
index length) && (string[index] > ' ') && ((index offset) < (sizeof(result) - 1)))
    {
        
result[index offset] = string[index];
        
index++;
    }
    
result[index offset] = EOS;
    return 
result;
}

stock IsNumeric(string[])
{
    for (new 
0strlen(string); ji++)
    {
        if (
string[i] > '9' || string[i] < '0') return 0;
    }
    return 
1;
}

stock pName(playerid)
{
  new 
plname[MAX_PLAYER_NAME];
  
GetPlayerName(playeridplnamesizeof(plname));
  return 
plname;
}

GetVehicleModelIDFromName(vname[])
{
    for(new 
0211i++)
    {
        if ( 
strfind(VehicleName[i], vnametrue) != -)
            return 
400;
    }
    return -
1;

Reply
#5

Quote:
Originally Posted by jlalt
Посмотреть сообщение
try this?
PHP код:
#include <a_samp>
#include <zcmd>
new VehicleName[212][0] = {
   
"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"//artict1
   
"Previon",
   
"Coach",
   
"Cabbie",
   
"Stallion",
   
"Rumpo",
   
"RC Bandit",
   
"Romero",
   
"Packer",
   
"Monster Truck",
   
"Admiral",
   
"Squalo",
   
"Seasparrow",
   
"Pizzaboy",
   
"Tram",
   
"Trailer"//artict2
   
"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"//hotrina
   
"Hotring Racer"//hotrinb
   
"Bloodring Banger",
   
"Rancher",
   
"Super GT",
   
"Elegant",
   
"Journey",
   
"Bike",
   
"Mountain Bike",
   
"Beagle",
   
"Cropdust",
   
"Stunt",
   
"Tanker"//petro
   
"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"//firela
   
"Hustler",
   
"Intruder",
   
"Primo",
   
"Cargobob",
   
"Tampa",
   
"Sunrise",
   
"Merit",
   
"Utility",
   
"Nevada",
   
"Yosemite",
   
"Windsor",
   
"Monster Truck"//monstera
   
"Monster Truck"//monsterb
   
"Uranus",
   
"Jester",
   
"Sultan",
   
"Stratum",
   
"Elegy",
   
"Raindance",
   
"RC Tiger",
   
"Flash",
   
"Tahoma",
   
"Savanna",
   
"Bandito",
   
"Freight"//freiflat
   
"Trailer"//streakc
   
"Kart",
   
"Mower",
   
"Duneride",
   
"Sweeper",
   
"Broadway",
   
"Tornado",
   
"AT-400",
   
"DFT-30",
   
"Huntley",
   
"Stafford",
   
"BF-400",
   
"Newsvan",
   
"Tug",
   
"Trailer"//petrotr
   
"Emperor",
   
"Wayfarer",
   
"Euros",
   
"Hotdog",
   
"Club",
   
"Trailer"//freibox
   
"Trailer"//artict3
   
"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"//bagboxa
   
"Luggage Trailer"//bagboxb
   
"Stair Trailer"//tugstair
   
"Boxville",
   
"Farm Plow"//farmtr1
   
"Utility Trailer" //utiltr1
};
enum vInfo
{
    
modding,
    
model,
    
Float:x_spawn,
    
Float:y_spawn,
    
Float:z_spawn,
    
Float:za_spawn,
    
Float:ox_spawn,
    
Float:oy_spawn,
    
Float:oz_spawn,
    
Float:oza_spawn,
    
color_1,
    
color_2,
    
owner[128],
    
vehiclecost,
    
bought,
    
secure,
    
asecure,
    
vused,
    
buybar,
    
name[128],
    
mod1,
    
mod2,
    
mod3,
    
mod4,
    
mod5,
    
mod6,
    
mod7,
    
mod8,
    
mod9,
    
mod10,
    
mod11,
    
mod12,
    
mod13,
    
mod14,
    
mod15,
    
mod16,
    
mod17,
    
paintjob,
    
Temp,
};
new 
VehicleInfo[MAX_VEHICLES][vInfo];
CMD:car(playerid,params[]) {
        new 
tmp[128], tmp2[128], tmp3[128], Indextmp strtok(params,Index), tmp2 strtok(params,Index); tmp3 strtok(params,Index);
        if(
isnull(tmp)) return SendClientMessage(playerid, -1"USAGE: /car [Modelid/Name] [colour1] [colour2]");
        new 
carcolour1colour2string[128];
           if(!
IsNumeric(tmp)) car GetVehicleModelIDFromName(tmp); else car strval(tmp);
        if(
car 400 || car 611) return  SendClientMessage(playerid, -1"ERROR: Invalid Vehicle Model");
        if(
isnull(tmp2)) colour1 random(126); else colour1 strval(tmp2);
        if(
isnull(tmp3)) colour2 random(126); else colour2 strval(tmp3);
        new 
LVehicleID,Float:X,Float:Y,Float:ZFloat:Angle,int1;    GetPlayerPos(playeridX,Y,Z);    GetPlayerFacingAngle(playerid,Angle);   int1 GetPlayerInterior(playerid);
        
LVehicleID CreateVehicle(carX+3,Y,ZAnglecolour1colour2, -1); LinkVehicleToInterior(LVehicleID,int1);
        
format(stringsizeof(string), "You have spawned a \"%s\" (Model:%d) colour (%d, %d)"VehicleName[car-400], carcolour1colour2);
        
PutPlayerInVehicle(playeridLVehicleID0);
        
VehicleInfo[LVehicleID][Temp] = 1;
        return 
SendClientMessage(playerid,-1string);
        }
strtok(const string[], &index)
{
    new 
length strlen(string);
    while ((
index length) && (string[index] <= ' '))
    {
        
index++;
    }
    new 
offset index;
    new 
result[20];
    while ((
index length) && (string[index] > ' ') && ((index offset) < (sizeof(result) - 1)))
    {
        
result[index offset] = string[index];
        
index++;
    }
    
result[index offset] = EOS;
    return 
result;
}
stock IsNumeric(string[])
{
    for (new 
0strlen(string); ji++)
    {
        if (
string[i] > '9' || string[i] < '0') return 0;
    }
    return 
1;
}
stock pName(playerid)
{
  new 
plname[MAX_PLAYER_NAME];
  
GetPlayerName(playeridplnamesizeof(plname));
  return 
plname;
}
GetVehicleModelIDFromName(vname[])
{
    for(new 
0211i++)
    {
        if ( 
strfind(VehicleName[i], vnametrue) != -)
            return 
400;
    }
    return -
1;

it showed errors with my Y_ini system take a look

Script:
Код:
forward LoadUser_data(playerid,name[],value[]);
public LoadUser_data(playerid,name[],value[])//564
{
	INI_Int("Password",PlayerInfo[playerid][pPass]);//566
	INI_Int("Score",PlayerInfo[playerid][pPass]);//567
	INI_Int("Cash",PlayerInfo[playerid][pCash]);//568
	INI_Int("Admin",PlayerInfo[playerid][pAdmin]);//569
	INI_Int("VIP",PlayerInfo[playerid][pVIP]);//570
	INI_Int("Kills",PlayerInfo[playerid][pKills]);//571
        INI_Int("Deaths",PlayerInfo[playerid][pDeaths]);//572
        INI_Int("Wanted Level",PlayerInfo[playerid][pWantedLvl]);//573
        INI_Int("Moneybags",PlayerInfo[playerid][pMoneybag]);//574
        INI_Int("Reaction Tests",PlayerInfo[playerid][pReactionTest]);//575
        INI_Int("Math Tests",PlayerInfo[playerid][pMathTest]);//576
        INI_Int("Total Warnings",PlayerInfo[playerid][pWarnings]);//577
        INI_Int("Total Kicks",PlayerInfo[playerid][pKicks]);//578
        INI_Int("Total Bans",PlayerInfo[playerid][pBans]);//579
        INI_Int("Banned",PlayerInfo[playerid][pBanned]);//590
 	return 1;
}


stock PlayerName(playerid)
{
	new name[MAX_PLAYER_NAME];//2905
	GetPlayerName(playerid,name,sizeof(name));//2906
	return name;
}
Errors
Код:
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(564) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(566) : error 035: argument type mismatch (argument 2)
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(567) : error 035: argument type mismatch (argument 2)
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(568) : error 035: argument type mismatch (argument 2)
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(569) : error 035: argument type mismatch (argument 2)
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(570) : error 035: argument type mismatch (argument 2)
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(571) : error 035: argument type mismatch (argument 2)
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(572) : error 035: argument type mismatch (argument 2)
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(573) : error 035: argument type mismatch (argument 2)
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(574) : error 035: argument type mismatch (argument 2)
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(575) : error 035: argument type mismatch (argument 2)
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(576) : error 035: argument type mismatch (argument 2)
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(577) : error 035: argument type mismatch (argument 2)
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(578) : error 035: argument type mismatch (argument 2)
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(579) : error 035: argument type mismatch (argument 2)
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(580) : error 035: argument type mismatch (argument 2)
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(1274) : warning 217: loose indentation
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(1275) : warning 217: loose indentation
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(2905) : warning 219: local variable "name" shadows a variable at a preceding level
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(2906) : error 035: argument type mismatch (argument 2)
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(2906) : error 035: argument type mismatch (argument 2)
C:\Users\Youssf Hammad\Desktop\Server\gamemodes\topsecret.pwn(2905) : warning 204: symbol is assigned a value that is never used: "name"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


17 Errors.
ignore the (loose indentation)
Reply
#6

Let it filterscript ?
Reply
#7

Quote:
Originally Posted by jlalt
Посмотреть сообщение
Let it filterscript ?
thanks its working

but can u add that when i player spawns a vehicle the previous one he spawned is destroyed ?(DestroyVehicle(vehicleid)) ? already repped u
Reply
#8

Vehicle will be destroyed in 5 seconds after player exit
PHP код:
#include <a_samp>
#include <zcmd>
new VehicleName[212][0] = {
   
"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"//artict1
   
"Previon",
   
"Coach",
   
"Cabbie",
   
"Stallion",
   
"Rumpo",
   
"RC Bandit",
   
"Romero",
   
"Packer",
   
"Monster Truck",
   
"Admiral",
   
"Squalo",
   
"Seasparrow",
   
"Pizzaboy",
   
"Tram",
   
"Trailer"//artict2
   
"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"//hotrina
   
"Hotring Racer"//hotrinb
   
"Bloodring Banger",
   
"Rancher",
   
"Super GT",
   
"Elegant",
   
"Journey",
   
"Bike",
   
"Mountain Bike",
   
"Beagle",
   
"Cropdust",
   
"Stunt",
   
"Tanker"//petro
   
"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"//firela
   
"Hustler",
   
"Intruder",
   
"Primo",
   
"Cargobob",
   
"Tampa",
   
"Sunrise",
   
"Merit",
   
"Utility",
   
"Nevada",
   
"Yosemite",
   
"Windsor",
   
"Monster Truck"//monstera
   
"Monster Truck"//monsterb
   
"Uranus",
   
"Jester",
   
"Sultan",
   
"Stratum",
   
"Elegy",
   
"Raindance",
   
"RC Tiger",
   
"Flash",
   
"Tahoma",
   
"Savanna",
   
"Bandito",
   
"Freight"//freiflat
   
"Trailer"//streakc
   
"Kart",
   
"Mower",
   
"Duneride",
   
"Sweeper",
   
"Broadway",
   
"Tornado",
   
"AT-400",
   
"DFT-30",
   
"Huntley",
   
"Stafford",
   
"BF-400",
   
"Newsvan",
   
"Tug",
   
"Trailer"//petrotr
   
"Emperor",
   
"Wayfarer",
   
"Euros",
   
"Hotdog",
   
"Club",
   
"Trailer"//freibox
   
"Trailer"//artict3
   
"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"//bagboxa
   
"Luggage Trailer"//bagboxb
   
"Stair Trailer"//tugstair
   
"Boxville",
   
"Farm Plow"//farmtr1
   
"Utility Trailer" //utiltr1
};
enum vInfo
{
    
modding,
    
model,
    
Float:x_spawn,
    
Float:y_spawn,
    
Float:z_spawn,
    
Float:za_spawn,
    
Float:ox_spawn,
    
Float:oy_spawn,
    
Float:oz_spawn,
    
Float:oza_spawn,
    
color_1,
    
color_2,
    
owner[128],
    
vehiclecost,
    
bought,
    
secure,
    
asecure,
    
vused,
    
buybar,
    
name[128],
    
mod1,
    
mod2,
    
mod3,
    
mod4,
    
mod5,
    
mod6,
    
mod7,
    
mod8,
    
mod9,
    
mod10,
    
mod11,
    
mod12,
    
mod13,
    
mod14,
    
mod15,
    
mod16,
    
mod17,
    
paintjob,
    
Temp,
};
new 
VehicleInfo[MAX_VEHICLES][vInfo];
CMD:car(playerid,params[]) {
        new 
tmp[128], tmp2[128], tmp3[128], Indextmp strtok(params,Index), tmp2 strtok(params,Index); tmp3 strtok(params,Index);
        if(
isnull(tmp)) return SendClientMessage(playerid, -1"USAGE: /car [Modelid/Name] [colour1] [colour2]");
        new 
carcolour1colour2string[128];
           if(!
IsNumeric(tmp)) car GetVehicleModelIDFromName(tmp); else car strval(tmp);
        if(
car 400 || car 611) return  SendClientMessage(playerid, -1"ERROR: Invalid Vehicle Model");
        if(
isnull(tmp2)) colour1 random(126); else colour1 strval(tmp2);
        if(
isnull(tmp3)) colour2 random(126); else colour2 strval(tmp3);
        new 
LVehicleID,Float:X,Float:Y,Float:ZFloat:Angle,int1;    GetPlayerPos(playeridX,Y,Z);    GetPlayerFacingAngle(playerid,Angle);   int1 GetPlayerInterior(playerid);
        
LVehicleID CreateVehicle(carX+3,Y,ZAnglecolour1colour2, -1); LinkVehicleToInterior(LVehicleID,int1);
        
format(stringsizeof(string), "You have spawned a \"%s\" (Model:%d) colour (%d, %d)"VehicleName[car-400], carcolour1colour2);
        
PutPlayerInVehicle(playeridLVehicleID0);
        
VehicleInfo[LVehicleID][Temp] = 1;
        return 
SendClientMessage(playerid,-1string);
        }
public 
OnPlayerExitVehicle(playeridvehicleid)
{
if(
VehicleInfo[vehicleid][Temp] == 1SetTimerEx("DestroyVehicle1"5000,0,"i",vehicleid);
return 
1;
}
forward DestroyVehicle1(vehicleid);
public 
DestroyVehicle1(vehicleid)
{
if(
VehicleInfo[vehicleid][Temp] == 1) {
DestroyVehicle(vehicleid);
VehicleInfo[vehicleid][Temp] = 0;
}
return 
1;
}
strtok(const string[], &index)
{
    new 
length strlen(string);
    while ((
index length) && (string[index] <= ' '))
    {
        
index++;
    }
    new 
offset index;
    new 
result[20];
    while ((
index length) && (string[index] > ' ') && ((index offset) < (sizeof(result) - 1)))
    {
        
result[index offset] = string[index];
        
index++;
    }
    
result[index offset] = EOS;
    return 
result;
}
stock IsNumeric(string[])
{
    for (new 
0strlen(string); ji++)
    {
        if (
string[i] > '9' || string[i] < '0') return 0;
    }
    return 
1;
}
stock pName(playerid)
{
  new 
plname[MAX_PLAYER_NAME];
  
GetPlayerName(playeridplnamesizeof(plname));
  return 
plname;
}
GetVehicleModelIDFromName(vname[])
{
    for(new 
0211i++)
    {
        if ( 
strfind(VehicleName[i], vnametrue) != -)
            return 
400;
    }
    return -
1;

Reply
#9

thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)