Offline ban system, can't get it to work
#1

Hello.
right now i got this:
PHP код:
COMMAND:osuspend(playeridparams[])
{
    if(!
PlayerInfo[playerid][power]) return SendClientError(playeridCANT_USE_CMD);
    new 
iPlayer[40], eReason128 ];
    if(
sscanf(params,"ss"iPlayereReason))  return SCP(playerid"[Exact_Name] [Reason]");
    new 
query[400],query2[400],string2[128],messaggio[MAX_STRING], string[MAX_STRING],query3[128],temp_ip[32],temp_gpci[100];
    
format(query,sizeof(query),"INSERT INTO suspended (username,reason,bannedby,whendidithappen) VALUES ('%s','%s','%s','%s')",iPlayer,eReason,AnonAdmin(playerid),TimeDate());
    
mysql_function_query(dbhandle,query,false,"","");
    
format(messaggio,sizeof(messaggio),"{FF0000}[Admin]{FF6347} %s has offline-suspended %s. Reason: %s",AnonAdmin(playerid),iPlayer,eReason);
    
format(string,sizeof(string), "4{ OSUSPEND } %s[%d] has offline-suspended %s. Reason: %s %s",AnonAdmin(playerid), playeridiPlayer,  eReasonTimeDate());
    
format(string2,sizeof(string2),"[OSUSPEND] By %s for %s",AnonAdmin(playerid),eReason);
    
    
format(query3,sizeof(query3),"SELECT * FROM user WHERE username ='%s'",iPlayer);
    
mysql_function_query(dbhandle,query3,true,"","");
    
cache_get_field_content(0"regip"temp_ip);
    
format(temp_ip,sizeof(temp_ip),"%s",temp_ip);
    
cache_get_field_content(0"reggpci"temp_gpci);
    
format(temp_gpci,sizeof(temp_gpci),"%s",temp_gpci);
       
SendMessageToAll(COLOR_RED,messaggio);
       
iEcho(string);
       
format(query2,sizeof(query2),"INSERT INTO adminlogs (username,ip,bywho,gpci,wat,whendidithappen) VALUES ('%s','%s','%s','%s','%s','%s')",iPlayer,temp_ip,AnonAdmin(playerid),temp_gpci,string2,TimeDate());
    
mysql_function_query(dbhandle,query2,false,"","");
return 
1;

When type /osuspend Exact_Name, everything gets put in the database nicely, except for the GPCI and the IP.


It just stays blank.
The problem is probably somewhere in this code:
PHP код:
 format(query3,sizeof(query3),"SELECT * FROM user WHERE username ='%s'",iPlayer);
    
mysql_function_query(dbhandle,query3,true,"","");
    
cache_get_field_content(0"regip"temp_ip);
    
format(temp_ip,sizeof(temp_ip),"%s",temp_ip);
    
cache_get_field_content(0"reggpci"temp_gpci);
    
format(temp_gpci,sizeof(temp_gpci),"%s",temp_gpci); 
Can you please help me?
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)