AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Trying to change logging by STEAMID to IP (https://forums.alliedmods.net/showthread.php?t=96353)

Backstabnoob 07-04-2009 05:27

Trying to change logging by STEAMID to IP
 
Hi, as everytime I post here, I've got a problem.
I tried to change logging to database of AMX Warn plugin by STEAM ID to IP (Don't ask me why, the reason is simple, I'm running a LAN [well, you can say I am running nonsteam servers, I can't prove I'm not, but I am really not!])
Can you, please, look at the code and tell me what's wrong (or fix it)? Thank you.

The code:

PHP Code:

#define SQLON 1

#include <amxmodx> 
#include <amxmisc>

#if SQLON
    #include <dbi>
#endif

#if SQLON
    
new Sql:dbc
    
new Result:result
#else
    
new filepath[251]
#endif

new g_MsgScreenFade
new playerwarnings[32]
new 
swarnlevel[33]
new 
warned[33][33]
new 
usrip[35]
new 
target

public plugin_init() 

    
register_plugin("AMX Warn","1.71","twistedeuphoria"
    
register_concmd("amx_warn","swarn",ADMIN_BAN,"<username>")
    
register_concmd("amx_unwarn","unswarn",ADMIN_BAN,"<username>")
    
register_concmd("warn","playerwarn",ADMIN_USER,"<username> If enough players warn a player that player's warning level will be increased.")
    
register_cvar("amx_warn_lvl1","0")  // 0 = message 1 = slap 2 = slay 3 = kick 4 = temp ban 5 = perma ban
    
register_cvar("amx_warn_lvl2","1")
    
register_cvar("amx_warn_lvl3","2")
    
register_cvar("amx_warn_lvl4","3")
    
register_cvar("amx_warn_lvl5","4")
    
register_cvar("amx_slap_lvl1dmg","5")
    
register_cvar("amx_slap_lvl2dmg","5")
    
register_cvar("amx_slap_lvl3dmg","5")
    
register_cvar("amx_slap_lvl4dmg","5")
    
register_cvar("amx_slap_lvl5dmg","5")
    
register_cvar("amx_tempban_lvl1time","5")
    
register_cvar("amx_tempban_lvl2time","5")
    
register_cvar("amx_tempban_lvl3time","5")
    
register_cvar("amx_tempban_lvl4time","5")
    
register_cvar("amx_tempban_lvl5time","5")
    
register_cvar("amx_warn_flash","1"// 1 = Red 2 = White 3 = Random
    
register_cvar("amx_playerwarn_ratio","0.5")
    
register_cvar("amx_playerwarn_allow","1")
    
register_cvar("amx_savewarns","1")
    
#if SQLON
        
set_task(3.0,"sqlinit")
    
#else
        
new directory[201]
        
get_datadir(directory,200)
        
format(filepath,251,"%s/warned.txt",directory)
        if(!
file_exists(filepath))
        {
            new 
writestr[51]
            
format(writestr,50,"Warns will be saved in here.")
            
write_file(filepath,writestr)
        }
    
#endif    


#if SQLON
public sqlinit()
{
    new 
error[32],sqlhostname[35],sqluser[35],sqlpass[35],sqldbname[35]
    
get_cvar_string("amx_sql_host",sqlhostname,34)
    
get_cvar_string("amx_sql_user",sqluser,34)
    
get_cvar_string("amx_sql_pass",sqlpass,34)
    
get_cvar_string("amx_sql_db",sqldbname,34)
    
dbc dbi_connect(sqlhostname,sqluser,sqlpass,sqldbname,error,31)
    if(
dbc == SQL_FAILED)
    {
        
server_print("[AMX Warn]Could not connect to database.")
        return 
PLUGIN_HANDLED
    
}
    
result dbi_query(dbc,"CREATE TABLE IF NOT EXISTS `amxwarn` (`authid` VARCHAR(35), `warnlevel` TINYINT)")
    
dbi_free_result(result)
    return 
PLUGIN_HANDLED
}    
#endif

public swarn(id,level,cid)
{
    if(!
cmd_access(id,level,cid,2))
        return 
PLUGIN_HANDLED
    
new target[32],tid,suid,name[32]
    
read_args(target,31)
    
tid cmd_target(id,target,1)
    if(!
tid)
        return 
PLUGIN_HANDLED
    suid 
get_user_userid(tid)
    
get_user_name(tid,name,31)
    
flash(tid)
    
swarnlevel[tid]++
    switch(
swarnlevel[tid])
    {
        case 
1:
        {
            new 
punishment
            punishment 
get_cvar_num("amx_warn_lvl1")
            switch(
punishment)
            {
                case 
0:
                    
client_print(tid,print_center,"Dostal jsi WARN. 1/5")
                case 
1:
                {
                    new 
slapdmg get_cvar_num("amx_slap_lvl1dmg")
                    
user_slap(tid,slapdmg)
                    
client_print(tid,print_center,"Dostal jsi WARN. 1/5")
                }
                case 
2:
                {
                    
user_kill(tid)
                    
client_print(tid,print_center,"Dostal jsi WARN. 1/5")
                }
                case 
3:
                    
server_cmd("kick #%d",suid)
                case 
4:
                {
                    new 
banlength
                    banlength 
get_cvar_num("amx_tempban_lvl1time")
                    
server_cmd("banid %d #%d kick",banlength,suid)
                }
                case 
5:
                    
server_cmd("banid 0 #%d kick",suid)
            }
        }
        case 
2:
        {
            new 
punishment
            punishment 
get_cvar_num("amx_warn_lvl2")
            switch(
punishment)
            {
                case 
0:
                    
client_print(tid,print_center,"Dostal jsi WARN. 2/5")
                case 
1:
                {
                    new 
slapdmg get_cvar_num("amx_slap_lvl2dmg")
                    
user_slap(tid,slapdmg)
                    
client_print(tid,print_center,"Dostal jsi WARN. 2/5")
                }
                case 
2:
                {
                    
user_kill(tid)
                    
client_print(tid,print_center,"Dostal jsi WARN. 2/5")
                }
                case 
3:
                    
server_cmd("kick #%d",suid)
                case 
4:
                {
                    new 
banlength
                    banlength 
get_cvar_num("amx_tempban_lvl2time")
                    
server_cmd("banid %d #%d kick",banlength,suid)
                }
                case 
5:
                    
server_cmd("banid 0 #%d kick",suid)
            }
        }
        case 
3:
        {
            new 
punishment
            punishment 
get_cvar_num("amx_warn_lvl3")
            switch(
punishment)
            {
                case 
0:
                    
client_print(tid,print_center,"Dostal jsi WARN. 3/5")
                case 
1:
                {
                    new 
slapdmg get_cvar_num("amx_slap_lvl3dmg")
                    
user_slap(tid,slapdmg)
                    
client_print(tid,print_center,"Dostal jsi WARN. 3/5")
                }
                case 
2:
                {
                    
user_kill(tid)
                    
client_print(tid,print_center,"Dostal jsi WARN. 3/5")
                }
                case 
3:
                    
server_cmd("kick #%d",suid)
                case 
4:
                {
                    new 
banlength
                    banlength 
get_cvar_num("amx_tempban_lvl3time")
                    
server_cmd("banid %d #%d kick",banlength,suid)
                }
                case 
5:
                    
server_cmd("banid 0 #%d kick",suid)
            }
        }
        case 
4:
        {
            new 
punishment
            punishment 
get_cvar_num("amx_warn_lvl4")
            switch(
punishment)
            {
                case 
0:
                    
client_print(tid,print_center,"Dostal jsi WARN. 4/5")
                case 
1:
                {
                    new 
slapdmg get_cvar_num("amx_slap_lvl4dmg")
                    
user_slap(tid,slapdmg)
                    
client_print(tid,print_center,"Dostal jsi WARN. 4/5")
                }
                case 
2:
                {
                    
user_kill(tid)
                    
client_print(tid,print_center,"Dostal jsi WARN. 4/5")
                }
                case 
3:
                    
server_cmd("kick #%d",suid)
                case 
4:
                {
                    new 
banlength
                    banlength 
get_cvar_num("amx_tempban_lvl4time")
                    
server_cmd("amx_banip %d #%d Varovani 5/5",banlength,suid)
                }
                case 
5:
                    
server_cmd("banid 0 #%d kick",suid)
            }
        }
        default:
        {
            new 
punishment
            punishment 
get_cvar_num("amx_warn_lvl5")
            switch(
punishment)
            {
                case 
0:
                    
client_print(tid,print_center,"You have been warned five times by an admin. Do not continue your actions.")
                case 
1:
                {
                    new 
slapdmg get_cvar_num("amx_slap_lvl5dmg")
                    
user_slap(tid,slapdmg)
                    
client_print(tid,print_center,"You have been warned five times by an admin. Do not continue your actions.")
                }
                case 
2:
                {
                    
user_kill(tid)
                    
client_print(tid,print_center,"You have been warned five times by an admin. Do not continue your actions.")
                }
                case 
3:
                    
server_cmd("kick #%d",suid)
                case 
4:
                {
                    new 
banlength
                    banlength 
get_cvar_num("amx_tempban_lvl5time")
                    
server_cmd("amx_banip %d #%d Varovani 5/5",banlength,suid)
                }
                case 
5:
                    
server_cmd("banid 0 #%d kick",suid)
            }
        }
    }
    
console_print(id,"%s has been successfully warned.",name)
    new 
authid[35]
        
get_user_ip(target,usrip,34,1)    
    if(
containi(authid,"ID_LAN") != -1)
        
get_user_ip(target,usrip,34,1)
    
#if SQLON
        
result dbi_query(dbc,"SELECT * FROM amxwarn WHERE authid = '%s'",authid)
        if(
result >= RESULT_OK)
        {
            
dbi_free_result(result)
            
result dbi_query(dbc,"UPDATE amxwarn SET warnlevel = '%d' WHERE authid = '%s'",swarnlevel[tid],authid)
        }
        else
        {
            
dbi_free_result(result)
            
result dbi_query(dbc,"INSERT INTO amxwarn VALUES ( '%s' , '%d' )",authid,swarnlevel[tid])
        }
        
dbi_free_result(result)
    
#else
        
new retstr[51], inumabool:there falsefirstempty = -1
        
while(read_file(filepath,inum,retstr,50,a) != 0)
        {
            if(
strlen(retstr) <= 0firstempty inum
            
new fid[35], warnlevel[2]
            
parse(retstr,fid,34,warnlevel,1)
            new 
warnnum str_to_num(warnlevel)
            if(
equali(fid,authid))
            {
                
there true
                warnnum
++
                new 
newwarn[2]
                
num_to_str(warnnum,newwarn,1)
                
replace(retstr,50,warnlevel,newwarn)
                
write_file(filepath,retstr,inum)
            }
            
inum++
        }
        if(!
there)
        {
            new 
writestr[51]
            
format(writestr,50,"%s %d",authid,swarnlevel[tid])
            
write_file(filepath,writestr,firstempty)
        }
    
#endif                
    
return PLUGIN_HANDLED
}

public 
unswarn(id,level,cid)
{
    if(!
cmd_access(id,level,cid,2))
        return 
PLUGIN_HANDLED
    
new target[32],tid,name[32]
    
read_args(target,31)
    
tid cmd_target(id,target,2)
    if(!
tid)
        return 
PLUGIN_HANDLED
    get_user_name
(tid,name,31)
    if(
swarnlevel[tid] == 0)
        
console_print(id,"%s has not been warned.",name)
    else
    {
        
swarnlevel[tid] = 0                
        console_print
(id,"%s's warnings have been removed.",name)
        
client_print(tid,print_chat,"Your warnings have been removed.")
        new 
authid[35]
                
get_user_ip(target,usrip,31,1)        
    if(
containi(authid,"ID_LAN") != -1)
                
get_user_ip(target,usrip,31,1)            
        
#if SQLON
            
result dbi_query(dbc,"DELETE FROM amxwarn WHERE authid = '%s'",authid)
        
#else
            
new retstr[51], inuma
            
while(read_file(filepath,inum,retstr,50,a) != 0)
            {        
                new 
fid[35], warny[2]    
                
parse(retstr,fid,34,warny,1)
                if(
equali(authid,fid))
                {
                    new 
writestr[51]
                    
format(writestr,50,"^r")
                    
write_file(filepath,writestr,inum)
                }
                
inum++
            }
        
#endif
    
}
    return 
PLUGIN_HANDLED
}

public 
flash(id
{
    if(
get_cvar_num("amx_warn_flash") >= 1)
    {
        
g_MsgScreenFade get_user_msgid("ScreenFade")
        
message_begin(MSG_ONE,g_MsgScreenFade,{0,0,0},id)
        
write_short(1<<14)
        
write_short(1<<9)
        
write_short(1<<11)
        if(
get_cvar_num("amx_warn_flash"))
        {
            
write_byte255 )     
            
write_byte)
            
write_byte)
               
write_byte255 )
        }
        else if(
get_cvar_num("amx_warn_flash") == 2)
        {
            
write_byte255 )     
            
write_byte255 )
            
write_byte255 )
               
write_byte255 )
        }
        else if(
get_cvar_num("amx_warn_flash") == 3)
        {
            new 
red,green,blue
            red 
random_num(0,255)
            
green random_num(0,255)
            
blue random_num(0,255)
            
write_byte(red)
            
write_byte(green)
            
write_byte(blue)
            
write_byte(255)
        }
        
