Respawn all unused cars - 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: Respawn all unused cars (
/showthread.php?tid=300319)
Respawn all unused cars -
wumpyc - 29.11.2011
Hey I'm using PPC_TRUCKING and this is the code:
pawn Код:
CMD:respawnallcars(playerid,params[])
{
if(IsPlayerConnected(playerid))
{
if (APlayerData[playerid][PlayerLevel] < 3)
{
SendClientMessage(playerid, 0xFF0000FF, "You are not authorized to use that command!");
return 1;
}
new bool:unwanted[CAR_AMOUNT];
for(new player=0; player<MAX_PLAYERS; player++)
{
if(IsPlayerInAnyVehicle(player)) { unwanted[GetPlayerVehicleID(player)]=true; }
}
for(new car = 1; car <= 268; car++)
{
if(!unwanted[car]) SetVehicleToRespawn(car);
}
GetPlayerName(playerid, sendername, sizeof(sendername));
format(string, sizeof(string), "SERVER: All unused cars respawned by %s.", sendername);
BroadCast(0xFFFFFFFF,string);
}
return 1;
}
But i get these errors:
pawn Код:
C:\Documents and Settings\wumpyc\Desktop\PPC_Trucking6\pawno\include\PPC_PlayerCommands.inc(10) : warning 217: loose indentation
C:\Documents and Settings\wumpyc\Desktop\PPC_Trucking6\pawno\include\PPC_PlayerCommands.inc(10) : error 017: undefined symbol "CAR_AMOUNT"
C:\Documents and Settings\wumpyc\Desktop\PPC_Trucking6\pawno\include\PPC_PlayerCommands.inc(10) : error 009: invalid array size (negative, zero or out of bounds)
C:\Documents and Settings\wumpyc\Desktop\PPC_Trucking6\pawno\include\PPC_PlayerCommands.inc(10) : error 036: empty statement
C:\Documents and Settings\wumpyc\Desktop\PPC_Trucking6\pawno\include\PPC_PlayerCommands.inc(10) : fatal error 107: too many error messages on one line
Compilation aborted.Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
Help pls
Re: Respawn all unused cars -
MP2 - 29.11.2011
http://pastebin.com/e29nBxEz