06.01.2011, 10:41
Hello everyone,
So I have a CarSpawning System with the function like this:
I need to add like this:
Thanks !
So I have a CarSpawning System with the function like this:
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(!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);
}
pawn Код:
if(PlayerInterior[playerid] > 0)
{
SendClientMessage(playerid,RED, "You can't spawn a vehicle inside houses / hotels / ..."); // xD
return 1;
}