Edit command
#1

Edit command.

When someone writes a personal message instead of typing /pmmessage [playerid] [yourtext], take place directly as a response /pmdirectresponse [text]

Код:
	if(strcmp(cmd, "/pmdirectresponse", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, 0xFFFFFFFF, "TYPE: /pmdirectresponse [yourtext]");
				return 1;
			}
			giveplayerid = strval(tmp);
			if (IsPlayerConnected(giveplayerid))
			{
				GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
				new length = strlen(cmdtext);
				while ((idx < length) && (cmdtext[idx] <= ' '))
				{
					idx++;
				}
				new offset = idx;
				new result[256];
				while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
				{
					result[idx - offset] = cmdtext[idx];
					idx++;
				}
				result[idx - offset] = EOS;
				if(!strlen(result))
				{
					SendClientMessage(playerid, 0xFFFFFFFF, "TYPE: /pmdirectresponse [yourtext]");
					return 1;
				}
				format(string, sizeof(string), "* PM for %s -id: %d: %s", giveplayer, giveplayerid, (result));
				SendClientMessage(playerid,  0xFFFF00FF, string);
				return 1;
			}
		}
		return 1;
	}
Reply
#2

pawn Код:
#include a_samp
#include sscanf2
#include zcmd


CMD:pm(playerid,x[])
{
    new
        idx,str[2][60],text[128],name[24];
    GetPlayerName(playerid,name,24);
    if(sscanf(x,"is[128]",idx,text)) return SendClientMessage(playerid,-1,"use: /pm [playerid] [text]");
    format(str[0],60,"PM %s: %s",name,text);
    format(str[1],60,"Your pm: %s",str);
    SendClientMessage(idx,-1,str[0]);
    SendClientMessage(playerid,-1,str[1]);
    return 0x1;
}
Reply
#3

The aim is to miss playerid /pmdirectresponse [text]
when someone has sent you a message, /pmdirectresponse serve to answer (/pmdirectresponse [text] - and sends the message to the one you wrote a personal message)
Reply
#4

up...
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)