message_end()
    }
}

public 
client_putinserver(id)
{
    
playerwarnings[id] = 0
    swarnlevel
[id] = 0
    
new authid[35]
                
get_user_ip(target,usrip,31,1)    
    if(
containi(authid,"ID_LAN") != -1)
                
get_user_ip(target,usrip,31,1)
    
#if SQLON
        
result dbi_query(dbc,"SELECT * FROM amxwarn WHERE authid = '%s'",authid)
        if(
result >= RESULT_OK)
        {
            
dbi_nextrow(result)
            
swarnlevel[id] = dbi_result(result,"warnlevel")
        }
        
dbi_free_result(result)
    
#else
        
new retstr[51], inuma
        
while(read_file(filepath,inum,retstr,50,a) != 0)
        {
            new 
fid[35], warnlevel[2]
            
parse(retstr,fid,34,warnlevel,1)
            if(
equali(fid,authid))
                
swarnlevel[id] = str_to_num(warnlevel)            
            
inum++
        }
    
#endif
    
if(swarnlevel[id] > 0)
        
client_print(id,print_center,"Mas %s/5 varovani. Dodrzuj pravidla!",swarnlevel)
}

public 
client_disconnect(id)
{
    
playerwarnings[id] = 0
    swarnlevel
[id] = 0
}

