Disable PM
#1

Hi. I have problem with my pm script. The problem is that, I already disabled my pm. So I will not receive any pm from any players. But I still received their pm even I disabled receiving pm's. Here is the script..

Код:

SetPVarInt(playerid, "PMEnabled", 1) <------ OnPlayerConnect

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))
		{
		    if(GetPVarInt(playerid, "PMEnabled") == 0)
      		{
      			pInfo[playerid][Clicked] = id;
	     		format(Jstring,sizeof(Jstring),"PM To %s(ID: %d) Type you message:", GetName(id), id);
				return ShowPlayerDialog(playerid,DIALOG_PRIVATE_MESSAGE,DIALOG_STYLE_INPUT,"Private Message",Jstring,"Send","Cancel");
			}
			return GameTextForPlayer(playerid, "~n~~n~~r~Player Disabled PM", 3000, 5);
		}
		else return ShowMessage(playerid, red, 2);
	}
	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))
		{
  			if(GetPVarInt(playerid, "PMEnabled") == 0)
  			{
             	return OnPrivateMessage(playerid, id, Message);
			}
			return GameTextForPlayer(playerid, "~n~~n~~r~Player Disabled PM", 3000, 5);
		}
		else return ShowMessage(playerid, red, 2);
	}
}

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: 1 Guest(s)