Need Help fast,
#6

You don't need all that, just use a ternary operator (like if/else statements) in format:
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;
}
Basically if what random returns is 0, it will pass "heads" as argument otherwise "tails".
Reply


Messages In This Thread
Need Help fast, - by SeanDenZYR - 08.11.2016, 09:07
Re: Need Help fast, - by Micko123 - 08.11.2016, 09:17
Re: Need Help fast, - by SeanDenZYR - 08.11.2016, 09:29
Re: Need Help fast, - by Micko123 - 08.11.2016, 09:32
Re: Need Help fast, - by Killa[DGZ] - 08.11.2016, 09:32
Re: Need Help fast, - by Konstantinos - 08.11.2016, 09:35
Re: Need Help fast, - by SeanDenZYR - 08.11.2016, 09:39
Re: Need Help fast, - by Micko123 - 08.11.2016, 09:42
Re: Need Help fast, - by SeanDenZYR - 08.11.2016, 09:45
Re: Need Help fast, - by SeanDenZYR - 08.11.2016, 09:52

Forum Jump:


Users browsing this thread: 2 Guest(s)