where to add this code. - 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: where to add this code. (
/showthread.php?tid=434810)
where to add this code. -
Tyrexo - 04.05.2013
Hi i want a working respawning sistem for respawning all the unused cars.
I wanted to use this :
pawn Код:
if(strcmp(cmd, "/respawnallcars", true) == 0 || strcmp(cmd, "/rac", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pAdmin] < 3)
{
SendClientMessage(playerid, COLOR_GRAD1, " 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(COLOR_WHITE,string);
}
return 1;
}
But it's giving me this error :
/imageshack/img27/151/40412410.jpg
pawn Код:
D:\Jocuri\Kituri\Server Samp\Server Samp\gamemodes\legenddead.pwn(21375) : warning 219: local variable "unwanted" shadows a variable at a preceding level
D:\Jocuri\Kituri\Server Samp\Server Samp\gamemodes\legenddead.pwn(35768) : error 010: invalid function or declaration
D:\Jocuri\Kituri\Server Samp\Server Samp\gamemodes\legenddead.pwn(35770) : error 010: invalid function or declaration
D:\Jocuri\Kituri\Server Samp\Server Samp\gamemodes\legenddead.pwn(35772) : error 010: invalid function or declaration
D:\Jocuri\Kituri\Server Samp\Server Samp\gamemodes\legenddead.pwn(35775) : error 010: invalid function or declaration
D:\Jocuri\Kituri\Server Samp\Server Samp\gamemodes\legenddead.pwn(35778) : error 010: invalid function or declaration
D:\Jocuri\Kituri\Server Samp\Server Samp\gamemodes\legenddead.pwn(35780) : error 010: invalid function or declaration
D:\Jocuri\Kituri\Server Samp\Server Samp\gamemodes\legenddead.pwn(35782) : error 010: invalid function or declaration
D:\Jocuri\Kituri\Server Samp\Server Samp\gamemodes\legenddead.pwn(35784) : error 010: invalid function or declaration
D:\Jocuri\Kituri\Server Samp\Server Samp\gamemodes\legenddead.pwn(35788) : error 021: symbol already defined: "BroadCast"
D:\Jocuri\Kituri\Server Samp\Server Samp\gamemodes\legenddead.pwn(35790) : error 010: invalid function or declaration
D:\Jocuri\Kituri\Server Samp\Server Samp\gamemodes\legenddead.pwn(35792) : warning 203: symbol is never used: "unwanted"