sscanf text invisible
#1

FIXED
Reply
#2

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; 
}
Reply
#3

Oh sorry i haven't seen that thanks.
Reply
#4

"s" specifier needs the size specified as "s[size_here]" otherwise you'll get sscanf warning: Arrays without a length are deprecated, please add a destination size.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)