Raised This Month: $ Target: $400
 0% 

Online Players >=


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-24-2017 , 14:02   Re: Online Players >=
Reply With Quote #1

Quote:
Originally Posted by EFFx View Post
Do not need the -1 Natsheh.

@LifeStone,

Use the native that KliPPy said.

PHP Code:
if(get_playersnum() >= 5)
{
     
// bla bla

Again that post was an answer for @CrazY. Question!
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 03-24-2017 , 14:05   Re: Online Players >=
Reply With Quote #2

Doesn't matter for who it was. Still wrong.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-24-2017 , 14:07   Re: Online Players >=
Reply With Quote #3

Quote:
Originally Posted by EFFx View Post
Doesn't matter for who it was. Still wrong.
are you high man ?!
whats wrong about it ?
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 03-24-2017 , 14:16   Re: Online Players >=
Reply With Quote #4

Sorry if that sounded rude, but as far I know, does not need the -1
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-24-2017 , 14:20   Re: Online Players >=
Reply With Quote #5

Quote:
Originally Posted by EFFx View Post
Sorry if that sounded rude, but as far I know, does not need the -1
it dose need it otherwise its out of index
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !

Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 03-24-2017 , 14:23   Re: Online Players >=
Reply With Quote #6

Really? Exolent is wrong then.

https://forums.alliedmods.net/showpo...67&postcount=2
https://forums.alliedmods.net/showthread.php?t=74666
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo

Last edited by EFFx; 03-24-2017 at 14:25.
EFFx is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 03-24-2017 , 14:52   Re: Online Players >=
Reply With Quote #7

It doesn't need the -1. I have a few plugins that use a random player, so I know. It does however require an iPnum or id check if you want to prevent out of bounds error.

PHP Code:
new iPlayers[32], iPnum
get_players
(iPlayersiPnum"a")

new 
id iPlayers[random(iPnum)]

if(
id)
{
    
// do stuff here...

or

PHP Code:
new iPlayers[32], iPnum
get_players
(iPlayersiPnum"a")

if(!
iPnum)
    return

new 
id iPlayers[random(iPnum)] 
__________________

Last edited by OciXCrom; 03-24-2017 at 14:52.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-24-2017 , 16:24   Re: Online Players >=
Reply With Quote #8

Quote:
Originally Posted by OciXCrom View Post
It doesn't need the -1. I have a few plugins that use a random player, so I know. It does however require an iPnum or id check if you want to prevent out of bounds error.

PHP Code:
new iPlayers[32], iPnum
get_players
(iPlayersiPnum"a")

new 
id iPlayers[random(iPnum)]

if(
id)
{
    
// do stuff here...

or

PHP Code:
new iPlayers[32], iPnum
get_players
(iPlayersiPnum"a")

if(!
iPnum)
    return

new 
id iPlayers[random(iPnum)] 
PHP Code:
what if iPnum is '1'    // we have only 1 player alive...

new random random(iPnum// imagine thats random variable is equal to 1. // this will return false results since there is no player id stored in the array of cell 1

// the random variable is equal to 1 since max is 1 and the mini is 0

iPlayers[random] = || iPlayers[1] = 0// this will give false id if iPnum is 1 thats why we need to minis by 1. 

i hope u understand's!
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 03-24-2017 at 16:26.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 03-24-2017 , 16:44   Re: Online Players >=
Reply With Quote #9

Check my post with Exolent's codes. -1 is not needed, just add the check that OciXCrom and Exolent said.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 03-24-2017 , 18:07   Re: Online Players >=
Reply With Quote #10

Quote:
Originally Posted by EFFx View Post
Check my post with Exolent's codes. -1 is not needed, just add the check that OciXCrom and Exolent said.
i think exolent agree's with me...

https://forums.alliedmods.net/showpo...14&postcount=4

btw this argument is about to prove that my point is right... @Klippy
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 03-24-2017 at 18:12.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 17:47.


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