Raised This Month: $ Target: $400
 0% 

Respawn 50% Lucky


Post New Thread Reply   
 
Thread Tools Display Modes
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 02-21-2013 , 10:14   Re: Respawn 50% Lucky
Reply With Quote #11

Quote:
Originally Posted by jimaway View Post
random(2) will give you 66.6% chance, use random(1)
random(1) will always return 0.
__________________
hleV is offline
fl0werD
Senior Member
Join Date: May 2011
Old 02-21-2013 , 11:49   Re: Respawn 50% Lucky
Reply With Quote #12

Quote:
Originally Posted by hleV View Post
random(1) will always return 0.
0 or 1.
fl0werD is offline
Send a message via ICQ to fl0werD
hleV
Veteran Member
Join Date: Mar 2007
Location: Lithuania
Old 02-21-2013 , 15:14   Re: Respawn 50% Lucky
Reply With Quote #13

... So many idiots here.
__________________
hleV is offline
Xalus
Veteran Member
Join Date: Dec 2009
Location: Belgium
Old 02-21-2013 , 15:42   Re: Respawn 50% Lucky
Reply With Quote #14

Quote:
Originally Posted by hleV View Post
... So many idiots here.
Thats a fact, I cant denied.


random(1) returns only 0
random(2) returns 0 or 1

__________________
Retired.
Xalus is offline
Erdener
Senior Member
Join Date: Apr 2010
Location: Turkey
Old 02-21-2013 , 18:07   Re: Respawn 50% Lucky
Reply With Quote #15

One can give me the f*ck code?
__________________
Erdener is offline
YamiKaitou
Has a lovely bunch of coconuts
Join Date: Apr 2006
Location: Texas
Old 02-21-2013 , 20:04   Re: Respawn 50% Lucky
Reply With Quote #16

PHP Code:
public respawnid ) {
    if( 
random ) )
    {
        
ExecuteHamB(Ham_CS_RoundRespawnid);
        
client_printc(idprint_chat"%s: You are Respawn!!"PREFIX);
    }

__________________
ProjectYami Laboratories

I do not browse the forums regularly anymore. If you need me for anything (asking questions or anything else), then PM me (be descriptive in your PM, message containing only a link to a thread will be ignored).
YamiKaitou is offline
Backstabnoob
BANNED
Join Date: Feb 2009
Location: Iwotadai Dorm
Old 02-22-2013 , 09:36   Re: Respawn 50% Lucky
Reply With Quote #17

Quote:
Originally Posted by Erdener View Post
One can give me the f*ck code?
Learn how to behave in a request forum.

Quote:
Originally Posted by hleV View Post
*random(2)
You're right, thanks for correction. Fixed in my post.

Last edited by Backstabnoob; 02-22-2013 at 09:37.
Backstabnoob is offline
Erdener
Senior Member
Join Date: Apr 2010
Location: Turkey
Old 02-22-2013 , 10:00   Re: Respawn 50% Lucky
Reply With Quote #18

Quote:
Originally Posted by Backstabnoob View Post
Learn how to behave in a request forum.
Hey i'm sorry, ok?

But, they are deflecting topic.This it made ​​me angry.I'm sorry again...
__________________

Last edited by Erdener; 02-22-2013 at 10:00.
Erdener is offline
Old 02-22-2013, 10:22
guipatinador
This message has been deleted by guipatinador. Reason: already answered
bboygrun
CHOMP
Join Date: May 2010
Location: France
Old 02-23-2013 , 05:18   Re: Respawn 50% Lucky
Reply With Quote #19

Quote:
Originally Posted by Erdener View Post
But, they are deflecting topic.This it made ​​me angry.I'm sorry again...
They are explaining something which will be useful for some scripters, as you can see they didn't know that random( 1 ) only return 0.

/EDIT/
@Erdener : If you want to choose a player with get_players, don't forget to subtract iNum variable in the random.

Example : If there is only one player, iNum = 1, but the index of the player will be in iPlayers[ 0 ] then if you do the random_num( 0, iNum ) and if it returns 1, you will have the value zero.

So :

PHP Code:
new id iPlayers[random_num(0iNum)]; 


PHP Code:
new id iPlayers[random_num(0iNum 1)]; 
__________________

Last edited by bboygrun; 02-23-2013 at 05:21.
bboygrun is offline
lgund
Senior Member
Join Date: Jul 2009
Location: Berlin
Old 02-23-2013 , 05:25   Re: Respawn 50% Lucky
Reply With Quote #20

you are kidding me right ??

its not rly hard... if you dont know look in other plugins how did them

PHP Code:
new Float:randomnumber random_float(0.0,1.0)
if(
randomnumber 0.5)
{
    
// Player will be respawned

That should work fine ;)
__________________
You need help on Coding ?? Look on my Homepage: http://First-Coder.de/
You want FUN in Counter-Strike ;) ?? Look on my Community:
http://deathmanns.first-coder.de/
lgund is offline
Send a message via MSN to lgund Send a message via Skype™ to lgund
Reply



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 21:45.


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