Personal Message on/off
#1

im using this code (luxadmin) and i want to add pm off without changing the command.

if i type /pm it will say personal message on.
and when i type /pm again it will say Personal message off.

Quote:

dcmd_pm(playerid,params[])
{
if(!strlen(params)) return
SendClientMessage(playerid, orange, "Usage: /pm [PlayerID]");
PMplayer1 = strval(params);

if(PMplayer1 == playerid) return
SendClientMessage(playerid, red, "ERROR: You can't send PM to yourself!");

if(!(IsPlayerConnected(PMplayer1) && PMplayer1 != INVALID_PLAYER_ID)) return
SendClientMessage(playerid, red, "ERROR: Player not Connected!");

new string[128];
GetPlayerName(PMplayer1, PmReceiver, sizeof(PmReceiver));
format(string,sizeof(string),"PM To: \"%s(%d)\" \n\nType the message to send:", PmReceiver, PMplayer1);
ShowPlayerDialog(playerid,DIALOG_TYPE_PM,DIALOG_ST YLE_INPUT,"PrivateMessage",string,"Send!","Cancel" );
return 1;
}

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)