AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   steamid replaced by get_user_ip = crash :( (https://forums.alliedmods.net/showthread.php?t=82555)

stylerro 12-25-2008 15:17

steamid replaced by get_user_ip = crash :(
 
hi all
i replaced steamid with IP , and the plugin make the server crash. can someone help ?
something is wrong there :

Code:


public check_player(id)
{
vault = nvault_open(VAULT_NAME);
 
if(vault != INVALID_HANDLE)
{
new ipid[33];
get_user_ip(id, ipid, 32, 1 ); <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<here
 
new temp[9] , timestamp;
 
if(!nvault_lookup(vault , ipid , temp , 8 , timestamp))
{
flagged[id] = false;
nvault_set(vault , ipid , "0");
nvault_close(vault);
return;
}
else
{
nvault_lookup(vault , ipid , temp , 8 , timestamp);
remove_quotes(temp);
if(str_to_num(temp) == 1)
{
flagged[id] = true;
if(get_user_flags(id) & ADMIN_IMMUNITY)
{
nvault_set(vault , ipid , "0");
unflag_player(id);
flagged[id] = false;
}
}
else if(str_to_num(temp) == 0)
flagged[id] = false;
}
}
 
nvault_close(vault);
}
 
public concmd_addhacker(id , lvl , cid)
{
if(!cmd_access(id , lvl , cid , 2))
return PLUGIN_HANDLED;
 
new arg[33];
read_argv(1 , arg , 32);
 
new pid = cmd_target(id , arg , 9);
 
if(!pid)
return PLUGIN_HANDLED;
 
new ipid[33];
get_user_ip(pid, ipid , 32, 1 ); <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< here
 
vault = nvault_open(VAULT_NAME);
 
if(vault == INVALID_HANDLE)
{
console_print(id , "[AMXX] Error opening vault file: %s" , VAULT_NAME);
return PLUGIN_HANDLED;
}
 
nvault_set(vault , ipid , "1");
 
nvault_close(vault);
 
#if defined MSG_DISABLED
new name[33];
get_user_name(pid , name , 32);
 
client_print(0 , print_chat , MSG_DISABLED , name);
#endif
 
flagged[pid] = true;
 
flag_player(pid);
 
client_print(pid , print_chat , MSG_FLAGGED);
 
console_print(id , "[AMXX] %s added to vault file: ^"%s^"" , ipid , VAULT_NAME);
 
return PLUGIN_HANDLED;
}

LE: the crash is becose somthing is wrong with vault, but what ? :(


All times are GMT -4. The time now is 09:08.

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