public 
playerwarn(id)
{
    if(
get_cvar_num("amx_playerwarn_allow") == 1)
    {
        new 
target[32],tid,name[32],Float:perc,Float:make,suid
        read_args
(target,31)
        
tid cmd_target(id,target,1)
        if(!
tid)
            return 
PLUGIN_HANDLED
        
if(warned[id][tid] == 1)
        {
            
console_print(id,"You can only add your warn vote to up someone's warning level once per warning level.")
            return 
PLUGIN_HANDLED
        
}
        
playerwarnings[tid]++
        
perc floatdiv(float(playerwarnings[tid]),float(get_playersnum()))
        
make get_cvar_float("amx_playerwarn_ratio")
        
get_user_name(tid,name,31)
        
suid get_user_userid(tid)
        
client_print(0,print_chat,"%s's vote warn level has increased.  If %s's warning level should be increased use: warn %s.",name,name,name)
        
warned[id][tid] = 1
        
if(floatcmp(perc,make) == 1)
        {
            
client_print(0,print_chat,"%s's warning level has been increased.",name)
            for(new 
i=1;i<=get_playersnum();i++)
            {
                
warned[i][tid] = 0
                client_print
(i,print_chat,"You can attempt to up %s's warning level again.",name)
            }
            
playerwarnings[tid] = 0
            
switch(swarnlevel[tid])
            {
                case 
1:
                {    
                    new 
punishment
                    punishment 
get_cvar_num("amx_warn_lvl1")
                    switch(
punishment)
                    {
                        case 
0:
                            
client_print(tid,print_center,"You have been warned by the players of the server. Do not continue your actions.")
                        case 
1:
                        {
                            new 
slapdmg get_cvar_num("amx_slap_lvl1dmg")
                            
user_slap(tid,slapdmg)
                            
client_print(tid,print_center,"You have been warned by the players of the server. Do not continue your actions.")
                        }
                        case 
2:
                        {
                            
user_kill(tid)
                            
client_print(tid,print_center,"You have been warned by the players of the server. Do not continue your actions.")
                        }
                        case 
3:
                            
server_cmd("kick #%d",suid)
                        case 
4:
                        {
                            new 
banlength
                            banlength 
get_cvar_num("amx_tempban_lvl1time")
                            
server_cmd("banid %d #%d kick",banlength,suid)
                        }
                        case 
5:
                            
server_cmd("banid 0 #%d kick",suid)
                    }
                }
                case 
2:
                {
                    new 
punishment
                    punishment 
get_cvar_num("amx_warn_lvl2")
                    switch(
punishment)
                    {
                        case 
0:
                            
client_print(tid,print_center,"You have been warned twice by the players of the server. Do not continue your actions.")
                        case 
1:
                        {
                            new 
slapdmg get_cvar_num("amx_slap_lvl2dmg")
                            
user_slap(tid,slapdmg)
                            
client_print(tid,print_center,"You have been warned twice by the players of the server. Do not continue your actions.")
                        }
                        case 
2:
                        {
                            
user_kill(tid)
                            
client_print(tid,print_center,"You have been warned twice by the players of the server. Do not continue your actions.")
                        }
                        case 
3:
                            
server_cmd("kick #%d",suid)
                        case 
4:
                        {
                            new 
banlength
                            banlength 
get_cvar_num("amx_tempban_lvl2time")
                            
server_cmd("banid %d #%d kick",banlength,suid)
                        }
                        case 
5:
                            
server_cmd("banid 0 #%d kick",suid)
                    }
                }
                case 
3:
                {
                    new 
punishment
                    punishment 
get_cvar_num("amx_warn_lvl3")
                    switch(
punishment)
                    {
                        case 
0:
                            
client_print(tid,print_center,"You have been warned three times by the players of the server. Do not continue your actions.")
                        case 
1:
                        {
                            new 
slapdmg get_cvar_num("amx_slap_lvl3dmg")
                            
user_slap(tid,slapdmg)
                            
client_print(tid,print_center,"You have been warned three times by the players of the server. Do not continue your actions.")
                        }
                        case 
2:
                        {
                            
user_kill(tid)
                            
client_print(tid,print_center,"You have been warned three times by the players of the server. Do not continue your actions.")
                        }
                        case 
3:
                            
server_cmd("kick #%d",suid)
                        case 
4:
                        {
                            new 
banlength
                            banlength 
get_cvar_num("amx_tempban_lvl3time")
                            
server_cmd("banid %d #%d kick",banlength,suid)
                        }
                        case 
5:
                            
server_cmd("banid 0 #%d kick",suid)
                    }
                }
                case 
4:
                {
                    new 
punishment
                    punishment 
get_cvar_num("amx_warn_lvl4")
                    switch(
punishment)
                    {
                        case 
0:
                            
client_print(tid,print_center,"You have been warned four times by the players of the server. Do not continue your actions.")
                        case 
1:
                        {
                            new 
slapdmg get_cvar_num("amx_slap_lvl4dmg")
                            
user_slap(tid,slapdmg)
                            
client_print(tid,print_center,"You have been warned four times by the players of the server. Do not continue your actions.")
                        }
                        case 
2:
                        {
                            
user_kill(tid)
                            
client_print(tid,print_center,"You have been warned four times by the players of the server. Do not continue your actions.")
                        }
                        case 
3:
                            
server_cmd("kick #%d",suid)
                        case 
4:
                        {
                            new 
banlength
                            banlength 
get_cvar_num("amx_tempban_lvl4time")
                            
server_cmd("banid %d #%d kick",banlength,suid)
                        }
                        case 
5:
                            
server_cmd("banid 0 #%d kick",suid)
                    }
                }
                default:
                {
                    new 
punishment
                    punishment 
get_cvar_num("amx_warn_lvl5")
                    switch(
punishment)
                    {
                        case 
0:
                            
client_print(tid,print_center,"You have been warned five times by the players of the server. Do not continue your actions.")
                        case 
1:
                        {
                            new 
slapdmg get_cvar_num("amx_slap_lvl5dmg")
                            
user_slap(tid,slapdmg)
                            
client_print(tid,print_center,"You have been warned five times by the players of the server. Do not continue your actions.")
                        }
                        case 
2:
                        {
                            
user_kill(tid)
                            
client_print(tid,print_center,"You have been warned five times by the players of the server. Do not continue your actions.")
                        }
                        case 
3:
                            
server_cmd("kick #%d",suid)
                        case 
4:
                        {
                            new 
banlength
                            banlength 
get_cvar_num("amx_tempban_lvl5time")
                            
server_cmd("banid %d #%d kick",banlength,suid)
                        }
                        case 
5:
                            
server_cmd("banid 0 #%d kick",suid)
                    }
                }
            }
            new 
authid[35]
      
get_user_ip(target,usrip,31,1)        
            if(
containi(authid,"ID_LAN") != -1)
                        
get_user_ip(target,usrip,31,1)
            
#if SQLON
                
result dbi_query(dbc,"SELECT * FROM amxwarn WHERE authid = '%s'",authid)
                if(
result >= RESULT_OK)
                {
                    
dbi_free_result(result)
                    
result dbi_query(dbc,"UPDATE amxwarn SET warnlevel = '%d' WHERE authid = '%s'",swarnlevel[tid],authid)
                }
                else
                {
                    
dbi_free_result(result)
                    
result dbi_query(dbc,"INSERT INTO amxwarn VALUES ( '%s' , '%d' )",authid,swarnlevel[tid])
                }
                
dbi_free_result(result)
            
#else
                
new retstr[51], inumabool:there falsefirstempty = -1
                
while(read_file(filepath,inum,retstr,50,a) != 0)
                {
                    if(
strlen(retstr) <= 0firstempty inum
                    
new fid[35], warnlevel[2]
                    
parse(retstr,fid,34,warnlevel,1)
                    new 
warnnum str_to_num(warnlevel)
                    if(
equali(fid,authid))
                    {
                        
there true
                        warnnum
++
                        new 
newwarn[2]
                        
num_to_str(warnnum,newwarn,1)
                        
replace(retstr,50,warnlevel,newwarn)
                        
write_file(filepath,retstr,inum)
                    }
                    
inum++
                }
                if(!
there)
                {
                    new 
writestr[51]
                    
format(writestr,50,"%s %d",authid,swarnlevel[tid])
                    
write_file(filepath,writestr,firstempty)
                }
            
#endif                    
        
}
        else
        {
            new 
playersneeded
            
new Float:halfplayers
            halfplayers 
= (get_playersnum() * make)
            new 
hplayers floatround(halfplayers,floatround_ceil)
            
playersneeded = (hplayers playerwarnings[tid])
            
console_print(id,"%d more players need to warn %s to increase %s's warning level.",playersneeded,name,name)                        
        }
    }
    else
    {
        
console_print(id,"Player warns have been disabled.")
    }
    return 
PLUGIN_HANDLED


All I get while compiling are these errors:

Code:

//// warn.sma
// D:\CS. 1.6\Instal\Counter-Strike 1.6 Fun Server\cstrike\addons\amxmodx\script
ing\warn.sma(257) : warning 217: loose indentation
// D:\CS. 1.6\Instal\Counter-Strike 1.6 Fun Server\cstrike\addons\amxmodx\script
ing\warn.sma(257) : error 035: argument type mismatch (argument 1)
// D:\CS. 1.6\Instal\Counter-Strike 1.6 Fun Server\cstrike\addons\amxmodx\script
ing\warn.sma(258) : warning 217: loose indentation
// D:\CS. 1.6\Instal\Counter-Strike 1.6 Fun Server\cstrike\addons\amxmodx\script
ing\warn.sma(259) : error 035: argument type mismatch (argument 1)
// D:\CS. 1.6\Instal\Counter-Strike 1.6 Fun Server\cstrike\addons\amxmodx\script
ing\warn.sma(320) : warning 217: loose indentation
// D:\CS. 1.6\Instal\Counter-Strike 1.6 Fun Server\cstrike\addons\amxmodx\script
ing\warn.sma(320) : error 035: argument type mismatch (argument 1)
// D:\CS. 1.6\Instal\Counter-Strike 1.6 Fun Server\cstrike\addons\amxmodx\script
ing\warn.sma(321) : warning 217: loose indentation
// D:\CS. 1.6\Instal\Counter-Strike 1.6 Fun Server\cstrike\addons\amxmodx\script
ing\warn.sma(322) : error 035: argument type mismatch (argument 1)
// D:\CS. 1.6\Instal\Counter-Strike 1.6 Fun Server\cstrike\addons\amxmodx\script
ing\warn.sma(387) : warning 217: loose indentation
// D:\CS. 1.6\Instal\Counter-Strike 1.6 Fun Server\cstrike\addons\amxmodx\script
ing\warn.sma(388) : warning 217: loose indentation
// D:\CS. 1.6\Instal\Counter-Strike 1.6 Fun Server\cstrike\addons\amxmodx\script
ing\warn.sma(608) : warning 217: loose indentation
// D:\CS. 1.6\Instal\Counter-Strike 1.6 Fun Server\cstrike\addons\amxmodx\script
ing\warn.sma(608) : error 035: argument type mismatch (argument 1)
// D:\CS. 1.6\Instal\Counter-Strike 1.6 Fun Server\cstrike\addons\amxmodx\script
ing\warn.sma(609) : warning 217: loose indentation
// D:\CS. 1.6\Instal\Counter-Strike 1.6 Fun Server\cstrike\addons\amxmodx\script
ing\warn.sma(610) : error 035: argument type mismatch (argument 1)
//
// 6 Errors.
// Could not locate output file compiled\warn.amx (compile failed).
//
// Compilation Time: 0,14 sec
// ----------------------------------------

Press enter to exit ...

I know the code is f*cked up but all I want is to make it work. I am not really that good in coding (well, I can't code) to figure out why. If needed - original plugin is here:

http://forums.alliedmods.net/showthread.php?p=57411

Thank you for your help.

fysiks 07-04-2009 16:24

Re: Trying to change logging by STEAMID to IP
 
The errors are coming from this:

http://www.amxmodx.org/funcwiki.php?...r_ip&go=search

index is an integer not a string. You should be using the variable that is assigned with cmd_target().

Also,

Line 258, containi(authid,"ID_LAN") is always -1.

With usrip being global you will have race conditions.

You declare the variable "target" as a global integer and as a local string, bad. I'm amazed there is no error.

I swear, everyother line is get_user_ip()

Backstabnoob 07-04-2009 17:25

Re: Trying to change logging by STEAMID to IP
 
Thank you very much for you answer, but...
I still can't figure out how it works, still errors, still being pissed off... Could you be that good and give me full script (yes, you are for sure thinking I am just lazy to do that and want you to do all my work. Yes and no - I am not lazy, but scripting languages aren't my light side, all I know is HTML and CSS and I really need this for my server, cuz this system looks cool)? Many thanks...

DruGzOG 07-04-2009 21:21

Re: Trying to change logging by STEAMID to IP
 
Steam or non-steam?

Backstabnoob 07-05-2009 00:53

Re: Trying to change logging by STEAMID to IP
 
Quote:

STEAM ID to IP (Don't ask me why, the reason is simple, I'm running a LAN [well, you can say I am running nonsteam servers, I can't prove I'm not, but I am really not!])

DruGzOG 07-05-2009 14:58

Re: Trying to change logging by STEAMID to IP
 
Get Steam. I don't believe you at all.

minimiller 07-05-2009 15:08

Re: Trying to change logging by STEAMID to IP
 
if you're running a LAN server, do sv_lan 0 and put a password on it
cant be too hard to turn around and tell them the password now can it?


All times are GMT -4. The time now is 15:38.

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