oban command
#1

The server crash when i enter right player name, why?
PHP код:
COMMAND:oban(playeridparams[])
{
    if(
playerData[playerid][playerLoggedIn])
    {
        if(
playerData[playerid][playerLevel] >= 4)
        {
            new 
otherPlayerreason;
            if(
sscanf(params"us[250]"otherPlayerreason)) return SendClientMessage(playerid, -1"{FF0000}[ERROR] {FFFFFF}Usage: /oban <playername> <reason>");
            {
                new 
mysql[250], value[100][50], row[200];
//                new rows = mysql_num_rows();
                
format(mysqlsizeof(mysql), "SELECT * FROM `playerdata` WHERE `playerName` = '%s'"otherPlayer);
                
mysql_query(mysql);
                
mysql_store_result();
                if(
mysql_num_rows())
                {
                    
mysql_fetch_row(row"|"connection);
                     
explode(rowvalue"|");
                    new 
mysql1[250];
                    
format(mysql1sizeof(mysql1), "SELECT * FROM `playerdata` WHERE `playerName` = '%s'"otherPlayer);
                    
mysql_query(mysql1);
                    
mysql_fetch_row(value[4], "playerIP");
                    new 
banreason[350], msg[250], msg1[250];
                    
format(banreasonsizeof(banreason), "INSERT INTO `playerbans` (`banned_by`, `banned_for`, `player_banned`, `player_ip`) VALUES ('%s', '%s', '%s', '%s')"GetName(playerid), reasonotherPlayerplayerIP);
                    
mysql_query(banreason);
                    
format(msgsizeof(msg), "{33AA33}[ADMIN] Adminstrator %s(%i) has offline banned %s. {FFFF00}[REASON: %s]"GetName(playerid), playeridotherPlayer);
                    
SendClientMessageToAll(-1msg);
                    
format(msg1sizeof(msg1), "{33AA33}[ADMIN]{FFFFFF} You've offline banned %s for %s."otherPlayerreason);
                    
SendClientMessage(playerid, -1msg1);
                }
                else
                {
                    
SendClientMessage(playerid, -1"{FF0000}[ERROR]{FFFFFF} That player doesn't exist in the database.");
                }
            }
        }
    }
    else
    {
        
SendClientMessage(playerid, -1"{FF0000}[ERROR] {FFFFFF}You must be logged in to use commands.");
    }
    return 
1;

Reply


Messages In This Thread
oban command - by mmostafa - 03.06.2018, 13:19
Re: oban command - by SeanDenZYR - 03.06.2018, 13:46
Re: oban command - by mmostafa - 03.06.2018, 19:34
Re: oban command - by mmostafa - 03.06.2018, 22:50
Re: oban command - by insus100 - 04.06.2018, 00:01
Re: oban command - by GTLS - 04.06.2018, 05:13
Re: oban command - by mmostafa - 04.06.2018, 17:27
Re: oban command - by Stev - 04.06.2018, 17:42
Re: oban command - by mmostafa - 04.06.2018, 17:47
Re: oban command - by mmostafa - 04.06.2018, 17:51

Forum Jump:


Users browsing this thread: 1 Guest(s)