16.09.2010, 16:56
Okey, how can I make a respawn car command that will respawn my nearest car?
I tryed this but I failed.
Here is the code:
Thanks
I tryed this but I failed.
Here is the code:
pawn Код:
dcmd_respawncar(playerid, params[])
{
#pragma unused params
if(adminlevel[playerid] >= 2)
{
for(new car=0; car<MAX_VEHICLES; car++)
{
new Float: X, Float: Y, Float: Z;
GetPlayerPos(playerid, X, Y, Z);
if(IsPlayerInRangeOfPoint(car, 3.5, X, Y, Z))
{
SetVehicleToRespawn(car);
}
else
{
SendClientMessage(playerid, COLOR_WHITE, "No car in here!");
}
new str[35];
format(str, 35, "Car ID: %i was respawned.", car);
SendClientMessage(playerid, COLOR_GREY, str);
}
}
else SendClientMessage(playerid, COLOR_GREY, "You are not admin!");
return 1;
}