14.08.2012, 21:10
Use 'random' function and a 'switch' :
( I also improoved your code )
Код:
if( strcmp( cmdtext, "/coin", cmdtext, true ) == 0 ) { new str[ 128 ]; GetPlayerName( playerid, str, MAX_PLAYER_NAME ); switch( random( 2 ) ) { case 0: format( str, 128, "%s flips the coin and lands it on heads", str ); case 1: format( str, 128, "%s flips the coin and lands it on tails", str ); } SendClientMessageToAll( 0x0780E3FF, str ); return 1; }