Raised This Month: $51 Target: $400
 12% 

[Req]Priority


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ApoziX
Member
Join Date: Sep 2018
Old 11-02-2018 , 17:44   [Req]Priority
Reply With Quote #1

Hello

I got this code and I want the priority will be like that

If An Admin has entered the game then admin menu comes up

If VIP has entered the game then vip menu comes up

If Player has enter the game then menu comes up
+rep for helpers thanks

PHP Code:
#include <sourcemod>

public OnClientPutInServer(client)  

    
CreateTimer(2.0Timer_AutoShowGetClientUserId(client), TIMER_FLAG_NO_MAPCHANGE);


public 
IsValidClientclient 

    if ( !( 
<= client <= MaxClients ) || !IsClientInGame(client) ) 
        return 
false
     
    return 
true
}
public 
Action:Timer_AutoShow(Handle:timerany:userid

    new 
client GetClientOfUserId(userid); 
    if(!
IsPlayerAlive(client) || !CheckCommandAccess(client"sm_kick"ADMFLAG_BAN))
    { 
        
FakeClientCommandEx(client"sm_admin");
    }
    
    if(!
IsPlayerAlive(client) || !CheckCommandAccess(client"sm_tag"ADMFLAG_CUSTOM6))
    { 
        
FakeClientCommandEx(client"sm_vip");
    }

    if(!
IsPlayerAlive(client) || !IsValidClient(client))
    { 
        
FakeClientCommandEx(client"sm_menu");
    }
    return 
Plugin_Handled

__________________
Looking To Start A TF2 Community
My Discord | My Steam

Last edited by ApoziX; 11-02-2018 at 18:08.
ApoziX is offline
HvG Community
AlliedModders Donor
Join Date: Sep 2012
Old 11-02-2018 , 19:14   Re: [Req]Priority
Reply With Quote #2

So whats wrong with this?

Just put else if on the last 2, instead of if statements and its all good.

Last edited by HvG Community; 11-02-2018 at 19:14.
HvG Community is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 11-02-2018 , 20:00   Re: [Req]Priority
Reply With Quote #3

...or an return Plugin_Handled; behind the FakeClientCommandEx

edit: btw try to use new syntax
__________________
coding & free software

Last edited by shanapu; 11-02-2018 at 20:02.
shanapu is offline
ApoziX
Member
Join Date: Sep 2018
Old 11-03-2018 , 06:44   Re: [Req]Priority
Reply With Quote #4

Quote:
Originally Posted by shanapu View Post
...or an return Plugin_Handled; behind the FakeClientCommandEx

edit: btw try to use new syntax
I am not a pro coder bro I am tiny one
__________________
Looking To Start A TF2 Community
My Discord | My Steam
ApoziX is offline
ApoziX
Member
Join Date: Sep 2018
Old 11-03-2018 , 06:54   Re: [Req]Priority
Reply With Quote #5

Quote:
Originally Posted by HvG Community View Post
So whats wrong with this?

Just put else if on the last 2, instead of if statements and its all good.
Not working
__________________
Looking To Start A TF2 Community
My Discord | My Steam
ApoziX is offline
shanapu
Veteran Member
Join Date: Apr 2015
Location: .de
Old 11-03-2018 , 11:48   Re: [Req]Priority
Reply With Quote #6

No need to "be a pro" just put some afford in searching, reading & learning.

return Plugin_Handled;
Spoiler

or
else if
Spoiler


btw "Not working" (without any other info) is a very useless reply...
__________________
coding & free software

Last edited by shanapu; 11-03-2018 at 11:49.
shanapu is offline
ApoziX
Member
Join Date: Sep 2018
Old 11-03-2018 , 12:56   Re: [Req]Priority
Reply With Quote #7

Quote:
Originally Posted by shanapu View Post
No need to "be a pro" just put some afford in searching, reading & learning.

return Plugin_Handled;
Spoiler

That Thing did not work
__________________
Looking To Start A TF2 Community
My Discord | My Steam
ApoziX is offline
HvG Community
AlliedModders Donor
Join Date: Sep 2012
Old 11-03-2018 , 14:12   Re: [Req]Priority
Reply With Quote #8

Make the timer bit longer.
Also I noticed there are ! in the if statements. Why would you negate it?
Just check if he is alive OR has access to a command.
Also make sure you have VIP command installed that works so VIP can be opened to begin with (this is bit obvious one).

Same with the menu I gave you. It works with !help and !helpmenu not !menu, so change it to that.

And I would put && instead of || so both of them need to be correct.

Change sm_kick to sm_ban and sm_tag whatever that is to sm_vip.


IsValidClient, you dont even need that shit.

Last edited by HvG Community; 11-03-2018 at 14:17.
HvG Community is offline
ApoziX
Member
Join Date: Sep 2018
Old 11-03-2018 , 14:22   Re: [Req]Priority
Reply With Quote #9

Quote:
Originally Posted by HvG Community View Post
Make the timer bit longer.
Also I noticed there are ! in the if statements. Why would you negate it?
Just check if he is alive OR has access to a command.
Also make sure you have VIP command installed that works so VIP can be opened to begin with (this is bit obvious one).

Same with the menu I gave you. It works with !help and !helpmenu not !menu, so change it to that.

And I would put && instead of || so both of them need to be correct.

Change sm_kick to sm_ban and sm_tag whatever that is to sm_vip.


IsValidClient, you dont even need that shit.
Bro I appreciate your work but On the other thread I wanted MY menu to be opened
I have configured the menu to be opened when typing !menu
__________________
Looking To Start A TF2 Community
My Discord | My Steam
ApoziX 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 12:27.


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