Disable PM
#4

Quote:
Originally Posted by knackworst
Посмотреть сообщение
pawn Код:
if(GetPVarInt(id, "PMEnabled") == 0) //Change to this
Before you were checking if the sender had PM enabled not the receiver.
Does this work?
Quote:
Originally Posted by ]Rafaellos[
Посмотреть сообщение
pawn Код:
CMD:pm(playerid,params[])
{
    if(PmDialog == 1)
    {
        new id;
        if(sscanf(params, "u", id)) return SendClientMessage(playerid, lighterblue, "Usage: /pm <PlayerID/Part of Nick>");
        if(IsPlayerConnected(id)) return ShowMessage(playerid, red, 2);
        if(GetPVarInt(id, "PMEnabled") == 1) return GameTextForPlayer(playerid, "~n~~n~~r~Player Disabled PM", 3000, 5);
       
        pInfo[playerid][Clicked] = id;
        format(Jstring,sizeof(Jstring),"PM To %s(ID: %d) Type you message:", GetName(id), id);
        ShowPlayerDialog(playerid,DIALOG_PRIVATE_MESSAGE,DIALOG_STYLE_INPUT,"Private Message",Jstring,"Send","Cancel");
    }
    else
    {
        new id,Message[128];
        if(sscanf(params, "us[128]",id, Message)) return SendClientMessage(playerid, lighterblue, "Usage: /pm <PlayerID/Part of Nick> <Message>");
        if(IsPlayerConnected(id)) return ShowMessage(playerid, red, 2);
        if(GetPVarInt(id, "PMEnabled") == 1) return GameTextForPlayer(playerid, "~n~~n~~r~Player Disabled PM", 3000, 5);

        OnPrivateMessage(playerid, id, Message);
    }
    return 1;
}

CMD:pms(playerid, params[])
{
    if(GetPVarInt(playerid, "PMEnabled") == 1)
    {
        SetPVarInt(playerid, "PMEnabled", 0);
        GameTextForPlayer(playerid, "~y~PM ~r~Disabled", 2000, 3);
    }
    else
    {
        SetPVarInt(playerid, "PMEnabled", 1);
        GameTextForPlayer(playerid, "~y~PM ~g~Enabled", 2000, 3);
    }
    return 1;
}
Knackworst - Where should I put if(GetPVarInt(id, "PMEnabled") == 0)?

and to Rafaellos - Not working. It says Player is not connected, when I do /pm [id] Also the dialog has gone its not showing.
Reply


Messages In This Thread
Disable PM - by kbalor - 29.09.2013, 18:48
Re: Disable PM - by knackworst - 29.09.2013, 18:52
Re: Disable PM - by ]Rafaellos[ - 29.09.2013, 18:53
Re: Disable PM - by kbalor - 29.09.2013, 19:00
Re: Disable PM - by ]Rafaellos[ - 29.09.2013, 19:03
Re: Disable PM - by knackworst - 29.09.2013, 19:07
Re: Disable PM - by Konstantinos - 29.09.2013, 19:10
Re: Disable PM - by ]Rafaellos[ - 29.09.2013, 19:11
Re: Disable PM - by kbalor - 29.09.2013, 19:23
Re: Disable PM - by Konstantinos - 29.09.2013, 19:32

Forum Jump:


Users browsing this thread: 5 Guest(s)