08.11.2016, 09:35
You don't need all that, just use a ternary operator (like if/else statements) in format:
Basically if what random returns is 0, it will pass "heads" as argument otherwise "tails".
pawn Код:
if (strcmp("/coin", cmdtext, true) == 0)
{
new p_name[MAX_PLAYER_NAME], string[57];
GetPlayerName(playerid, p_name, sizeof p_name);
format(string, sizeof string, "%s flipped a coin! landed on %s", p_name, !random(2) ? ("heads") : ("tails"));
SendClientMessageToAll(0xA586B8FF, string);
return 1;
}