SA-MP Forums Archive
Respawn all - 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)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: Respawn all (/showthread.php?tid=149921)



Respawn all - Antonio [G-RP] - 24.05.2010

It doesnt respawn any vehicles... ? Help please

pawn Код:
if(strcmp(cmd, "/respawnall", true) == 0)
{
if(gAdminOnDuty[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "You must be on duty to use this command!");
return 1;
}
if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 6 && PlayerInfo[playerid][pRealAdmin] == 1)
{
for(new v=0;v<MAX_VEHICLES;v++)
{
if(!CarHasPlayer(v))
{
SetVehicleToRespawn(v);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "AdmCmd: %s has respawned all unoccupied vehicles",sendername);
SendClientMessageToAll(COLOR_ADMIN, string);
return 1;
}
}
}
}



Re: Respawn all - Antonio [G-RP] - 24.05.2010

Bump


Re: Respawn all - Ethan666 - 24.05.2010

Quote:
Originally Posted by Antonio (eternalrp.webatu.com)
It doesnt respawn any vehicles... ? Help please

pawn Код:
if(strcmp(cmd, "/respawnall", true) == 0)
{
if(gAdminOnDuty[playerid] != 1)
{
SendClientMessage(playerid, COLOR_GRAD2, "You must be on duty to use this command!");
return 1;
}
if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 6 && PlayerInfo[playerid][pRealAdmin] == 1)
{
for(new v=0;v<MAX_VEHICLES;v++)
{
if(!CarHasPlayer(v))
{
SetVehicleToRespawn(v);
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "AdmCmd: %s has respawned all unoccupied vehicles",sendername);
SendClientMessageToAll(COLOR_ADMIN, string);
return 1;
}
}
}
}
WTF your stealing Baylers work


Re: Respawn all - Antonio [G-RP] - 24.05.2010

Oh yea thats really baylers script.. fucking idiot.


Re: Respawn all - Ethan666 - 25.05.2010

Quote:
Originally Posted by Antonio (eternalrp.webatu.com)
Oh yea thats really baylers script.. fucking idiot.
Fucking idiot?mind your language you fucking kid


Re: Respawn all - Red_X - 25.05.2010

LOL,

pawn Код:
stock RespawnAllCars()
{
 new unoccupied[MAX_VEHICLES-1];
 for(new i=0; i<MAX_PLAYERS; i++)
 {
  if(IsPlayerInAnyVehicle(i)) unoccupied[GetPlayerVehicleID(i)] = 1;
 }
 
 for(new car = 1; car<(MAX_VEHICLES-1); car++)
 {
  if(unoccupied[car] == 0) SetVehicleToRespawn(car);
 }
}
Function found at http://forum.sa-mp.com/index.php?topic=61574.960


pawn Код:
if(strcmp(cmd, "/respawnall", true) == 0)
{
 if(gAdminOnDuty[playerid] != 1) return SendClientMessage(playerid, COLOR_GRAD2, "You must be on duty to use this command!");

 if ((IsPlayerAdmin(playerid)) || PlayerInfo[playerid][pAdmin] >= 6 && PlayerInfo[playerid][pRealAdmin] == 1)
 {
  RespawnAllCars();
 }
 return 1;
}
You get the idea.