This site is a testing version, but all data is shared with the live forum.


Raised This Month: $ Target: $400
 0% 

Choosing a random player


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
tedaimlocks
Senior Member
Join Date: Jan 2024
Old 04-16-2024 , 02:34   Re: Choosing a random player
Reply With Quote #4

Quote:
Originally Posted by mlibre View Post
Code:
public ChooseHero() {     // Choose a random player every round and give them the stuff under         new players[32], num; get_players(players, num, "a")         new id = players[random(num)]         set_user_armor(id, get_user_armor(id) + 150)     set_user_health(id, get_user_health(id) + 150)         give_item(id, "weapon_hegrenade")     give_item(id, "weapon_flashbang")         new szName[32]; get_user_name(id, szName, charsmax(szName))         ColorChat(0, GREEN, "^x01[^x04SPK ZM^x01]^x04 %s ^x03was chosen to be the ^x04Hero ^x03of the round! They have got ^x04+150HP+150AP+MULTIJUMPS", szName) }
It gives errors if no player is connected ( i think )

run time error 4 : index out of bounds

Last edited by tedaimlocks; 04-16-2024 at 03:42.
tedaimlocks 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 13:49.


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