SA-MP Forums Archive
I Have Some Error In My Code - 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: I Have Some Error In My Code (/showthread.php?tid=616083)



I Have Some Error In My Code - thienle7090 - 31.08.2016

Код:
./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


Re: I Have Some Error In My Code - thienle7090 - 31.08.2016

need some help thanks


Re: I Have Some Error In My Code - thienle7090 - 31.08.2016

.............................


Re: I Have Some Error In My Code - thienle7090 - 31.08.2016

.....................................


Re: I Have Some Error In My Code - thienle7090 - 31.08.2016

...............................................


Re: I Have Some Error In My Code - MrViolence101 - 31.08.2016

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


Re: I Have Some Error In My Code - thienle7090 - 31.08.2016

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;
			}
		}
	}



Re: I Have Some Error In My Code - MrViolence101 - 31.08.2016

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)) {



Re: I Have Some Error In My Code - thienle7090 - 31.08.2016

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


Re: I Have Some Error In My Code - MrViolence101 - 31.08.2016

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