Raised This Month: $32 Target: $400
 8% 

Help


Post New Thread Reply   
 
Thread Tools Display Modes
Natsheh
Veteran Member
Join Date: Sep 2012
Old 04-25-2017 , 07:27   Re: Help
Reply With Quote #11

What about setting an admin in game ?
That wont raise up the admins value because its been hooked at client putinserver, the best way is to hook a forward for admin login with logevent
__________________
@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 04-25-2017 , 11:58   Re: Help
Reply With Quote #12

A stock is the best way:

PHP Code:
getAdminsNum()
{
    new 
iPlayers[32], iNumiAdminsNum
    get_players
(iPlayersiNum)
    for(new 
i;iNum;i++)
    {
         if(
is_user_admin(iPlayers[i]))
         {
             
iAdminsNum++
         }
    }
    return 
iAdminsNum

PHP Code:
if(getAdminsNum() >= 1)
{
    
// bla bla bla

__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

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

Last edited by EFFx; 04-25-2017 at 11:58.
EFFx is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-25-2017 , 18:10   Re: Help
Reply With Quote #13

Quote:
Originally Posted by EFFx View Post
A stock is the best way:

PHP Code:
getAdminsNum()
{
    new 
iPlayers[32], iNumiAdminsNum
    get_players
(iPlayersiNum)
    for(new 
i;iNum;i++)
    {
         if(
is_user_admin(iPlayers[i]))
         {
             
iAdminsNum++
         }
    }
    return 
iAdminsNum

PHP Code:
if(getAdminsNum() >= 1)
{
    
// bla bla bla

Why is a 'stock' the best way? Do you know what 'stock' means/does? I think you mean to say 'function'.

Natsheh is right, event driven is the way to go and is probably always most efficient. This is how my code (and your first code, EFFx) works. IMO, it is relatively rare for admins to be granted power mid-map so I would use my above code and call it a day...as long as the OP takes this into consideration and agrees.
__________________

Last edited by Bugsy; 04-25-2017 at 18:11.
Bugsy is offline
EFFx
Veteran Member
Join Date: Feb 2016
Location: São Paulo, Brasil
Old 04-25-2017 , 21:57   Re: Help
Reply With Quote #14

I said considering the Natsheh's point. I call it stock, sorry if that's wrong, but I call it private stock, or as you said, 'function' without 'public'.
__________________
• Ranking System • AutoMix 5vs5 System
• Web Ban System • Plugins for free

____________________________________________
For private works:
• Discord: EFFEXo#8850 • Steam: EFFEXo
EFFx is offline
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:53.


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