Disable PM
#10

pawn Код:
// OnPlayerConnect:
SetPVarInt(playerid, "PMEnabled", 1);

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(playerid, "PMEnabled") == 0) 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(playerid, "PMEnabled") == 0) 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;
}
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: 2 Guest(s)