Raised This Month: $51 Target: $400
 12% 

Help in editing a code


Post New Thread Reply   
 
Thread Tools Display Modes
Fuck For Fun
Veteran Member
Join Date: Nov 2013
Old 01-12-2015 , 16:55   Re: Help in editing a code
Reply With Quote #11

You can add the stock every where ever you want.

about your question give me the full public of slap and slay.
Because I do not see any chat Print
Just log amx

Last edited by Fuck For Fun; 01-12-2015 at 16:57.
Fuck For Fun is offline
Send a message via Skype™ to Fuck For Fun
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 01-12-2015 , 19:53   Re: Help in editing a code
Reply With Quote #12

Quote:
Originally Posted by Fuck For Fun View Post
-->
Code:
client_print(0, print_chat, "%L %s", LANG_PLAYER, "RES_ACCEPTED_G1", GetUserName( id ))
Code:
stock GetUserName( const index )
{
    static szName[ 32 ];
    
    get_user_name( index, szName, charsmax( szName ) );
    
    return szName;
}
You should not be returning strings (aka array). They should be passed byref.
__________________
fysiks is offline
Obada
Senior Member
Join Date: Dec 2014
Location: Abu Dhabi
Old 01-13-2015 , 04:39   Re: Help in editing a code
Reply With Quote #13

I don't have any client_prints, they're mostly log_amx's.
Obada is offline
Obada
Senior Member
Join Date: Dec 2014
Location: Abu Dhabi
Old 01-16-2015 , 10:54   Re: Help in editing a code
Reply With Quote #14

By the way, why can't I compile it? :/

PHP Code:
public cmdCancelVote(idlevelcid)
{
    if (!
cmd_access(idlevelcid0))
        return 
PLUGIN_HANDLED
    
    
if (task_exists(998899881))
        {
        new 
authid[32], name[32]
        
        
get_user_authid(idauthid31)
        
get_user_name(idname31)
        
        
log_amx("Vote: ^"%s<%d><%s><>^" cancel vote session"nameget_user_userid(id), authid)
        
        if(
get_user_flags(id) & ADMIN_LEVEL_G)
        
show_activity_key("SILVER_CANC_VOTE_1""SILVER_CANC_VOTE_2"nameget_user_userid(id), authid)
        
        else if(
get_user_flags(id) & ADMIN_BAN)
        
show_activity_key("ADMIN_CANC_VOTE_1""ADMIN_CANC_VOTE_2"nameget_user_userid(id), authid)
        
        else if(
get_user_flags(id) & ADMIN_LEVEL_H)
        
show_activity_key("GOLDEN_CANC_VOTE_1""GOLDEN_CANC_VOTE_2"nameget_user_userid(id), authid)
        
        
        new 
maxpl=get_maxplayers();
        new 
msg[256];
        for (new 
1<= maxpli++)
        {
            if (
is_user_connected(i) && !is_user_bot(i))
                {
                
// HACK: ADMIN_CANC_VOTE_{1,2} keys were designed very poorly.  Remove all : and %s in it.
                
LookupLangKey(msgcharsmax(msg), "ADMIN_CANC_VOTE_1"i);
                
replace_all(msgcharsmax(msg), "%s""");
                
replace_all(msgcharsmax(msg), ":""");
                
trim(msg);
                
show_activity_id(iidnamemsg);
            }
        }
        
        
console_print(id"%L"id"VOTING_CANC")
        
client_print(0,print_chat,"%L",LANG_PLAYER,"VOTING_CANC")
        
remove_task(998899881)
        
set_cvar_float("amx_last_voting"get_gametime())
    }
    else
    
console_print(id"%L"id"NO_VOTE_CANC")
    
    return 
PLUGIN_HANDLED
}

public 
delayedExec(cmd[])
server_cmd("%s"cmd)

public 
autoRefuse()
{
    
log_amx("Vote: %L""en""RES_REF")
    
client_print(0print_chat"%L"LANG_PLAYER"RES_REF")
    
    if(
get_user_flags(id) & SILVER
    
client_print(0print_chat"Result refused by Silver Player: %s"name
    
    else if(
get_user_flags(id) & ADMIN
    
client_print(0print_chat"Result refused by Administrator: %s"name)
    
    else if(
get_user_flags(id) & GOLDEN
    
client_print(0print_chat"Result refused by Golden Player: %s"name)
}

public 
actionResult(idkey)
{
    
remove_task(4545454)
    
    switch (
key)
    {
        case 
0:
        {
            
set_task(2.0"delayedExec"0g_Executeg_execLen)
            
log_amx("Vote: %L""en""RES_ACCEPTED")
            
client_print(0print_chat"%L"LANG_PLAYER"RES_ACCEPTED")
            
            if(
get_user_flags(id) & SILVER
            
client_print(0print_chat"Result accepted by Silver Player: %s"name
            
            else if(
get_user_flags(id) & ADMIN
            
client_print(0print_chat"Result accepted by Administrator: %s"name)
            
            else if(
get_user_flags(id) & GOLDEN
            
client_print(0print_chat"Result accepted by Golden Player: %s"name)
        }
        case 
1autoRefuse()
    }
    
    return 
PLUGIN_HANDLED

Here is the error that I get from the compiler.
Code:
//// plmenu.sma
// C:\steamcmd\cs_server\cstrike\addons\amxmodx\scripting\plmenu.sma(135) : error 017: undefined symbol "id"

// C:\steamcmd\cs_server\cstrike\addons\amxmodx\scripting\plmenu.sma(136) : error 017: undefined symbol "name"

// C:\steamcmd\cs_server\cstrike\addons\amxmodx\scripting\plmenu.sma(136 -- 138) : error 088: number of arguments does not match definition

// C:\steamcmd\cs_server\cstrike\addons\amxmodx\scripting\plmenu.sma(138) : error 017: undefined symbol "id"

// C:\steamcmd\cs_server\cstrike\addons\amxmodx\scripting\plmenu.sma(138) : fatal error 107: too many error messages on one line

//
// Compilation aborted.
// 5 Errors.
// Could not locate output file C:\steamcmd\cs_server\cstrike\addons\amxmodx\scripting\compiled\plmenu.amx (compile failed).

//
// Compilation Time: 0.12 sec
// ----------------------------------------

Press enter to exit ...
Obada is offline
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 14:14.


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