Just a test.
#2

Use 'random' function and a 'switch' :
Код:
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; 
}
( I also improoved your code )
Reply


Messages In This Thread
Just a test. - by TaLhA XIV - 14.08.2012, 21:05
Re: Just a test. - by IstuntmanI - 14.08.2012, 21:10
Re: Just a test. - by Jefff - 14.08.2012, 21:15
Re: Just a test. - by TaLhA XIV - 14.08.2012, 21:18
Re: Just a test. - by Akcent_Voltaj - 14.08.2012, 21:19
Re: Just a test. - by TaLhA XIV - 15.08.2012, 15:18
Re: Just a test. - by [MM]RoXoR[FS] - 15.08.2012, 15:27
Re: Just a test. - by TaLhA XIV - 15.08.2012, 15:45
Re: Just a test. - by TaLhA XIV - 15.08.2012, 16:06
Re: Just a test. - by TaLhA XIV - 15.08.2012, 16:25

Forum Jump:


Users browsing this thread: 1 Guest(s)