[Help] Pm Script
#1

OK CAN SOMEONE HELP ME SCRIPT A PM SCRIPT?

Thanks For Reading + Helping
Reply
#2

Код:
CMD:pm(playerid,params[])
{
    new id;
	new string[256];
	new pName[MAX_PLAYER_NAME];
	new pName2[MAX_PLAYER_NAME];
	if(sscanf(params,"us[128]",id)) return SendClientMessage(playerid,COLOR_YELLOW,"Correct Usage:/pm [ID] [Text]");
	if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid,COLOR_RED,"Player ID Doesn't Exist");
	{
	    GetPlayerName(playerid,pName,sizeof(pName));
        GetPlayerName(id,pName2,sizeof(pName2));
        format(string,sizeof(string),"Private Message Recived From: [%s]: %s",pName,params);
        GameTextForPlayer(playerid, "~w~Private Message ~g~Sent",3500,5);
        GameTextForPlayer(id, "~w~Private Message ~g~Recived",3500,5);
        SendClientMessage(id,COLOR_YELLOW,string);
        format(string,sizeof(string),"Private Message Sent To: [%s]: %s",pName2,params);
        SendClientMessage(playerid,COLOR_YELLOW,string);
        format(string,sizeof(string),"%s wrote a private message to: %s! Text: %s ",pName,pName2,params);
    	SaveIn("PMLog.txt",string);
 	}
	return 1;
}
Here we go
Reply
#3

you mean a /pm command?

pawn Код:
CMD:pm(playerid, params[]) {
    new id;
    if(sscanf(params, "us[128]", id, params)) {
        if(id != INVALID_PLAYER_ID) {
            new name1[MAX_PLAYER_NAME], name2[MAX_PLAYER_NAME], str1[128], str2[128];
            GetPlayerName(playerid, name1, MAX_PLAYER_NAME);
            GetPlayerName(id, name2, MAX_PLAYER_NAME);
            format(str1, sizeof(str1), "PM send to %s: %s", name2, params);
            SendClientMessage(playerid, COLOR_LIGHTBLUE, str1);
            format(str2, sizeof(str2), "PM received from %s: %s", name1, params);
            SendClientMessage(id, COLOR_LIGHTBLUE, str2);
        }
        else return SendClientMessage(playerid, COLOR_GREY, "Error: Player not found");
    }
    else return SendClientMessage(playerid, COLOR_ORANGE, "Syntax Error: /pm [playerid] [text]");
    return 1;
}
I think this should work fine
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)