AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Help in Script (https://forums.alliedmods.net/showthread.php?t=252116)

tousif 11-26-2014 06:39

Help in Script
 
Code:

#include <amxmodx>

#define PLUGIN "Tagger"
#define VERSION "1.0"
#define AUTHOR "Gullu Bhai"

#define cm(%1)        (sizeof(%1)-1)

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)

}

new const g_tag[] = {
}

public client_putinserver(client){
    static szName[32];
    get_user_name(client,szName,charsmax(szName));
   
    if(containi(szName, g_tag) != -1)

    format(szName,charsmax(szName),"%s %s",g_tag,szName);
    set_user_info(client,"name",szName);
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang16393\\ f0\\ fs16 \n\\ par }
*/

This is my code and i want to knw hw to add read file from .ini
Code:

new const g_tag[] = { here
}

Because when i add this tag "~=NarC^()~" it shows error because of some simbols so i need a ini file where i can add this tag

Help me plzz

YamiKaitou 11-26-2014 09:05

Re: Help in Script
 
An INI file would be a waste of resources. Tell us what the error is and we can probably help you fix it

tousif 11-27-2014 00:29

Re: Help in Script
 
tagger.sma(15) : error 027: invalid character constant tagger.sma(15) : error 027: invalid character constant 2 Errors. Could not locate output file tagger.amx (compile failed).

This is error when i am using new const g_tag[] = "~=NarC^()~";

~=NarC^()~ this tag i need it

Arkshine 11-28-2014 04:22

Re: error 027: invalid character constant
 
^ is an escape character. If you want to use it, you need to do: ^^

tousif 11-28-2014 04:27

Re: error 027: invalid character constant
 
Arkshine can u show it in code please

ddhoward 11-28-2014 04:53

Re: error 027: invalid character constant
 
Quote:

Originally Posted by tousif (Post 2229016)
Arkshine sir can u show it in code please

Just use 2 ^ instead of 1

^^ instead of ^

tousif 11-28-2014 04:53

Scripting Help
 
#include <amxmodx>

#define PLUGIN "Tagger"
#define VERSION "1.0"
#define AUTHOR "Gullu Bhai"

public plugin_init()
{
register_plugin(PLUGIN, VERSION, AUTHOR)
}

new const g_tag[] = "~=NarC^^()~";

public client_putinserver(client){
static szName[32];
get_user_name(client,szName,charsmax(szName)) ;

format(szName,charsmax(szName),"%s %s",g_tag,szName);
set_user_info(client,"name",szName);
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang16393\\ f0\\ fs16 \n\\ par }
*/


This is my script of tag plugin and i want that if player already containg that tag it must ignore tagging

any 1 plzz help

hleV 11-28-2014 05:20

Re: Scripting Help
 
PHP Code:

#include <amxmodx>

#define PLUGIN "Tagger"
#define VERSION "1.0"
#define AUTHOR "Gullu Bhai"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}

new const 
g_tag[] = "~=NarC^^()~";

public 
client_putinserver(client){
    static 
szName[32];
    
get_user_name(client,szName,charsmax(szName)) ;

    if (
contain(szNameg_tag) != 0// Check if tag starts at beginning of name.
    
{
        
format(szName,charsmax(szName),"%s %s",g_tag,szName);
        
set_user_info(client,"name",szName);
    }



tousif 11-28-2014 05:27

Re: Scripting Help
 
hw can i add one more tag to ignore

If that tag also exist ignore like i need to add 4 tags to ignore

plzz help me in this sir :)

tousif 11-28-2014 10:15

Re: Help in Script
 
tagger.sma(28) : error 088: number of arguments does not match definition

PHP Code:

#include <amxmodx>

#define PLUGIN "Tagger"
#define VERSION "1.0"
#define AUTHOR "Gullu Bhai"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
}

new const 
g_tag[] = "~=NarC^^()~";

new 
g_ig[] = {
"~=NarC^^(S)~",
"~=NarC^^(P)~",
"~=NarC^^(FuN)~",
"~=NarC^^(Fun)~",
"~=NarC^^(O)~",
"~=NarC^^(FUN)~",
"~=NarC^^(C)~"
}

public 
client_putinserver(client){
    static 
szName[32];
    
get_user_name(client,szName,charsmax(szName)) ;

    if (
contain(szNameg_tagg_ig) != 0// Check if tag starts at beginning of name.
    
{
        
format(szName,charsmax(szName),"%s %s",g_tag,szName);
        
set_user_info(client,"name",szName);
    }


this error when using this
PHP Code:

if (contain(szNameg_tagg_ig) != 0// Check if tag starts at beginning of name. 



All times are GMT -4. The time now is 17:37.

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