Quantcast
Channel: Forum VeryGames
Viewing all articles
Browse latest Browse all 5196

Aide pour ouvrir un menu dans un menu .

$
0
0
Bonjour
Voilà je creer un plugin avec plusieur types de races mais enfaite je voudrais creer des races VIP et donc sur le menu de choix de classe ecris : VIP
et quand on clique dessus sa ouvre un menu que au vip, voilà mon code :
Code:

#include <sourcemod>
#include <sdktools>
#include <morecolors>


#define LOGO "{cyan}[BONUS-MENU]"
#define VIP "{blue}[VIP]"
#define TEAM "{red}[FgF]"


#define MODEL_VIE "models/player/slow/berserkerin/slow_big.mdl"
#define MODEL_VITESSE "models/player/slow/mitch/ichigo/slow_v2.mdl"
#define MODEL_GRAVITE "models/player/slow/sam_and_max/max/slow_v2.mdl"


new bool:g_bUseBonus[MAXPLAYERS+1];


public Plugin:myinfo =
{
    name = "Bonus",
    description = "Menu Bonus",
    author = "RedGames",
    version = "1.0",
    url = "",
}


public OnMapStart()
{
    PrecacheModel(MODEL_VIE);
    PrecacheModel(MODEL_VITESSE);
    PrecacheModel(MODEL_GRAVITE);
}


public OnPluginStart()
{
    HookEvent("player_spawn", Event_PlayerSpawn);
   
    RegConsoleCmd("sm_bonus", menu_bonus, "Affiche le menu Bonus");
   
    CreateTimer(60.0, advert, _, TIMER_REPEAT);
}


public Event_PlayerSpawn(Handle:event, const String:name[], bool:dontBroadcast)
{
    new client = GetClientOfUserId(GetEventInt(event, "userid"));
   
    if(IsClientInGame(client) && GetClientTeam(client) > 1)
    {
        g_bUseBonus[client] = true;
    }
}


public Action:menu_bonus_VIP(client, args)
{
    new Handle:menu = CreateMenu(Menu_Bonus);
    SetMenuTitle(menu, ".:Bonus Menu:.");
    AddMenuItem(menu, "option5", "Tank 300 HP VIP");
    AddMenuItem(menu, "option6", "Gravité Bhop VIP");
    AddMenuItem(menu, "option7", "Ninja Vitesse VIP");
    SetMenuExitButton(menu, false);
    DisplayMenu(menu, client, MENU_TIME_FOREVER);
}


public Action:menu_bonus(client, args)
{
    if(IsClientInGame(client))
    {
        if(GetClientTeam(client) > 1)
        {
            if(IsPlayerAlive(client))
            {
                if(g_bUseBonus[client])
                {
                    new Handle:menu = CreateMenu(Menu_Bonus);
                    SetMenuTitle(menu, ".:Bonus Menu:.");
                    AddMenuItem(menu, "option1", "Tank 300 HP");
                    AddMenuItem(menu, "option2", "Gravité Bhop");
                    AddMenuItem(menu, "option3", "Ninja Vitesse");
                    AddMenuItem(menu, "option4", "VIP");
                    SetMenuExitButton(menu, false);
                    DisplayMenu(menu, client, MENU_TIME_FOREVER);
                }
                else
                {
                        CPrintToChat(client, "Vous avez deja utiliser votre bonus", LOGO);
                }
            }
            else
            {
                CPrintToChat(client, "Vous devez être vivant", LOGO);
            }
        }
        else
        {
            CPrintToChat(client, "Vous devez être dans une team", LOGO);
        }
    }
}


public Menu_Bonus(Handle:menu, MenuAction:action, client, param2)
{
    if(MenuAction_Select == action)
    {       
        new String:sInfo[64];
        GetMenuItem(menu, param2, sInfo, sizeof(sInfo));
       
        if(StrEqual(sInfo, "option1"))
        {
        SetEntityHealth(client, 300);
        SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 0.8);
        CPrintToChat(client, "%s : {green}Vous avez reçu 100 de vie supplémentaire.", LOGO);
           
        SetEntityModel(client, MODEL_VIE);
        }
       
        else if(StrEqual(sInfo, "option2"))
        {
            SetEntityGravity(client, Float: 1.5);
            CPrintToChat(client, "%s : {green}Vous avez obtenu plus de gravité.", LOGO);
           
            SetEntityModel(client, MODEL_GRAVITE);
        }
       
        else if(StrEqual(sInfo, "option3"))
        {
            SetEntPropFloat(client, Prop_Data, "m_flLaggedMovementValue", 1.6);
        CPrintToChat(client, "%s : {green}Vous avez obtenu plus de vitesse.", LOGO);
           
            SetEntityModel(client, MODEL_VITESSE);
        }
        g_bUseBonus[client] = false;
       
        else if(StrEqual(sInfo, "option4"))
        {
        SetMenuOpen
        }
    }
    else if(MenuAction_End == action)
    {
        CloseHandle(menu);
    }
}


public Action:advert(Handle:timer)
{
    CPrintToChatAll ("%s : {green}Des Races vip (Tank VIP, Ninja VIP, Bhunny VIP et Attaque VIP) pour 1 allopass, UltraVIP : Des skins (5ct et 4t) et des commandes pour 2 allopass plus d'infos contacter {red}RedGames {green}sur steam .", VIP);
    CPrintToChatAll ("%s : {blue}La Team recrute, ajoutez {red}RedGames {blue}sur steam pour plus d'informations .", TEAM);
    CPrintToChatAll ("%s : {orange}Tapez !bonus pour voir les bonus disponible pour vous .", LOGO);
}


Viewing all articles
Browse latest Browse all 5196

Trending Articles


FORECLOSURE OF REAL ESTATE MORTGAGE


Sapos para colorear


Break up Quotes Tagalog Love Quote – Broken Hearted Quotes Tagalog


Patama Quotes : Tagalog Inspirational Quotes


Pamatay na Banat and Mga Patama Love Quotes


5 Tagalog Relationship Rules


INUMAN QUOTES


Re:Mutton Pies (lleechef)


Vimeo 10.7.1 by Vimeo.com, Inc.


Girasoles para colorear


Tagalog Quotes About Crush – Tagalog Love Quotes


OFW quotes : Pinoy Tagalog Quotes


Long Distance Relationship Tagalog Love Quotes


Tagalog Quotes To Move on and More Love Love Love Quotes


BARKADA TAGALOG QUOTES


Best Crush Tagalog Quotes And Sayings 2017


Vimeo 10.7.0 by Vimeo.com, Inc.