Respawning all cars problem
#3

use this i use it and is the best respawns only unused vehicles
Код:
if(strcmp(cmdtext, "/respawncars", true) == 0){
    if(!IsPlayerAdmin(playerid)) return SendClientMessage(playerid,0xFF0000AA,"You can't use this command.");
    new vh=CreateVehicle(400,0.0,0.0,0.0,0.0,-1,-1,-1);
    DestroyVehicle(vh);
    new p[MAX_VEHICLES];
    for(new v = 0; v < vh; v++){
    p[v]=0;
    for(new i = 0; i < GetMaxPlayers(); i++){
    if(IsPlayerInVehicle(i,v)) p[v]=1;
}
	if(p[v]==0) SetVehicleToRespawn(v);
}
    new string[64], pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
    format(string,sizeof string,"Admin %s Has Respawned all Unused Cars!",pName);
    SendClientMessageToAll(lightgreen,string);
	return 1;
}
rep if this helped you
Reply


Messages In This Thread
Respawning all cars problem - by trapstar2020 - 24.09.2012, 19:01
Re: Respawning all cars problem - by Admigo - 24.09.2012, 20:04
Re: Respawning all cars problem - by Beljulji - 24.09.2012, 20:42

Forum Jump:


Users browsing this thread: 2 Guest(s)