CMD:car(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_RED, "You can't use this command");
new carid, color1, color2;
new Float:x, Float:y, Float:z;
if(sscanf(params, "uii", carid, color1, color2)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /car [id] (Color 1) (Color 2)");
if(carid < 411 && carid > 611)
{
GetPlayerPos(playerid, x, y, z);
new car = CreateVehicle(carid, x, y, z, color1, color2, -1);
new interior = GetPlayerInterior(playerid);
LinkVehicleToInterior(car, interior);
new world = GetPlayerVirtualWorld(playerid);
SetVehicleVirtualWorld(car, world);
SendClientMessage(playerid, COLOR_BROWN, "Vehcile Spawned");
}
else
{
SendClientMessage(playerid, COLOR_RED, "Car id can't be less than 411 or more than 611");
}
return 1;
}
CMD:car(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] == 0) return SendClientMessage(playerid, COLOR_RED, "You can't use this command");
new carid, color1, color2;
new Float:x, Float:y, Float:z;
if(sscanf(params, "uii", carid, color1, color2)) return SendClientMessage(playerid, COLOR_WHITE, "Usage: /car [id] (Color 1) (Color 2)");
if(carid < 411 || carid > 611) return SendClientMessag(playerid, COLOR_RED, "Car is can't be less than 411 or more than 611");
GetPlayerPos(playerid, x, y, z);
new car = CreateVehicle(carid, x, y, z, color1, color2, -1);
new interior = GetPlayerInterior(playerid);
LinkVehicleToInterior(car, interior);
new world = GetPlayerVirtualWorld(playerid);
SetVehicleVirtualWorld(car, world);
SendClientMessage(playerid, COLOR_BROWN, "Vehcile Spawned");
return 1;
}
u - User, takes a name, part of a name or an id and returns the id if they're connected. |
if(0 < 411 || 0 > 611)
sscanf(params, "ddd", carid, color1, color2)
Another thing please why when the vehicle explode it respawn again at the same place that i spawn it ?
|
public OnVehicleDeath(vehicleid, killerid)//applies to every vehicle. once destroyed it'll be deleted
{
DestroyVehicle(vehicleid);
return 1;
}