Raised This Month: $399 Target: $400
 99%   Almost there!

Solved Need this vip plugin to be free for all at night


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Pizzadaking
Member
Join Date: Oct 2019
Old 04-04-2020 , 14:51   Need this vip plugin to be free for all at night
Reply With Quote #1

So this is a simple vip + menu i found and edited as i wanted it what i want is for this menu to be free for all at night 10PM - 10 AM !

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <amxconst>
#include <cstrike>
#include <fun>
#include <hamsandwich>
#include <fakemeta>
#include <engine>
#include <csx>

#define ADMIN_VIP ADMIN_LEVEL_H



enum {
    
SCOREATTRIB_ARG_PLAYERID 1,
    
SCOREATTRIB_ARG_FLAGS
};


enum ( <<= ) {
    
SCOREATTRIB_FLAG_NONE 0,
    
SCOREATTRIB_FLAG_DEAD 1,
    
SCOREATTRIB_FLAG_BOMB,
    
SCOREATTRIB_FLAG_VIP
};

new 
pCvar_AdminVIP;


public 
plugin_init()
{
    
register_plugin"Admin VIP ScoreBoard""0.0.1""Exolent" );
    
    
register_messageget_user_msgid"ScoreAttrib" ), "MessageScoreAttrib" );
    
    
pCvar_AdminVIP register_cvar"amx_adminvip""1" );
    
register_plugin("VIP Menu""1.0""Pizza");
    
register_clcmd("say /vm""ShowMenu");
        
register_concmd("say /vipextra","showmenuv");
        

     
}

public 
showmenuv(id)
{
    new 
menu menu_create("VIP Extra Items""Pressedrod");
    
menu_additemmenu"\yRiffle Sniper \r[ \wg3sg1 \r]""0"ADMIN_LEVEL_H);
     
     
menu_setpropmenuMPROP_EXITMEXIT_ALL );   
     
     
menu_displayidmenu);  
     
     return 
PLUGIN_HANDLED;
}

public 
ShowMenu(id)
{
     if (
get_user_flags(id) & ADMIN_LEVEL_H) {
                new 
CsTeams:userTeam cs_get_user_team(id)
                if (
userTeam == CS_TEAM_CT) {
                
    new 
menu menu_create("[\rBIBITA\y] VIP  Menu:""MohammadHlwani");

    
menu_additem(menu"\r[\yExtra items\r]"""0); // case 0
//    menu_additem(menu, "\r[\yModels Menu\r]", "", 0); // case 1
    
menu_additem(menu"\r[\yHealth Shop\r]"""0); // case 1
    
menu_additem(menu"\r[\yGlow Menu\r]"""0); // case 2

    
menu_setprop(menuMPROP_EXITMEXIT_ALL);

    
menu_display(idmenu0);

    return 
PLUGIN_HANDLED;
    

}
}
public 
MohammadHlwani(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_cancel(id);
        return 
PLUGIN_HANDLED;
    }

    new 
command[6], name[64], accesscallback;

    
menu_item_getinfo(menuitemaccesscommandsizeof command 1namesizeof name 1callback);

    switch(
item)
    {
        case 
0client_cmd(id"say /vipextra");
//        case 1: client_cmd(id, "say /VIPmodels");
        
case 1client_cmd(id"say /hpshop");
        case 
2client_cmd(id"say /vipglow");
    }

    
menu_destroy(menu);

    return 
PLUGIN_HANDLED;
}


public 
MessageScoreAttribiMsgIdiDestiReceiver ) {
    if( 
get_pcvar_numpCvar_AdminVIP ) ) {
        new 
iPlayer get_msg_arg_intSCOREATTRIB_ARG_PLAYERID );
        
        if( 
accessiPlayerADMIN_VIP ) ) {
            
set_msg_arg_intSCOREATTRIB_ARG_FLAGSARG_BYTESCOREATTRIB_FLAG_VIP );
        }
    }
}

public 
Pressedrod(idmenuitem)
{
     if (
item == MENU_EXIT) { 
        
menu_destroy(menu
        return 
PLUGIN_HANDLED
    } 
    
    new 
data[6], szName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,charsmax(data), szName,charsmax(szName), callback);
    new 
key str_to_num(data);
    
    if(!
is_user_alive(id))
        return 
PLUGIN_HANDLED
        
    
switch(key) {
        case 
0: { 
        
give_item(id,"weapon_g3sg1")
        
give_item(id,"ammo_762nato")
        
give_item(id,"ammo_762nato")
        
give_item(id,"ammo_762nato")
        }
    }
    return 
PLUGIN_CONTINUE


/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ fbidis\\ ansi\\ ansicpg1252\\ deff0{\\ fonttbl{\\ f0\\ fnil\\ fcharset0 Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ ltrpar\\ lang10241\\ f0\\ fs16 \n\\ par }
*/ 

Last edited by Pizzadaking; 04-05-2020 at 13:33. Reason: SOLVED
Pizzadaking is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 04-05-2020 , 06:28   Re: Need this vip plugin to be free for all at night
Reply With Quote #2

amx_cvar amx_default_access "t" in console, or amx_default_access "t" in amxx.cfg
__________________
Shadows Adi is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-05-2020 , 07:19   Re: Need this vip plugin to be free for all at night
Reply With Quote #3

What is the point of having that menu set on a flag when people can just type the commands it executes directly in the chat?

Use this function to check what time it is:

Code:
bool:is_current_time(const iStart, const iEnd) {     static iHour; time(iHour)     return bool:(iStart < iEnd ? (iStart <= iHour < iEnd) : (iStart <= iHour || iHour < iEnd)) }

Example:

Code:
if(is_current_time(22, 10)) {     // give access to the menu... }
__________________
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Pizzadaking
Member
Join Date: Oct 2019
Old 04-05-2020 , 10:01   Re: Need this vip plugin to be free for all at night
Reply With Quote #4

Well i did my best to "make" that menu , but every plugin is only for ADMIN_LEVEL_H yk...
Pizzadaking is offline
Pizzadaking
Member
Join Date: Oct 2019
Old 04-05-2020 , 10:01   Re: Need this vip plugin to be free for all at night
Reply With Quote #5

Quote:
Originally Posted by OciXCrom View Post
What is the point of having that menu set on a flag when people can just type the commands it executes directly in the chat?

Use this function to check what time it is:

Code:
bool:is_current_time(const iStart, const iEnd) {     static iHour; time(iHour)     return bool:(iStart < iEnd ? (iStart <= iHour < iEnd) : (iStart <= iHour || iHour < iEnd)) }

Example:

Code:
if(is_current_time(22, 10)) {     // give access to the menu... }

can u just put it and send me the code?, im not really good at scripting
Pizzadaking is offline
OciXCrom
Veteran Member
Join Date: Oct 2013
Location: Macedonia
Old 04-05-2020 , 15:18   Re: Need this vip plugin to be free for all at night
Reply With Quote #6

Like I already said, if you're not willing to learn, don't use this section. I even gave you a premade plugin that does this job, and you refused to listen yet again.

You won't get good unless you try. I don't think it's difficult to write "if (something) do (something)" in the code. It's pretty much basic stuff.

Try it and post what you have done.
__________________

Last edited by OciXCrom; 04-05-2020 at 15:19.
OciXCrom is offline
Send a message via Skype™ to OciXCrom
Reply


Thread Tools
Display Modes

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 18:30.


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