respawn all cars with a 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: respawn all cars with a command? (
/showthread.php?tid=179200)
respawn all cars with a command? -
Face9000 - 25.09.2010
Someone know how to do?
I want respawn all cars with a command..thanks
Re: respawn all cars with a command? -
FireCat - 25.09.2010
Код:
if(!strcmp(cmdtext, "/respawncars", true))
{
for(new i = 0; i < MAX_VEHICLES; i++)
{
new name[ 24 ], string[ 64 ];
GetPlayerName( playerid, name, 24 );
format( string, sizeof(string), "%s has respawned the cars", name );
GameTextForAll( string, 1000, 1 );
SetVehicleToRespawn(i);
}
return 1;
}
Re: respawn all cars with a command? -
ScottCFR - 25.09.2010
You may want to check if there are players in those cars. Could get buggy.
Re: respawn all cars with a command? -
[XST]O_x - 25.09.2010
pawn Код:
if(strcmp(cmdtext,"/respawncars",true) == 0)
{
new name[MAX_PLAYER_NAME],string[32];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"The player \"%s\" has set the vehicles to respawn.",name);
SendClientMessageToAll(COLOR,string);
for(new i = 0; i < MAX_VEHICLES; i++)
{
if(IsPlayerInVehicle(i,i))
{
RemovePlayerFromVehicle(i);
}
SetVehicleToRespawn(i);
}
return 1;
}