Raised This Month: $ Target: $400
 0% 

Need Help With a Script


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
deadman909
Veteran Member
Join Date: Oct 2008
Old 08-18-2009 , 03:32   Need Help With a Script
Reply With Quote #1

Error

PHP Code:
    register_concmd("amx_clanvsall","allvsclan",ADMIN_MENU," Clan Vs. Everyone Else <Clan Tag> <Clan Team: CT or T> ")
    
register_concmd("amx_unclanvsall","allvsall",ADMIN_MENU," Allows People To Join Other Teams Again. ")

    
register_forward(FM_PlayerPreThink,"FM_PreThink")

    
MAXPLAYERS get_maxplayers()
    
    
SVC_SCREENFADE get_user_msgid"ScreenFade" )
    
SVC_SCREENSHAKE get_user_msgid"ScreenShake" )
    
WTF_DAMAGE get_user_msgid"Damage" )

    
g_MsgSync CreateHudSyncObj()

#if defined DAMAGE_RECIEVED
    
g_MsgSync2 CreateHudSyncObj()
#endif

    
new config_dir[80]
    
get_configsdir(config_dir,79)
    
format(file_name,127,"%s/%s",config_dir,CONFIG_FILE// store path/file in global 'file_name'
    
    
new text[256],name[33],steamid[33],txtLen,line_num=0
    
// parse config file if exists
    
if (file_exists(file_name)){
        
line_num=read_file(file_name,line_num,text,255,txtLen// read first line
        
while(line_num){
            
parse(text,steamid,32,name,32)
            if (
line_num<=MAX_USERS){ // stop caching if MAX_USERS reached
                
if (strlen(steamid) && strlen(name)){
                    
// cache (SteamID -> PlayerName) pairs
                    
format(steam_names[line_num-1][0],34,"%s",steamid)
                    
format(steam_names[line_num-1][1],34,"%s",name)
                    
num_users=line_num // update number of listed users
                
}
                
line_num=read_file(file_name,line_num,text,255,txtLen// read next line
            
}else line_num=// MAX_USERS reached stop parsing
        
}
    }
}

public 
allvsclan(id,level,cid)
{
    if(!
cmd_access(id,level,cid,3))
    {
        return 
PLUGIN_HANDLED
    
}

    new 
arg1[32]
    new 
arg2[32]
    
read_argv(1,arg1,31)
    
read_argv(2,arg2,31)

    if(
equali(arg2,"CT")) CT=true           //This are the 2 LINES where i get the Errors
    
else if(equali(arg2,"T")) CT=false      //This are the 2 LINES where i get the Errors
    
else
    {
        
console_print(id,"Invalid Team")
        return 
PLUGIN_HANDLED
    
}

    
format(tag,31,"%s",arg1
__________________


Last edited by deadman909; 08-19-2009 at 09:58.
deadman909 is offline
Send a message via MSN to deadman909 Send a message via Yahoo to deadman909
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 08-18-2009 , 03:59   Re: Need Help With a Script
Reply With Quote #2

Hi. The reason you're getting errors is not from this code segment, but probably from something before it that you haven't posted, like a bracket you forgot to open or close before this point. I copied and pasted the code into a plugin and it compiled fine. If you wouldn't mind, please post the entirety of the code, and we can try to find the syntactical error, wherever it is. One error will often lead to multiple errors in areas that are actually correct.

As well, I personally think you should have the result of your conditional statements be on the lines below the statement, because what you have is a little hard for me to read.

And finally, why have you tried to cover up that your Windows user name is "deadman"? It's not like that's not your forum account name...
__________________
Bad_Bud is offline
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-18-2009 , 04:14   Re: Need Help With a Script
Reply With Quote #3

more code plox
__________________
xPaw is offline
deadman909
Veteran Member
Join Date: Oct 2008
Old 08-18-2009 , 07:04   Re: Need Help With a Script
Reply With Quote #4

i put more of the Code up
__________________

deadman909 is offline
Send a message via MSN to deadman909 Send a message via Yahoo to deadman909
xPaw
Retired AMX Mod X Moderator
Join Date: Jul 2008
Old 08-18-2009 , 08:59   Re: Need Help With a Script
Reply With Quote #5

Show where you create CT variable
__________________
xPaw is offline
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 08-18-2009 , 10:56   Re: Need Help With a Script
Reply With Quote #6

If you don't want to post the whole thing, and if you don't mind, you could send one of us the full script in a PM and we could probably find the error for you. The snippets aren't long enough.

On a second note, what you did post this time I still managed to compile, after creating all of the variables for it.
__________________
Bad_Bud is offline
deadman909
Veteran Member
Join Date: Oct 2008
Old 08-18-2009 , 12:19   Re: Need Help With a Script
Reply With Quote #7

Ive decided not to Put it in the Plugin to much Trouble. But thanks for the Help
__________________

deadman909 is offline
Send a message via MSN to deadman909 Send a message via Yahoo to deadman909
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 15:14.


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