18.05.2009, 13:56
Ok, i made a little /v command:
This works fine. (Yes, 'never' is a custom define)
Then i made this command, to clear all the vehicles spawned with /v:
But with this, only the last spawned vehicle is cleared.
Is there a way to do this? Do I need to give every spawned vehicle a unique name?
Thanks, Gozerr
Код:
dcmd_v(playerid, params[])
{
new vid;
if(IsPlayerAdmin(playerid) || VIPLoggedIn[playerid] == 1)
{
if (sscanf(params, "d", vid)) SendClientMessage(playerid, COLOR_YELLOW, "Usage: /v [id]");
else
if (vid < 400 || vid > 611)
{
SendClientMessage(playerid, COLOR_RED, "Invalid Vehicle ID!");
}
else
{
GetPlayerPos(playerid, PlayerPosX[playerid], PlayerPosY[playerid], PlayerPosZ[playerid]);
GetPlayerFacingAngle(playerid, PlayerPosA[playerid]);
PlayerPosInterior[playerid]=GetPlayerInterior(playerid);
veh=CreateVehicle(vid, PlayerPosX[playerid], PlayerPosY[playerid],PlayerPosZ[playerid], PlayerPosA[playerid], 0, 0, never);
LinkVehicleToInterior(veh, PlayerPosInterior[playerid]);
PutPlayerInVehicle(playerid, veh, 0);
}
}
else
{
SendClientMessage(playerid, COLOR_RED, "Admins/VIP only!");
}
return 1;
}
Then i made this command, to clear all the vehicles spawned with /v:
Код:
dcmd_clearspawnedvehicles(playerid, params[])
{
#pragma unused params
if(IsPlayerAdmin(playerid))
{
DestroyVehicle(veh);
SendClientMessage(playerid, COLOR_RED, "Vehicles cleared!");
}
else
{
SendClientMessage(playerid, COLOR_RED, "Admins only!");
}
return 1;
}
Is there a way to do this? Do I need to give every spawned vehicle a unique name?
Thanks, Gozerr

