11.06.2010, 10:18
Can some one tell me how can i respawn cars? i use AddStaticVehicle On my gamemode. Sry for my bad english but is there any cmd/code to make it?
if(!strcmp(cmdtext,"/respawnvehicles,true,16))
{
if(!IsPlayerAdmin(playerid) return SendClientMessage(playerid,0xff0000aa,"You are not authorised to use this command");
new adminname[56], string[128];
GetPlayerName(playerid,adminname,sizeof(adminname));
format(string,sizeof(string), "[ADMIN] %s has Respawned all Vehicles",adminname);
for(new i=0; i<MAX_VEHICLES;i++)
{
if(!IsVehicleOccupied(i)
{
SetVehicleToRespawn(i);
}
}
return 1;
}
|
Originally Posted by DJDhan
Код:
if(!strcmp(cmdtext,"/respawnvehicles,true,16))
{
if(!IsPlayerAdmin(playerid) return SendClientMessage(playerid,0xff0000aa,"You are not authorised to use this command");
new adminname[56], string[128];
GetPlayerName(playerid,adminname,sizeof(adminname));
format(string,sizeof(string), "[ADMIN] %s has Respawned all Vehicles",adminname);
for(new i=0; i<MAX_VEHICLES;i++)
{
if(!IsVehicleOccupied(i)
{
SetVehicleToRespawn(i);
}
}
return 1;
}
|

forward IsVehicleOccupied(vehicleid);
public IsVehicleOccupied(vehicleid)
{
for(new i=0;i<MAX_PLAYERS;i++)
{
if(IsPlayerInVehicle(i,vehicleid)) return 1;
}
return 0;
}
|
Originally Posted by DJDhan
You have already got the answer, why are you bumping the topic?
|