Raised This Month: $ Target: $400
 0% 

Request a plugin Vip Menu Jb


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Relaxing
AlliedModders Donor
Join Date: Jun 2016
Location: White Plains
Old 12-17-2017 , 18:27   Re: Request a plugin Vip Menu Jb
Reply With Quote #10

Quote:
Originally Posted by Famdl View Post
PHP Code:
#include <amxmodx>
#include <hamsandwich>
#include <cstrike>
#include <fun>

#pragma semicolon 1

#define PLUGIN "VIP Menu"
#define VERSION "1.0"
#define AUTHOR "FuckTheSchool"

#define Speed 400.0 // Must remain a float.
#define Gravity 400.0 // Must remain a float.
#define Access ADMIN_LEVEL_H // Edit the access to use /vipmenu.


new Benefited[33];

public 
plugin_init() {
    
register_plugin(PLUGINVERSIONAUTHOR);
    
    
RegisterHam(Ham_Spawn"player""HamBurger_Spawn");
    
    
register_clcmd("say /vipmenu""CmdVIPMenu");
}

public 
HamBurger_Spawn(id)
{
    
Benefited[id] = false;
}

public 
CmdVIPMenu(id)
{
    if(
get_user_flags(id) & Access)
    {
        if(!
Benefited[id])
        {
            new 
Format[64];
            
            new 
VIPMenu menu_create("Choose your benefits:""HandleCmdVIPMenu");

            
menu_additem(VIPMenu"Speed");
            
menu_additem(VIPMenu"400 Gravity");
                                        
            
menu_display(idVIPMenu);
            
        }
        else
            
ColorChat(id"^4You have already used your rewards!");
    }
    else
        
ColorChat(id"^4You have no access to this command!");

}

public 
HandleCmdVIPMenu(idVIPMenuitem)
{
    if(
item == MENU_EXIT) return;
    
    switch(
item+1)
    {
        case 
0set_user_maxspeed(idSpeed);
        case 
1
        {
            new 
Float:Grav Gravity/get_cvar_pointer("sv_gravity"); // Gravity will always act as 400 and will not be compared to current server gravity.
            
set_user_gravity(idGrav);
        }
    }
    
Benefited[id] = true;
}
stock ColorChat(const index, const string[], {FloatSqlResul,_}:...) 
{
    new 
msg[191], players[32], count 1;
    
    static 
len;
    
len formatex(msgcharsmax(msg), "^4[PREFIX]^1 "); // Edit the prefix here.
    
vformat(msg[len], charsmax(msg) - lenstring3);
    
    if(
index)    players[0] = index;
    else    
get_players(players,count,"ch");
    
    for (new 
0counti++)
    {
        if(
is_user_connected(players[i]))
        {
            
message_begin(MSG_ONE_UNRELIABLEget_user_msgid("SayText"),_players[i]);
            
write_byte(players[i]);
            
write_string(msg);
            
message_end();
        }
    }

Wrong, Incorrect.

Use this
Code:
#include <amxmodx> #include <amxmisc> #include <fun> #define ADMIN_FLAG ADMIN_LEVEL_H #define GRAVITY 0.5 #define SPEED 800.0 new bool: gravity[33]; new bool: speed[33]; public plugin_init()     register_clcmd("say /vip", "clcmd_vip", ADMIN_FLAG); public clcmd_vip(id, level, cid){     if(is_user_alive(id) && cmd_access(id, level, cid, 3))         return 0;     new menu = menu_create("VIP Menu", "handler");     new formatex_gravity[20], formatex_speed[20];     formatex(formatex_gravity, charsmax(formatex_gravity), "Gravity [%s]", gravity[id] ? "ON" : "\rOFF\w");     formatex(formatex_speed, charsmax(formatex_speed), "Speed [%s]", speed[id] ? "ON" : "\rOFF\w");     menu_additem(menu, formatex_gravity);     menu_additem(menu, formatex_speed);     menu_setprop(menu, MPROP_EXIT, MEXIT_ALL);     menu_display(id, menu);     return 0; } public handler(id, menu, item){     switch(item){         case MENU_EXIT: menu_destroy(menu);         case 0: {             if(gravity[id]){                 set_user_gravity(id, 1.0)                 gravity[id] = false;             }             else {                 set_user_gravity(id, GRAVITY);                 gravity[id] = true;             }         }                 case 1: {             if(speed[id]){                 set_user_maxspeed(id, 400.0)                 speed[id] = false;             }             else {                 set_user_maxspeed(id, SPEED);                 speed[id] = true;             }         }     }     return 1; }
__________________

Last edited by Relaxing; 12-17-2017 at 19:16. Reason: stuff and things
Relaxing is offline
 



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 04:33.


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