02.08.2016, 18:34
In your code you save targetid as "u", it can be a name so no "targetid = INVALID_PLAYER_ID" nor IsPlayerConnected(targetid) can slove it maybe in your sscanf version, "u" works fine with me but try to change "u" to "d"
PHP Code:
CMD:pm(playerid, params[])
{
new targetid, string[258], tekst[128];
if(sscanf(params, "ds[128]", targetid, tekst)) return SendClientMessage(playerid, COLOR_WHITE, "{3BB9FF}use: {FFFFFF}/pm < ID > < tekst >");
if(targetid == INVALID_PLAYER_ID) return SendClientMessage(playerid, COLOR_RED, "Wrong ID");
format(string, sizeof(string), "[PM][IN] %s: %s", PlayerName(playerid), tekst);
SendClientMessage(targetid, COLOR_YELLOW, string);
format(string, sizeof(string), "[PM][out] %s: %s", PlayerName(targetid), tekst);
SendClientMessage(playerid, COLOR_RED, string);
return 1;
}