21.09.2017, 21:11
Quote:
Код:
dcmd_poke(playerid, params[]) { new id; if(sscanf(params, "u", id)) SendClientMessage(playerid, COLOR_YELLOW, "[USAGE]:[/]poke <id>"); else if(id == INVALID_PLAYER_ID) SendClientMessage(playerid, COLOR_RED, "[ERROR] player is not connected!"); else if(playerid != id) { new string[128]; new pName[24]; new iName[24]; format(string, sizeof(string), "you poked %s (%d)", iName, id); format(string, sizeof(string), "%s (%d) has poked you", pName, playerid); SendClientMessage(id, COLOR_PPINK, string); SendClientMessage(playerid, COLOR_PPINK, string); return 1; } else SendClientMessage(playerid, COLOR_RED, "You can't poke yourself"); return 1; } |
The order you should follow is the following:
Код:
Format the string > send the message to the respective ID > format the string again > send the message to the other ID