[Help]Error
#1

I'm gtting this 1 erro if someone can help me please

C:\Documents and Settings\Administrador\Desktop\Roleplay\gamemodes\ la.pwn(30781) : error 017: undefined symbol "x_nr"

Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase

I was making a /give mats command to Raven's RP nd that the only error i got :/
Reply
#2

Problem is said clearly there:
You have use variable called x_nr which you haven't created.
Reply
#3

Код:
	
                                 new x_nr[24];
			x_nr = strtok(cmdtext, idx);
			if(!strlen(x_nr))
Код:
			else if(strcmp(x_nr,"mats",true) == 0)
			{
			    tmp = strtok(cmdtext, idx);
			    if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /give mats [playerid/PartOfName] [amount]");
					return 1;
				}
				giveplayerid = ReturnUser(tmp);
				if(IsPlayerConnected(giveplayerid))
				{
				    if(giveplayerid != INVALID_PLAYER_ID)
				    {
				        new Float:x, Float:y, Float:z;
			            GetPlayerPos(giveplayerid,x,y,z);
			            if(!IsPlayerInRangeOfPoint(playerid, 5, x, y, z))
			            {
			                SendClientMessage(playerid, COLOR_GRAD1, "** Player is not near you!");
			                return 1;
			            }
						tmp = strtok(cmdtext, idx);
						if(!strlen(tmp))
						{
							SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /give mats [playerid/PartOfName] [amount]");
							return 1;
						}
						new mammount;
						mammount = strval(tmp);
						if(mammount > PlayerInfo[playerid][pMats]) { SendClientMessage(playerid, COLOR_GREY, "   You don't have so many mats."); return 1; }
                        GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
						PlayerInfo[playerid][pMats] += mammount;
						PlayerInfo[giveplayerid][pMats] += mammount;
						if(PlayerInfo[playerid][pSex] == 1) { format(string, sizeof(string), "* %s takes out his sack with mats and hands it to %s.", sendername, giveplayer); }
						else { format(string, sizeof(string), "* %s takes out her sack with mats and hands it to %s.", sendername, giveplayer); }
						ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
				        new y1, m, d;
						new h,mi,s;
						getdate(y1,m,d);
						gettime(h,mi,s);
						format(string,sizeof(string), "(%d/%d/%d)[%d:%d:%d] %s [CMD] -> /give mats %s %d",d,m,y1,h,mi,s,sendername,giveplayer, mammount);
						CommandLog(string);
					}
				}
				else
				{
				    SendClientMessage(playerid, COLOR_GRAD1, "   Player is Offline!");
				    return 1;
				}
look what i made so far
Reply
#4

Can you say which line exactly gives the error
Reply
#5

Guessing this one:
pawn Код:
else if(strcmp(x_nr,"mats",true) == 0)
Make sure you've created the variable in the same function.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)