SA-MP Forums Archive
Car Respawn Command - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Car Respawn Command (/showthread.php?tid=379926)



Car Respawn Command - Beljulji - 23.09.2012

if someone looking for respawnallunusedcars here i will give you this
Код:
if(strcmp(cmdtext, "/respawnallcars", 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(COLOR_LIGHTGREEN,string);
	return 1;
}