AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   amx_tagct amx_tagt (https://forums.alliedmods.net/showthread.php?t=204995)

VisioNN 01-05-2013 15:55

amx_tagct amx_tagt
 
Hello! I want to add a Tag CT,Tag T to a message who show score. And i have problem with read arguments.

And I want Default tags to be tagct = CT & tagt = T
The Score is working, this is just a part from plugin!
Eq. If i use amx_tagct "GG" after that if I use .score he must show me (Score is: GG: x T: y )


PHP Code:

public plugin_init() 
{
    
register_concmd("amx_tagct""tagct"ACCESS"<Tag> - CT Tag");
    
register_concmd("amx_tagt""tagt"ACCESS"<Tag> - T Tag");
    
register_clcmd("say .score","say_score")
}

public 
say_score(id
{
    
client_print(idprint_chat"Score is: %s: %d %s: %d"tagctctcounttagttcount)
}
public 
tagctidlevelcid 


    if( !
cmd_accessidlevelcid) ) 
        return 
PLUGIN_HANDLED;       
    new 
tagct[32]; 
    
read_argv(1tagct); 
    
remove_quotes(tagct); 
    
console_print(id"Tag from CT team is  %s"tagct





public 
tagtidlevelcid 


    if( !
cmd_accessidlevelcid) ) 
        return 
PLUGIN_HANDLED;       
    new 
tagt[32]; 
    
read_argv(1tagtt); 
    
remove_quotes(tagt); 
    
console_print(id"Tag from T team is %s"tagt




YamiKaitou 01-05-2013 15:59

Re: amx_tagct amx_tagt
 
We can't help you without more of the plugin. Where are tagct and tagt being defined?

VisioNN 01-05-2013 16:05

Re: amx_tagct amx_tagt
 
PHP Code:

public tagctidlevelcid )
{

    if( !
cmd_accessidlevelcid) )
        return 
PLUGIN_HANDLED;      
    new 
tagct[32];
    
read_argv(1tagct);
    
remove_quotes(tagct);
    
console_print(id"Tag from CT team is  %s"tagct)


}


public 
tagtidlevelcid )
{

    if( !
cmd_accessidlevelcid) )
        return 
PLUGIN_HANDLED;      
    new 
tagt[32];
    
read_argv(1tagtt);
    
remove_quotes(tagt);
    
console_print(id"Tag from T team is %s"tagt)




YamiKaitou 01-05-2013 16:06

Re: amx_tagct amx_tagt
 
They need to be a global variable, not a local variable

VisioNN 01-05-2013 16:23

Re: amx_tagct amx_tagt
 
PHP Code:

#include <amxmodx>
#include <amxmisc>

#define ACCESS ADMIN_SLAY;
#define tagct = "CT";
#define tagt = "T";

public plugin_init() 
{
    
register_plugin("tag""1.0""tag");
    
register_concmd("amx_tagct""tagct"ACCESS"<Tagct> - CT Tag");
    
register_concmd("amx_tagt""tagt"ACCESS"<Tagt> - T Tag");
    
register_clcmd("say .score","say_score");
}

public 
say_score(id
{
    
client_print(idprint_chat"Score is: %s: 11 %s: 10"tagcttagt)
}
public 
tagctidlevelcid 


    if( !
cmd_accessidlevelcid) ) 
       return 
PLUGIN_HANDLED;       
 
    
read_argv(1tagct); 
    
remove_quotes(tagct); 
    
console_print(id"Tag from CT team is  %s"tagct





public 
tagtidlevelcid 


    if( !
cmd_accessidlevelcid) ) 
            return 
PLUGIN_HANDLED;        
    
read_argv(1tagtt); 
    
remove_quotes(tagt); 
    
