How do i make a string with two %s's? PLZ HELP
#1

i tried

new str[128];
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "%s Hammered %s", killerid, playerid, reason);
SendClientMessageToAll(kill, str);


and when i kill someone it says hammered it doesnt sya either of the players names, can someone help me plz? thnx
Reply
#2

Try something like this:
pawn Код:
new str[128], playername[MAX_PLAYER_NAME], killername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
GetPlayerName(killerid, killername, sizeof(killername));
format(str, sizeof(str), "%s Hammered %s, reason: %s", killername, playername, reason);
SendClientMessageToAll(COLOR_DEFINE, str);
Reply
#3

Thx alot it have work :P
Reply
#4

You're welcome. :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)