23.10.2011, 12:26
(
Последний раз редактировалось Join7; 30.10.2011 в 11:12.
)
Edit command.
When someone writes a personal message instead of typing /pmmessage [playerid] [yourtext], take place directly as a response /pmdirectresponse [text]
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; }