14.08.2012, 21:15
or
pawn Код:
#define conv(%0,%1,%2) ((!%0) ? (%1) : (%2))
public OnPlayerCommandText(playerid, cmdtext[])
{
if(strcmp("/coin", cmdtext, true) == 0)
{
new str[150];
static result;
result %= 2;
GetPlayerName(playerid, str, sizeof(str));
format(str, sizeof(str), "{0780E3}%s flips the coin and lands it on %s", str,conv(result,"heads","tails"));
SendClientMessageToAll(-1,str);
result++;
return 1;
}
return 0;
}