Raised This Month: $ Target: $400
 0% 

steamid replaced by get_user_ip = crash :(


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stylerro
Senior Member
Join Date: Mar 2007
Old 12-25-2008 , 15:17   steamid replaced by get_user_ip = crash :(
Reply With Quote #1

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 ?

Last edited by stylerro; 12-25-2008 at 18:10.
stylerro 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 09:08.


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