console_print(id"Tag from T team is %s"tagt


/tmp/textKbjVMX.sma(11) : error 001: expected token: ",", but found ";"
/tmp/textKbjVMX.sma(11) : error 029: invalid expression, assumed zero
/tmp/textKbjVMX.sma(11) : warning 215: expression has no effect
/tmp/textKbjVMX.sma(11) : error 001: expected token: ";", but found ")"
/tmp/textKbjVMX.sma(11) : fatal error 107: too many error messages on one line

Compilation aborted.
4 Errors.

AngeIII 01-05-2013 16:25

Re: amx_tagct amx_tagt
 
PHP Code:

#define ACCESS ADMIN_SLAY
#define tagct  "CT"
#define tagt  "T" 


no need to use ; and =

but in your case you dont need to use DEFINE this is just replacement not a variable

PHP Code:

new tagct[] = "CT";
new 
tagt[] = "T"



but note that the size changed.
you can do this instead:

new tagct[32];
new tagt[32];
before plugin_init.

YamiKaitou 01-05-2013 16:27

Re: amx_tagct amx_tagt
 
#define will not work

VisioNN 01-05-2013 16:38

Re: amx_tagct amx_tagt
 
Thank`s now works that, but i have problem with read_argv

PHP Code:

#include <amxmodx>
#include <amxmisc>

#define ACCESS ADMIN_SLAY
new tagct[] = "CT";
new 
tagt[] = "T"

public 
plugin_init() 
{
    
register_plugin("tag""1.0""tag");
    
register_concmd("amx_tagct""tagct"ACCESS"<Tagct> - CT Tag");
    
register_concmd("amx_tagt""tagt"ACCESS"<Tagt> - T Tag");
    
register_clcmd("say .score","say_score");
}

public 
say_score(id
{
    
client_print(idprint_chat"Score is: %s: 11 %s: 10"tagcttagt)
}
public 
tagctidlevelcid 


    if( !
cmd_accessidlevelcid) ) 
       return 
PLUGIN_HANDLED;       
 
    
read_argv(1tagct); 
    
remove_quotes(tagct); 
    
console_print(id"Tag from CT team is  %s"tagct





public 
tagtidlevelcid 


    if( !
cmd_accessidlevelcid) ) 
            return 
PLUGIN_HANDLED;        
    
read_argv(1tagt); 
    
remove_quotes(tagt); 
    
console_print(id"Tag from T team is %s"tagt



/tmp/textiNPmU5.sma(20) : error 021: symbol already defined: "tagct"
/tmp/textiNPmU5.sma(23) : error 010: invalid function or declaration
/tmp/textiNPmU5.sma(24) : error 010: invalid function or declaration
/tmp/textiNPmU5.sma(26) : error 021: symbol already defined: "read_argv"
/tmp/textiNPmU5.sma(31) : error 054: unmatched closing brace
/tmp/textiNPmU5.sma(34) : error 021: symbol already defined: "tagt"
/tmp/textiNPmU5.sma(37) : error 010: invalid function or declaration
/tmp/textiNPmU5.sma(38) : error 010: invalid function or declaration

8 Errors.
Could not locate output file /home/groups/amxmodx/public_html/websc3/textiNPmU5.amx (compile failed).

YamiKaitou 01-05-2013 16:43

Re: amx_tagct amx_tagt
 
You cannot have a function and a variable as the same name

VisioNN 01-05-2013 16:48

Re: amx_tagct amx_tagt
 
PHP Code:

#include <amxmodx>
#include <amxmisc>

#define ACCESS ADMIN_SLAY
new tagct[] = "CT";
new 
tagt[] = "T"

public 
plugin_init() 
{
    
register_plugin("tag""1.0""tag");
    
register_concmd("amx_tagctt""tagct"ACCESS"<Tagct> - CT Tag");
    
register_concmd("amx_tagtt""tagt"ACCESS"<Tagt> - T Tag");
    
register_clcmd("say .score","say_score");
}

public 
say_score(id
{
    
client_print(idprint_chat"Score is: %s: 11 %s: 10"tagcttagt)
}
public 
tagcttidlevelcid 


    if( !
cmd_accessidlevelcid) ) 
       return 
PLUGIN_HANDLED;       
 
    
read_argv(1tagct); 
    
remove_quotes(tagct);
    
console_print(id"Tag from CT team is  %s"tagct

    return 
PLUGIN_HANDLED;



public 
tagttidlevelcid 


    if( !
cmd_accessidlevelcid) ) 
            return 
PLUGIN_HANDLED;        
    
read_argv(1tagt); 
    
remove_quotes(tagt); 
    
console_print(id"Tag from T team is %s"tagt
        
    return 
PLUGIN_HANDLED;


/tmp/textXZxDrc.sma(26) : error 088: number of arguments does not match definition
/tmp/textXZxDrc.sma(39) : error 088: number of arguments does not match definition

2 Errors.
Could not locate output file /home/groups/amxmodx/public_html/websc3/textXZxDrc.amx (compile failed).


All times are GMT -4. The time now is 13:21.

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