SA-MP Forums Archive
Can somebody help with 4 errors? - 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: Can somebody help with 4 errors? (/showthread.php?tid=443804)



Can somebody help with 4 errors? - superaconi - 13.06.2013

I made this command but when i want to compile it i have 4 erros:

Код:
C:\Icons\Samp Fajlovi\Ultra Gaming RP v.1.8\gamemodes\UGRPG.pwn(51721) : error 017: undefined symbol "str"
C:\Icons\Samp Fajlovi\Ultra Gaming RP v.1.8\gamemodes\UGRPG.pwn(51721) : error 017: undefined symbol "str"
C:\Icons\Samp Fajlovi\Ultra Gaming RP v.1.8\gamemodes\UGRPG.pwn(51721) : error 029: invalid expression, assumed zero
C:\Icons\Samp Fajlovi\Ultra Gaming RP v.1.8\gamemodes\UGRPG.pwn(51721) : fatal error 107: too many error messages on one line
This is my command:

Код:
if (strcmp("/givelevel", cmdtext, true) == 0)
    {
        if(PlayerInfo[playerid][pAdmin] >= 1337)
        {
            foreach(Player, i)
            {
				PlayerInfo[i][pLevel] += 1;
			}
	                format(str, sizeof(str), "Admin give level up for all players!");
			SendClientMessageToAll(COLOR_LIGHTBLUE,str);
			return 1;
		}
		else
		{
		    SendClientMessage(playerid, COLOR_ASKQ, "You are not allowed to do that!");
		}
	}
Red line is line 51721 can somebody help me please and to fix all command?


Re: Can somebody help with 4 erros? - -CaRRoT - 13.06.2013

You gotta add

PHP код:
new str[128]; 
at the top of your command or above the format line.


Re: Can somebody help with 4 erros? - superaconi - 13.06.2013

Quote:
Originally Posted by -CaRRoT
Посмотреть сообщение
You gotta add

PHP код:
new str[128]; 
at the top of your command or above the format line.
can you tell me about that what that mean?
I'm beginner.