#include <a_samp>
#include <zcmd>
forward VehicleOccupied(vehicleid);
CMD:respawncars(playerid,params[])
{
#pragma unused params
if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,-1,\"Nem vagy Admin!\");
SendClientMessage(playerid, 0xFF0606FF, \"{FF0606}Jármûvek Respawnolva!\");
GameTextForAll(\"~n~Jármûvek Respawnolva!\", 3000,3);
for(new cars=0; cars<MAX_VEHICLES; cars++)
{
if(!VehicleOccupied(cars))
{
SetVehicleToRespawn(cars);
}
}
return 1;
}
public VehicleOccupied(vehicleid)
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerInVehicle(i,vehicleid)) return 1;
}
return 0;
}