SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 30/03/2020, 01:21 AM   #1
HeroDR22
Little Clucker
 
HeroDR22's Avatar
 
Join Date: Jan 2018
Posts: 49
Reputation: 24
Default pBanned = 0

pBanned.
I don't know what is the true define for this.

Does this work ? pInfo[playerid][pBanned] = 0;?
or pInfo[params][pBanned] = 0;
since the params is the nickname?

pawn Code:
CMD:unban(playerid, params[])
{
        if(isnull(params))
        return SendUsagePlaya(playerid, "/unban [nickname]");

    new sql_query[220];
    mysql_format(mysqlHandle, sql_query, sizeof(sql_query), "SELECT * FROM `bans` WHERE `nick` = '%s'", params);
    mysql_query(mysqlHandle, sql_query, true);
   
    if(!cache_num_rows())
        return SendErrorPlaya(playerid, "This player isn't banned.");

    mysql_format(mysqlHandle, sql_query, sizeof(sql_query), "DELETE FROM `bans` WHERE `nick` = '%s'", params);
    mysql_tquery(mysqlHandle, sql_query);
    format(sql_query, sizeof(sql_query),"{AAFF00}[Info] {AAAAAA}%s was successfully unbanned.", params);

    SendClientMessage(playerid, 0xF4A460FF, sql_query);
    return 1;
}
__________________
I am looking for professional scripters
Willing to pay a good price - DenisM4#2116
HeroDR22 is offline   Reply With Quote
Old 30/03/2020, 02:47 AM   #2
Nuginity
Big Clucker
 
Nuginity's Avatar
 
Join Date: Feb 2020
Location: Indonesia (Jakarta)
Posts: 61
Reputation: 2
Default Re: pBanned = 0

Quote:
Originally Posted by HeroDR22 View Post
pBanned
Does this work ? pInfo[playerid][pBanned] = 0;?
or pInfo[params][pBanned] = 0;
since the params is the nickname?
You don't need to change the enumators since the player isn't online, just "UPDATE" or "DELETE" the rows where the player name is params, and check when player connect is he banned or no with "pInfo[playerid][pBanned] = 0;"
PHP Code:
OnplayerConnect(playerid)
{
    if(
bantime 0)
     {
         
pInfo[playerid][pBanned] = 0;
         
//continue with your code 
__________________
Nusantara Freeroam
Current Stage : ALPHA
-------------------------------------------
We Need an Indonesian's Scripter now!
Nuginity is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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



All times are GMT. The time now is 07:14 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.