Raised This Month: $32 Target: $400
 8% 

Error: Invalid expression, assumed zero on line xxxx


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 12-13-2017 , 20:04   Error: Invalid expression, assumed zero on line xxxx
Reply With Quote #1

Hello, could you help me? I do not see any errors in writing the code but it is generating an error...


case 7:
{
if(get_pcvar_num(VarLockReady) == 1)
{
set_pcvar_num(VarLockReady,0)

new iPlayers[MAX_PLAYERS], iNum
get_players(iPlayers, iNum)
for(new i, id; i < iNum;i++)
{
id = iPlayers[i]

pReady[id] = false
TagRmv(id)
}
else
{
set_pcvar_num(VarLockReady,1)
}
new szName[33],szSteamID[33]
get_user_name(id,szName,sizeof(szName))
get_user_authid(id,szSteamID,sizeof(szSteamID ))
client_print_color(0,GREY,"%s O admin ^3%s - ^4%s^1 %sATIVOU O READY.",Pug_TagPrefix,szName,szSteamID, get_pcvar_num(VarLockReady) == 0 ? "" : "DES")
client_cmd(0,"speak buttons/blip2")

PUG_AdminMenu(id)
}
}
}

menu_destroy(Menu)
return PLUGIN_HANDLED
}

The error is in else that is in bold ...
iceeedr is offline
Send a message via Skype™ to iceeedr
zmd94
Veteran Member
Join Date: Nov 2013
Location: Malaysia (9w2zow).
Old 12-13-2017 , 21:27   Re: Error: Invalid expression, assumed zero on line xxxx
Reply With Quote #2

Change you above code with below:

HTML Code:
case 7:
{
	if(get_pcvar_num(VarLockReady) == 1)
	{
		set_pcvar_num(VarLockReady,0)

		new iPlayers[MAX_PLAYERS], iNum
		get_players(iPlayers, iNum)
		for(new i, id; i < iNum;i++)
		{
			id = iPlayers[i]

			pReady[id] = false
			TagRmv(id)
		}
		else
		{
			set_pcvar_num(VarLockReady,1)
		}
		
		new szName[33],szSteamID[33]
		get_user_name(id,szName,sizeof(szName))
		get_user_authid(id,szSteamID,sizeof(szSteamID ))
		client_print_color(0,GREY,"%s O admin ^3%s - ^4%s^1 %sATIVOU O READY.",Pug_TagPrefix,szName,szSteamID, get_pcvar_num(VarLockReady) == 0 ? "" : "DES")
		client_cmd(0,"speak buttons/blip2")

		PUG_AdminMenu(id)
	}

	menu_destroy(Menu)
	return PLUGIN_HANDLED
}
The problem is with the extra curly braces.
zmd94 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 19:08.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode