Raised This Month: $ Target: $400
 0% 

Make 2 tasks chosen randomly. (Solved)


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
SkumTomteN
Veteran Member
Join Date: Oct 2013
Location: Asgard
Old 12-28-2013 , 18:58   Re: Make 2 tasks chosen randomly. (how?)
Reply With Quote #9

Quote:
Originally Posted by fysiks View Post
If you don't absolutely need a significant delay you shouldn't use it. The code is less readable and it's less efficient.
So then it would be like this?

Code:
public zp_round_started(round)
{
if (zp_get_human_count( ) < MINPEOPLE )
		return;
			
if(round == MODE_MULTI || round == MODE_INFECTION)
	{
switch (random_num(0, 1))	
	{
		case 0:
		{
g_hero[id] = true 
zp_force_buy_extra_item(id, zp_get_extra_item_id("ddeagle"), 1)
zp_force_buy_extra_item(id, zp_get_extra_item_id("SVDEX"), 1) 
set_user_health( id , get_user_health( id ) + HEALTH ); 
set_user_armor(id , get_user_armor( id ) + ARMOR ); 
zp_override_user_model(id, "hero")				
new id
static iPlayersNum
iPlayersNum = gAlive()
id = gRandomAlive(random_num(1, iPlayersNum))
new szName[ 32 ]
get_user_name( id, szName, 31 )
set_dhudmessage( 0, 190, 0, 0.05, 0.45, 1, 0.0, 5.0, 1.0, 1.0)                                
show_dhudmessage( 0, TEXT, szName )                            
                             }
		case 1:
		{
g_hero[id] = true 
zp_force_buy_extra_item(id, zp_get_extra_item_id("ddeagle"), 1)
zp_force_buy_extra_item(id, zp_get_extra_item_id("Quad Barrel"), 1) 
set_user_health( id , get_user_health( id ) + HEALTH ); 
set_user_armor(id , get_user_armor( id ) + ARMOR ); 
zp_override_user_model(id, "heroine")		
new id
static iPlayersNum
iPlayersNum = gAlive()
id = gRandomAlive(random_num(1, iPlayersNum))
new szName[ 32 ]
get_user_name( id, szName, 31 )
set_dhudmessage( 0, 190, 0, 0.05, 0.45, 1, 0.0, 5.0, 1.0, 1.0)                       
show_dhudmessage( 0, TEXT2, szName )                     
                       }
           }
}
Correct the code please, that didnt work.

Code:
//// zp_addon_heros.sma
// C:\Users\Billy\Desktop\Compiler\zp_addon_heros.sma(49) : warning 209: functio
n "zp_round_started" should return a value
// C:\Users\Billy\Desktop\Compiler\zp_addon_heros.sma(51) : error 029: invalid e
xpression, assumed zero
// C:\Users\Billy\Desktop\Compiler\zp_addon_heros.sma(51) : error 088: number of
 arguments does not match definition
// C:\Users\Billy\Desktop\Compiler\zp_addon_heros.sma(54) : warning 209: functio
n "zp_round_started" should return a value
// C:\Users\Billy\Desktop\Compiler\zp_addon_heros.sma(62) : error 017: undefined
 symbol "id"
// C:\Users\Billy\Desktop\Compiler\zp_addon_heros.sma(62 -- 63) : warning 215: e
xpression has no effect
// C:\Users\Billy\Desktop\Compiler\zp_addon_heros.sma(63) : error 017: undefined
 symbol "id"
// C:\Users\Billy\Desktop\Compiler\zp_addon_heros.sma(63) : warning 215: express
ion has no effect
// C:\Users\Billy\Desktop\Compiler\zp_addon_heros.sma(63) : error 001: expected
token: ";", but found ")"
// C:\Users\Billy\Desktop\Compiler\zp_addon_heros.sma(63) : fatal error 107: too
 many error messages on one line
__________________
Contact: Steam
Videos: Youtube
SkumTomteN is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 20:38.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode