Help me fix /pm bug
#1

And me again, with another bug.
Now there is PM bug on my server. When i tried to do /pm, it appears like this.

There is no names and the ID is weird. I tried to pm to myself (/pm 0 test)

Please help me fix it.
Here is the code
PHP код:
CMD:pm(playeridparams[])
{
     new 
string[256], giveplayeridreason[128];
    if(
sscanf(params"us[128]"giveplayeridreason)) return SendClientMessage(playeridCOLOR_GREY"[USAGE] /pm [ID] [Message]");
    if(!
IsPlayerConnected(giveplayerid)) return SendClientMessage(playeridCOLOR_GREY"That user is not connected!");
    if(
ToggleAllPM 1)
     {
        if(
togglepm[giveplayerid] == 0)
         {
              
SendClientMessage(playeridCOLOR_LIGHTGREENS"[PM]{FFFFFF} Player tersebut menutup Player Messenger");
              return 
1;
         }
        
format(stringsizeof(string), "(( PM from [%d] %s: %s ))"GetPlayerNameEx(playerid), playeridreason);
        
SendClientMessage(giveplayeridCOLOR_YELLOWstring);
        
format(stringsizeof(string), "(( PM to [%d] %s: %s ))"GetPlayerNameEx(giveplayerid), giveplayeridreason);
        
SendClientMessage(playeridCOLOR_YELLOWstring);
    }
    else
    {
        
SendClientMessage(playeridCOLOR_LIGHTGREENS"[SERVER]{FFFFFF} System Player Messenger has been turned off.");
    }
    return 
1;
}
CMD:togallpm(playeridparams[])
{
    if(!
gPlayerLogged{playerid}) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(
AdminOnDuty[playerid] < 1) return SendClientMessage(playeridCOLOR_GREY"{007FFF}[IZIN] {FFFFFF}You must be on duty administrator to use this command");
    if(
PlayerInfo[playerid][pAdmin] < 1) return SendClientMessage(playeridCOLOR_GREY"{007FFF}[Izin] {FFFFFF}You are not authorized to use this command!");
    if(
ToggleAllPM == 0)
    {
        
ToggleAllPM 1;
        
SendClientMessageToAll(COLOR_LIGHTGREENS"[SERVER]{FFFFFF} System Player Message has been turned to [OFF].");
    }
    else
    {
        
ToggleAllPM 0;
        
SendClientMessageToAll(COLOR_LIGHTGREENS"[SERVER]{FFFFFF} System Player Message has been turned to [ON].");
    }
    return 
1;

THE /togpm
PHP код:
CMD:togpm(playerid,params[])
{
    if(
togglepm[playerid] == 1)
    {
        
SendClientMessage(playerid,0xff9900aa,"You have opened PM.");
        
togglepm[playerid] = 0;
    }
    else if(
togglepm[playerid] == 0)
    {
        
SendClientMessage(playerid,0xff9900aa,"You have closed PM.");
        
togglepm[playerid] = 1;
    }
    return 
1;

Reply


Messages In This Thread
Help me fix /pm bug - by Dirda - 04.02.2018, 05:50
Re: Help me fix /pm bug - by Inn0cent - 04.02.2018, 06:25
Re: Help me fix /pm bug - by Sew_Sumi - 04.02.2018, 07:06
Re: Help me fix /pm bug - by ShadowMortar - 04.02.2018, 07:11
Re: Help me fix /pm bug - by Sew_Sumi - 04.02.2018, 07:27
Re: Help me fix /pm bug - by Dirda - 04.02.2018, 08:01
Re: Help me fix /pm bug - by rfr - 04.02.2018, 08:13

Forum Jump:


Users browsing this thread: 2 Guest(s)