02.08.2016, 18:37
Quote:
"u" allows sscanf to search for both names and ids.
And if the id or name doesn't exist, it sets the variable as INVALID_PLAYER_ID. So it has nothing to with "d" and "u" https://sampforum.blast.hk/showthread.php?tid=602923 Read the specifiers section. |
But, where the hell mistake can be lol? my command have almost same syntax and working perfectly
PHP Code:
new id, mess[40];
if(sscanf(params, "us[40]", id, mess)) return SendClientMessage(playerid, -1, "{0008F7}USAGE: {FFFFFF}/PM ID MESSAGE");
if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xCD0000FF, "Player is not connected");
if(DND[id] == 1) return SendClientMessage(playerid, 0xCD0000FF, "Player is on DND mode");
new PName[24];
GetPlayerName(id, PName, sizeof(PName));
new string[100], name[24];
GetPlayerName(playerid, name, sizeof(name));
format(string,sizeof(string),"{FCDF00}[PRIVATE MESSAGE] {8A887B}From %s(%d): {8C8656}%s", name, playerid, mess);
SendClientMessage(id, -1, string);
format(string,sizeof(string),"{FCDF00}[PRIVATE MESSAGE] {8A887B}To %s(%d): {8C8656}%s", PName, id, mess);
SendClientMessage(playerid, -1, string);