Raised This Month: $ Target: $400
 0% 

[Help] Rand player


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
usaexelent
Senior Member
Join Date: Nov 2009
Location: Lithuania
Old 06-23-2011 , 13:49   [Help] Rand player
Reply With Quote #1

Hi all i want to know how to pick up a random player to get boost.

This is what i trayied:


new maxplayers = get_maxplayers()
new rand = random_num(1,maxplayers)
client_cmd(rand, "say boost")

It happens on new round.


Code:
public Boost(id)
{
new pinigai = cs_get_user_money(id)
	if (prasidejo == true)
	{
		if (aktiv == false)
		{
			if(pinigai >= get_pcvar_num(kaina))
			{
			client_print_color(id, GREY, "^4[Boost]^3 You just bought boost!")
			set_user_health(id, ( get_user_health(id)+15 ) );
			set_user_gravity(id,Float:0.9)
			set_user_maxspeed(id, -1)
			new pinigu_praradimas = pinigai - get_pcvar_num(kaina)
			cs_set_user_money(id, pinigu_praradimas)
			aktiv = true
			client_cmd(id, "spk ^"sound/boost.wav^"")
			}
			else
			{
			client_print_color(id, GREY, "^4[Boost]^3 You dont have that much money!")
			}
		}
		else
		{
		client_print_color(id, GREY, "^4[Boost]^3 You already have boost!")
		}
	}
	else
	{ 
	client_print_color(id, GREY, "^4[Boost]^3 Round hasn't started yet.") 
	}
}
And this is the main function, it happens when some one says boost

I don't really know why people uses this array, player[33]

I know that this some how affects the players to know their id :/


And BTW i want to make that player enter one team and the others transfer to other team.
usaexelent is offline
Send a message via Skype™ to usaexelent
 



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 23:32.


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