31.10.2010, 19:37
can anyone help tranform this into when he spawns one it destroy's the old one?
otherwise they can spam it
otherwise they can spam it
pawn Код:
dcmd_v(playerid,params[])
{
new Float:x, Float:y, Float:z;
if(!strlen(params)) return SendClientMessage(playerid, l_red, "USAGE : /vehicle [Vehicle name]");
new vehicle = GetVehicleModelIDFromName(params);
if(vehicle < 400 || vehicle > 611) return SendClientMessage(playerid, l_red, "ERROR : That vehicle name was not found");
if(vehicle == 432) return SendClientMessage(playerid, red, "You cant use that car");
if(vehicle == 425) return SendClientMessage(playerid, red, "You cant use that helicopter");
if(vehicle == 520) return SendClientMessage(playerid, red, "You cant use that plane");
new Float:a;
GetPlayerFacingAngle(playerid, a);
GetPlayerPos(playerid, x, y, z);
if(IsPlayerInAnyVehicle(playerid) == 1)
{
GetXYInFrontOfPlayer(playerid, x, y, 8);
}
else
{
GetXYInFrontOfPlayer(playerid, x, y, 5);
}
new PlayersVehicle = CreateVehicle(vehicle, x, y, z, a+90, -1, -1, -1);
LinkVehicleToInterior(PlayersVehicle, GetPlayerInterior(playerid));
PutPlayerInVehicle(playerid, PlayersVehicle, 0);
return 1;
}