PM script help
#2

I would make an function to process Pm's.

pawn Код:
stock OnPlayerGetPm(playerid, senderid, Text[])
{
     if(APlayerData[senderid][Muted] == true) return SendClientMessage(senderid, 0x0, "You are muted, and cannot send any message..");
     if(GetPVarInt(playerid, "NoPM") == 1) return SendClientMessage(senderid, 0x0, "This player has disabled pm's.");
     new string[128]; format(string, sizeof(string), "Pm from : %s ( %d ) : %s", GetPlayerNameEx(senderid), senderid, Text);
     SendClientMessage(playerid, 0x0, string);
     format(string, sizeof(string), "Pm  to : %s ( %d ) : %s", GetPlayerNameEx(playerid), playerid, Text);
     SendClientMessage(playerid, 0x0, string);
     return 1;
}
GetPlayerNameEx :

pawn Код:
stock GetPlayerNameEx(playerid)
{
     new pName[25];
     GetPlayerName(playerid, pName, sizeof(pName));
     return pName;
}
pawn Код:
command(pm, playerid, params[])
{
     new pID, tText[90];
     if(sscanf(params, "us[90]",  pID, tText)) return SendClientMessage(playerid, 0x0, "Usage /pm [playerid/Name & Text]");
     if(!IsPlayerConnected(pID))  return SendClientMessage(playerid, 0x0, "This player is not connected.");
     OnPlayerGetPm(pID, playerid, tText)
     return 1;
}
Reply


Messages In This Thread
PM script help - by thimo - 14.04.2011, 06:56
Re: PM script help - by Cameltoe - 14.04.2011, 07:03

Forum Jump:


Users browsing this thread: 2 Guest(s)