Looking for an efficient way to verify the existance of an account
#2

You can send update query and check the affected rows count

PHP код:
/*Inside your ban command */
new query[75]; 
mysql_format(sql_connectionsizeof(query), "UPDATE player SET BANNED = 1 WHERE name = '%e'"name); //change the query according to your table structure 
mysql_tquery(sql_connectionquery"OnBanPlayer","d"playerid); //Playerid of player who executed command is passed to callback so as to send client message 
Then in the call back
PHP код:
forward OnBanPlayer(whomexecuted); 
public 
OnBanPlayer(whomexecuted

    
    if(!
cache_affected_rows()) return SendClientMessage(whomexecutedCOLOR_RED"This account does not exist."); 
    else
    { 
        
/*Ban the player...*/
        
SendClientMessage(whomexecutedCOLOR_RED"Banned player successfully.."); 
        return 
1;
    } 

Reply


Messages In This Thread
Looking for an efficient way to verify the existance of an account - by Robin96 - 11.06.2018, 02:17
Re: Looking for an efficient way to verify the existance of an account - by SyS - 11.06.2018, 02:58
Re: Looking for an efficient way to verify the existance of an account - by Gammix - 11.06.2018, 04:09
Re: Looking for an efficient way to verify the existance of an account - by Kane - 11.06.2018, 04:24
Re: Looking for an efficient way to verify the existance of an account - by Robin96 - 11.06.2018, 18:56

Forum Jump:


Users browsing this thread: 1 Guest(s)