use:
%s - Strings. Like names, words, sentences and stuff ...
%i - for numbers (23, 43, 20, 2, etc etc) and player id (not name! Their ID)
%f - for floats, numbers with comma (34,23; 45,2450, etc etc)
So, on short, you first need to get the player name, using
GetPlayerName function and then insert it in a string:
pawn Код:
new PlayerName[MAX_PLAYER_NAME];
new VictimName[MAX_PLAYER_NAME];
GetPlayerName(playerid, PlayerName, sizeof PlayerName);
GetPlayerName(id, VictimName, sizeof VictimName);
format(tohitman, sizeof(tohitman), "%s (ID %i) has requested a contract on %s (ID %i) for $%i. | /recievehit [id]", PlayerName, playerid, VictimName, id, price);
format(toplayer, sizeof(toplayer), "You have requested a contract on %s for $%i. (Reason: %s)", VictimName, price);
You don't need no reason there.
And by the way, you don't need two strings to send multiple messages. You can reformat a string, after you send a message. For example:
pawn Код:
new str[128];
format(str, sizeof str, "This message goes to playerid who gets the contract.");
SendClientMessage(playerid, -1, str);
format(str, sizeof str, "This message goes to the leader, who can confirm his contract.");
SendClientMessage(id, -1, str);
// See ? After you send a message, you can reformat the same string and resend it to another player or to the same player aswell.