23.10.2012, 10:45
can someone help me i need a pm script which sends a pm to a player and a 3d text is recieved by a player taht "pm recieved" and to the sender a 3d text is again recieved by the plyer "pm sent"
CMD:pm(playerid, params[]) { new pmID, pmMSG[64], stringsnd[128], stringfrm[128]; if(sscanf(params, "us[64]", pmID, pmMSG)) return SendClientMessage(playerid, COLOR_SYNTAX, "[Syntax]: /pm [playerid] [message]"); if(pmID == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "[Error]: Invalid playerid."); { if(PlayerInfo[playerid][pAduty] == 1) { format(stringfrm, sizeof(stringfrm), "(( PM from {F78009}%s{F2DB0D} (%i): %s ))", GetName(playerid), playerid, pmMSG); SendClientMessage(pmID, COLOR_PM, stringfrm); format(stringsnd, sizeof(stringsnd), "(( PM sent to %s (%i): %s ))", GetName(pmID), pmID, pmMSG); SendClientMessage(playerid, COLOR_PM, stringsnd); } else { format(stringfrm, sizeof(stringfrm), "(( PM from %s (%i): %s ))", GetName(playerid), playerid, pmMSG); SendClientMessage(pmID, COLOR_PM, stringfrm); format(stringsnd, sizeof(stringsnd), "(( PM sent to %s (%i): %s ))", GetName(pmID), pmID, pmMSG); SendClientMessage(playerid, COLOR_PM, stringsnd); } } return 1; }
CMD:pm(playerid,params[])
{
new target,tName[MAX_PLAYER_NAME],message[100],pName[MAX_PLAYER_NAME],string[124];
if(sscanf(params,"us[100]",target,message)) return SendClientMessage(playerid,-1,"Error:/pm [playerid] [message]");
if(!IsPlayerConnected(target)) return SendClientMessage(playerid,-1,"ERROR:Player not connected");
GetPlayerName(target,tName,sizeof(tName));
GetPlayerName(playerid,pName,sizeof(pName));
format(string,sizeof(string),"PM From %s - %s");
GameTextForPlayer(target,string,10000,0);
return 1;
}