SA-MP Forums Archive
How do i make a string with two %s's? PLZ HELP - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: How do i make a string with two %s's? PLZ HELP (/showthread.php?tid=88220)



How do i make a string with two %s's? PLZ HELP - matdav - 25.07.2009

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


Re: How do i make a string with two %s's? PLZ HELP - Correlli - 25.07.2009

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);



Re: How do i make a string with two %s's? PLZ HELP - matdav - 25.07.2009

Thx alot it have work :P


Re: How do i make a string with two %s's? PLZ HELP - Correlli - 25.07.2009

You're welcome. :P