05.07.2016, 18:37
you formatted the "string" variable, not the string2, "string" variable is supposed to represent be the string parameter in the command, and string2 is supposed to be the final string to send to the player desired.
Код:
CMD:pm(playerid, params[]) { new cibleid, string[128], pName[MAX_PLAYER_NAME], string2[128]; if(sscanf(params, "us", cibleid, string)) return SendClientMessage(playerid, COULEUR_ROUGE,"Usage: /pm [id] [message]"); if(!IsPlayerConnected(cibleid)) return SendClientMessage(playerid, COULEUR_ROUGE,"[ERROR] This Player is not connected"); GetPlayerName(playerid, pName, sizeof(pName)); format(string2, sizeof(string2), "PM of %s: %s", pName, string); SendClientMessage(cibleid, COULEUR_JAUNE, string2); SendClientMessage(playerid, COULEUR_BLEUCLAIR ,"Message envoyйe."); return 1; }