I Have Some Error In My Code
#1

Код:
./includes/NGGv5.1.pwn(107896) : error 029: invalid expression, assumed zero
./includes/NGGv5.1.pwn(107903) : warning 225: unreachable code
./includes/NGGv5.1.pwn(107903) : error 029: invalid expression, assumed zero
./includes/NGGv5.1.pwn(107909) : error 029: invalid expression, assumed zero
./includes/NGGv5.1.pwn(107916) : warning 225: unreachable code
./includes/NGGv5.1.pwn(107916) : error 029: invalid expression, assumed zero
./includes/NGGv5.1.pwn(107922) : error 029: invalid expression, assumed zero
./includes/NGGv5.1.pwn(107929) : warning 225: unreachable code
./includes/NGGv5.1.pwn(107929) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


6 Errors.
and this is line of those code
Код:
if(listitem == 0) // MP5
		    {
				if(PlayerInfo[playerid][pMats] >999 || PlayerInfo[playerid][pCash] >4999)) {
				GivePlayerCash(playerid, -50000);
				PlayerInfo[playerid][pMats] -=1000;
				GivePlayerWeapon(playerid, 29, 60000);
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Ban da nhan duoc Mp5.");
				return 1;
			    }
			    else {
			    SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Ban Khong Du Tien Hoac Khong Du Vat Lieu De Mua Vu KHi Nay.");
			    }
	        }
			if(listitem == 1) // D.E
			{
                if(PlayerInfo[playerid][pMats] >2999 || PlayerInfo[playerid][pCash] >99999)) {
                GivePlayerCash(playerid, -100000);
				PlayerInfo[playerid][pMats] -=3000;
				GivePlayerWeapon(playerid, 24, 60000);
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Ban dan nhan duoc D.E.");
				return 1;
			    }
				else {
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Ban Khong Du Tien Hoac Khong Du Vat Lieu De Mua Vu KHi Nay.");
			    }
            }
			if(listitem ==2) // M4
			{
                if(PlayerInfo[playerid][pMats] >9999 || PlayerInfo[playerid][pCash] >199999)) {
                GivePlayerCash(playerid, -200000);
				PlayerInfo[playerid][pMats] -=10000;
				GivePlayerWeapon(playerid, 31, 60000);
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Ban dan nhan duoc M4.");
				return 1;
			    }
			    else {
			    SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Ban Khong Du Tien Hoac Khong Du Vat Lieu De Mua Vu KHi Nay.");
			    }
            }
how to fix it. this is the error line :
Код:
if(PlayerInfo[playerid][pMats] >999 || PlayerInfo[playerid][pCash] >4999)) {
if(PlayerInfo[playerid][pMats] >2999 || PlayerInfo[playerid][pCash] >99999)) {
if(PlayerInfo[playerid][pMats] >9999 || PlayerInfo[playerid][pCash] >199999)) {
some body help me
Reply
#2

need some help thanks
Reply
#3

.............................
Reply
#4

.....................................
Reply
#5

...............................................
Reply
#6

Provide some more information about the errors, not only on the line the error occurred?
Reply
#7

Quote:
Originally Posted by MrViolence101
Посмотреть сообщение
Provide some more information about the errors, not only on the line the error occurred?
this is all my code of that part
Код:
if(dialogid == CHOBANVUKHI)
    {
		if(response)
	    {
	       	if(listitem == 0) // MP5
		    {
				if(PlayerInfo[playerid][pMats] >999 || PlayerInfo[playerid][pCash] >4999)) {
				GivePlayerCash(playerid, -50000);
				PlayerInfo[playerid][pMats] -=1000;
				GivePlayerWeapon(playerid, 29, 60000);
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Ban da nhan duoc Mp5.");
				return 1;
			    }
			    else {
			    SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Ban Khong Du Tien Hoac Khong Du Vat Lieu De Mua Vu KHi Nay.");
			    }
	        }
			if(listitem == 1) // D.E
			{
                if(PlayerInfo[playerid][pMats] >2999 || PlayerInfo[playerid][pCash] >99999)) {
                GivePlayerCash(playerid, -100000);
				PlayerInfo[playerid][pMats] -=3000;
				GivePlayerWeapon(playerid, 24, 60000);
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Ban dan nhan duoc D.E.");
				return 1;
			    }
				else {
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Ban Khong Du Tien Hoac Khong Du Vat Lieu De Mua Vu KHi Nay.");
			    }
            }
			if(listitem ==2) // M4
			{
                if(PlayerInfo[playerid][pMats] >9999 || PlayerInfo[playerid][pCash] >199999)) {
                GivePlayerCash(playerid, -200000);
				PlayerInfo[playerid][pMats] -=10000;
				GivePlayerWeapon(playerid, 31, 60000);
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Ban dan nhan duoc M4.");
				return 1;
			    }
			    else {
			    SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Ban Khong Du Tien Hoac Khong Du Vat Lieu De Mua Vu KHi Nay.");
			    }
            }
			if(listitem ==3) // C4
			{
				SendClientMessageEx(playerid, COLOR_LIGHTBLUE, "Dang Update C4.");
				return 1;
			}
		}
	}
Reply
#8

try this,
Код:
if((PlayerInfo[playerid][pMats] >999) || (PlayerInfo[playerid][pCash] >4999)) {
if((PlayerInfo[playerid][pMats] >2999) || (PlayerInfo[playerid][pCash] >99999)) {
if((PlayerInfo[playerid][pMats] >9999) || (PlayerInfo[playerid][pCash] >199999)) {
Reply
#9

Quote:
Originally Posted by MrViolence101
Посмотреть сообщение
try this,
Код:
if((PlayerInfo[playerid][pMats] >999) || (PlayerInfo[playerid][pCash] >4999)) {
if((PlayerInfo[playerid][pMats] >2999) || (PlayerInfo[playerid][pCash] >99999)) {
if((PlayerInfo[playerid][pMats] >9999) || (PlayerInfo[playerid][pCash] >199999)) {
let's me try
Reply
#10

It is because you didnt have the correct amount of brackets around your conditional statements.
It is supposed to work now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)