#pragma unused params for(new i = 0; i < MAX_VEHICLES; i++) { if(!IsPlayerNPC(playerid)) return 0; SetVehicleToRespawn(i); } GetPlayerName(playerid, name, sizeof(name)); format(string, sizeof(string), "[News] %sRe Spawned All Cars.",name); SendClientMessageToAll(COLOR_PINK, string); return 1; }
#pragma unused params
for(new i = 0; i < MAX_VEHICLES; i++)
{
if(IsPlayerInVehicle(-1, i)) continue;
SetVehicleToRespawn(i);
}
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "[News] %sRe Spawned All Cars.",name);
SendClientMessageToAll(COLOR_PINK, string);
return 1;
}
for(new i = 0; i < MAX_PLAYERS; i++)
{
for(new v = 1; v < MAX_VEHICLES; v++)
{
if(IsPlayerNPC(i) && IsPlayerInVehicle(i, GetPlayerVehicleID(i))) continue;
SetVehicleToRespawn(v);
}
}
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "[News] %sRe Spawned All Cars.",name);
SendClientMessageToAll(COLOR_PINK, string);
return 1;
}
Oh, mmh, then try to replace the IsPlayerInVehicle with a IsPlayerInAnyVehicle(i);
|
new bool:notnpcvehicle[MAX_VEHICLES];
for(new i = 0; i < MAX_PLAYERS; i++)
{
if(IsPlayerNPC(i) && IsPlayerInAnyVehicle(i)) { notnpcvehicle[GetPlayerVehicleID(i)]=true; }
}
for(new v = 0; v < MAX_VEHICLES; v++)
{
if(!notnpcvehicle[v])
{
SetVehicleToRespawn(v);
}
}
GetPlayerName(playerid, name, sizeof(name));
format(string, sizeof(string), "[News] %sRe Spawned All Cars.",name);
SendClientMessageToAll(COLOR_PINK, string);
return 1;
}