29.09.2013, 18:48
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;
}



I will edit my first post. Copy it from there again, will work.