Raised This Month: $ Target: $400
 0% 

Random options......


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
VEN
Veteran Member
Join Date: Jan 2005
Old 03-20-2006 , 03:55  
Reply With Quote #10

Code:
public func(id) {     new i = random(MAX_WEAPONS)     give_item(id , g_szWeaps[i])     ammo_up(id)     client_print( id, print_chat, "[WPN] Gave : %s", g_szWeaps[i][7] ) }
I tesed that function, it's fine.
Quote:
Better put to the global array exact weapon names.
It didn't work for you because you probably didn't specified full weapon names:
Code:
new g_szWeaps[MAX_WEAPONS][] = {     "weapon_ak47", "weapon_aug",     "weapon_awp", "weapon_deagle",     "weapon_elite", "weapon_famas",     "weapon_fiveseven", "weapon_g3sg1",     "weapon_galil", "weapon_glock18",     "weapon_m249", "weapon_m3",     "weapon_m4a1", "weapon_mac10",     "weapon_mp5navy", "weapon_p228",     "weapon_p90", "weapon_scout",     "weapon_sg550", "weapon_sg552",     "weapon_tmp", "weapon_ump45",     "weapon_usp", "weapon_xm1014",     "weapon_shield" }
Also if you still use ResetHUD, delay should be used:
Code:
public func(id) {     set_task(0.1, "func2", id) } public func2(id) {     new i = random(MAX_WEAPONS)     give_item(id , g_szWeaps[i])     ammo_up(id)     client_print( id, print_chat, "[WPN] Gave : %s", g_szWeaps[i][7] ) }

You do not have to use format method, it only seems as efficient but in fact that's not so.
VEN 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 16:36.


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