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; } |