08.01.2011, 11:19
Peace ..,
I have a "/v" spawning vehicles system with only the Name, EX: /v Infernus
Now I need also how to make /v ID like: /v 411
With this following code:
Please !
I have a "/v" spawning vehicles system with only the Name, EX: /v Infernus
Now I need also how to make /v ID like: /v 411
With this following code:
pawn Код:
dcmd_v(playerid,params[])
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);
new tmp3[256]; tmp3 = strtok(params,Index);
if(PlayerInterior[playerid] > 1) return SendClientMessage(playerid,RED, "You can't spawn a vehicle inside houses / hotels / ..."); // xD
if(!strlen(tmp)) return
SendClientMessage(playerid, COLOR_ORANGE, "USAGE: /v [Name] [Colour1] [Colour2]");
new car;
new string[128];
new colour1, colour2;
if(!IsNumeric(tmp))
car = GetVehicleModelIDFromName(tmp);
else car = strval(tmp);
if(car < 400 || car > 611) return SendClientMessage(playerid, BALTA, "Invalid Name!");
if(!strlen(tmp2)) colour1 = random(126); else colour1 = strval(tmp2);
if(!strlen(tmp3)) colour2 = random(126); else colour2 = strval(tmp3);
new Float:X,Float:Y,Float:Z;
new Float:Angle,int1;
GetPlayerPos(playerid, X,Y,Z);
GetPlayerFacingAngle(playerid,Angle);
int1 = GetPlayerInterior(playerid);
Car[playerid] = CreateVehicle(car, X,Y,Z, Angle, colour1, colour2, 60*10000); //-1
LinkVehicleToInterior(Car[playerid],int1);
}