SA-MP Forums Archive
meds fees error help +1rep - 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: meds fees error help +1rep (/showthread.php?tid=337201)



meds fees error help +1rep - sscarface - 25.04.2012

i put meds fees system in my gm but i got 2 error


Код:
public OnPlayerDeath(playerid, killerid, reason)
{
        new string[256];
	new mrand =random(5000);
	format(string, sizeof(string),"The hospital has charged you $%d for their medical services.",mrand);
	SendClientMessage(playerid,0xFF4500AA, string);
	GivePlayerMoney(playerid,-mrand);
and


Код:
C:\DOCUME~1\BALOCH\MYDOCU~1\DOWNLO~1\SAMP03~1\GAMEMO~1\COPSAN~1.PWN(2615) : warning 219: local variable "string" shadows a variable at a preceding level
C:\DOCUME~1\BALOCH\MYDOCU~1\DOWNLO~1\SAMP03~1\GAMEMO~1\COPSAN~1.PWN(2624) : warning 219: local variable "string" shadows a variable at a preceding level
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


2 Warnings.



Re: meds fees error help +1rep - sscarface - 25.04.2012

help me fast i need it


Re: meds fees error help +1rep - Azazelo - 25.04.2012

Change new string[256]; name in something else


Re: meds fees error help +1rep - sscarface - 25.04.2012

something else? can u give me something else


Re: meds fees error help +1rep - sscarface - 25.04.2012

pls come fix this and fast and this is small error but i can't fix this i much try but not work can u come with team viewer fix it pls

493 840 792
9603


Re: meds fees error help +1rep - SuperViper - 25.04.2012

This has been told so many times, do not give your strings 256 cells unless you really need it. The maximum length of a client message is 128. That warning means the variable string is already globally defined, so just remove

pawn Код:
new string[256];