Raised This Month: $ Target: $400
 0% 

-identifier-


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Obada
Senior Member
Join Date: Dec 2014
Location: Abu Dhabi
Old 02-17-2015 , 10:32   -identifier-
Reply With Quote #1

Hey there,

Sorry for my noobish scripting help requests.

PHP Code:
public eNewRound()
{
    for(new 
i=0gMaxClientsi++)
    {
        if((
get_user_flags(i) == SILVER_FLAG && is_user_connected(i) && cs_get_user_money(i) < 1550.0)
            
cs_set_user_money(iget_pcvar_num(pCvarMoney), 1)
            
        else if((
get_user_flags(i) == GOLDEN_FLAG && is_user_connected(i) && cs_get_user_money(i) < 2000.0)
            
cs_set_user_money(iget_pcvar_num(pCvarMoney2), 1)
    }

Code:
//// extra money.sma
// C:\steamcmd\cs_server\cstrike\addons\amxmodx\scripting\extra money.sma(29) :
error 001: expected token: ")", but found "-identifier-"
// C:\steamcmd\cs_server\cstrike\addons\amxmodx\scripting\extra money.sma(32) :
error 001: expected token: ")", but found "-identifier-"

I just wanted to know what does -identifier- mean, cause I get it many times, and I forget how I solve it. Plus in my function above, what's wrong? I couldn't figure it out.

Once again, sorry for those scripting help requests.
Obada is offline
Kellan123
AlliedModders Donor
Join Date: Aug 2012
Old 02-17-2015 , 11:07   Re: -identifier-
Reply With Quote #2

PHP Code:
if(( 
to
PHP Code:
if( 


same else if
Kellan123 is offline
Flick3rR
Veteran Member
Join Date: Feb 2014
Location: Bulgaria, Stara Zagora
Old 02-17-2015 , 11:11   Re: -identifier-
Reply With Quote #3

Аlso that
PHP Code:
for(new i=0gMaxClientsi++) 
is not correct. Should be like that.
PHP Code:
for(new i=1<= gMaxClientsi++) 
__________________
Flick3rR is offline
Send a message via Skype™ to Flick3rR
Obada
Senior Member
Join Date: Dec 2014
Location: Abu Dhabi
Old 02-17-2015 , 11:23   Re: -identifier-
Reply With Quote #4

Thanks alot guys

Edit: Do you guys have any idea on what does -identifier- mean?

Last edited by Obada; 02-17-2015 at 11:45.
Obada is offline
Roccoxx
AlliedModders Donor
Join Date: Jan 2012
Location: Argentina
Old 02-17-2015 , 12:46   Re: -identifier-
Reply With Quote #5

a best code for you:

Code:
public eNewRound() 
{ 
    static flag, cvar, cvar2, money
	
    cvar = get_pcvar_num(pCvarMoney)
    cvar2 = get_pcvar_num(pCvarMoney2)
	
    for(new i=1; i <= gMaxClients; i++) 
    { 
		if(!is_user_connected(i)) continue;
		
		flag = get_user_flags(i)
		money = cs_get_user_money(i)
		
        if(flag == SILVER_FLAG && money < 1550)
            cs_set_user_money(i, cvar, 1)           
        else if(flag == GOLDEN_FLAG && money < 2000)
            cs_set_user_money(i, cvar2, 1) 
    } 
}
__________________
Tutorials here (Spanish)

Like as another Pijudo said: "Tired and retired"

Last edited by Roccoxx; 02-17-2015 at 12:46.
Roccoxx is offline
Send a message via MSN to Roccoxx
Reply



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 08:47.


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