SA-MP Forums Archive
Warning 219 and 202 - 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: Warning 219 and 202 (/showthread.php?tid=390969)



Warning 219 and 202 - goviscrap - 08.11.2012

Ive got 3 Warnings on my GM script, How to fix it?
Код:
C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(15537) : warning 219: local variable "cookies" shadows a variable at a preceding level
C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(32589) : warning 202: number of arguments does not match definition
C:\Users\Nicklas\Desktop\PRP\gamemodes\PRP.pwn(34936) : warning 202: number of arguments does not match definition
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Warnings.
Код:
Line 15537: new cookies = PlayerInfo[targetid][pCookies];
Line 32589: SendClientMessage(playerid, COLOR_GRAD1, "You have set that players skin to %d !", skin);
Line 34936: SendClientMessage(giveplayerid, COLOR_GRAD2, "You (%s) have been silently kicked from the server.", sendername);
Please help me!


Respuesta: Warning 219 and 202 - ThePhenix - 08.11.2012

It should be:

PHP код:
new MSG[250];
new 
sendername[MAX_PLAYER_NAME];
GetPlayerName(playeridsendername,sizeof(sendername));
format(MSG,sizeof(MSG),"You (%s) have been silently kicked from the server."sendername);
SendClientMessage(playeridCOLOR_GRAD2,MSG);