Jump to content
News ticker
  • Bienvenue sur le nouveau forum VeryGames
  • Welcome to the new VeryGames forum
  • VeryNews

    .:: PARTAGE ::. 3 plugins pour le Zombie Mod


    Kriax
     Share

    Recommended Posts

    Salut,

     

    J'ai fais trois plugins qui peux êtres utiles pour le ZombieMod ^^

     

    Les trois plugins sont :

    - !guns : Menu d'arme

    - !he : Avoir une HE

    - !nades : Avoir une Flash et une Smoke.

     

    Les trois commandes ne sont utilisables que en CT (Pour évité que les Zombies ne peuvent les utilisés ^^)

     

    Le Guns :

    #include <sourcemod>
    #include <cstrike>
    #include <sdktools>
    
    new Handle:sm_guns = INVALID_HANDLE; 
    
    new guns = 0;  
    new guns_times[MAXPLAYERS] = 0;
    
    new bool:HasGuns[MAXPLAYERS] = false;
    new bool:HasUseGuns[MAXPLAYERS] = false;
    
    #define PREFIX  "\x01[\x03Guns\x01] %t"
    
    public Plugin:myinfo = 
    {
       name = "*~ Guns Menu ~*",
       author = "Kriax",
       version = "1.2",
    }
    
    public OnPluginStart()
    {
       HookEvent("round_start", OnRoundStart);
       sm_guns = CreateConVar("sm_guns", "2", "Combien de fois on peux utilisé le menu", FCVAR_NONE, true, 0.0);
       guns = GetConVarInt(sm_guns);
       HookConVarChange(sm_guns, ConVarChanged);
    
       RegConsoleCmd("sm_guns", amdcmd_guns, "Commande du menu!");
       AutoExecConfig(true, "sm_guns");
    }
    
    public ConVarChanged(Handle:convar, const String:oldValue[], const String:newValue[])
    {
       guns = GetConVarInt(sm_guns);
    }
    
    public OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
    {
       new client = GetClientOfUserId(GetEventInt(event, "userid"));
       for(new i = 1; i <= MaxClients; i++)
       {
           HasGuns[i] = false;
           HasUseGuns[i] = false;
           guns_times[i] = 0;
       }
    } 
    
    public Action:amdcmd_guns(client, args)
    {
       if(client == 0)
       {
           ReplyToCommand(client, "\x05[Guns] \x03Commande non disponnible");
           return Plugin_Handled;
       }
       if(guns <= 0)
       {
           ReplyToCommand(client, "\x05[Guns] \x03La commande est désactivé");
           return Plugin_Handled;
       }
       if(GetClientTeam(client) == 2)
       {
           ReplyToCommand(client, "\x05[Guns] \x03Vous devez être humain");
           return Plugin_Handled;
       }
       if(GetClientTeam(client) == 1)
       {
           ReplyToCommand(client, "\x05[Guns] \x03Vous ne pouvez pas utilisé cette commande en Spactateur");
           return Plugin_Handled;
       }
       if(HasGuns[client])
       {
           ReplyToCommand(client, guns_times[client] >= guns ? "\x05[Guns] \x03Vous avez utiliser toute vos chances":"Vous ne pouvez plus ouvrir le menu");
           return Plugin_Handled;
       }
       else
       {
           HasUseGuns[client] = true;
           new Handle:menu = CreateMenu(choix);
           SetMenuTitle(menu, ".:: Guns Menu ::.");
           AddMenuItem(menu, "option1", "Awp");
           AddMenuItem(menu, "option2", "Auto Noob");
           AddMenuItem(menu, "option3", "Krieg Commando");
           AddMenuItem(menu, "option4", "Galil");
           AddMenuItem(menu, "option5", "Ak47");
           AddMenuItem(menu, "option6", "Scout");
           AddMenuItem(menu, "option7", "Krieg");
           AddMenuItem(menu, "option8", "Famas");
           AddMenuItem(menu, "option9", "M4A1");
           AddMenuItem(menu, "option10", "Bullpup");
           AddMenuItem(menu, "option11", "Pompe");
           AddMenuItem(menu, "option12", "Shotgun");
           AddMenuItem(menu, "option13", "MAC-10");
           AddMenuItem(menu, "option14", "Piou Piou");
           AddMenuItem(menu, "option15", "MP5");
           AddMenuItem(menu, "option16", "UMP45");
           AddMenuItem(menu, "option17", "P90");
           AddMenuItem(menu, "option18", "Batteuse");
           AddMenuItem(menu, "option19", "Glock");
           AddMenuItem(menu, "option20", "USP");
           AddMenuItem(menu, "option21", "Compact");
           AddMenuItem(menu, "option22", "Deagle");
           AddMenuItem(menu, "option23", "Dual Elites");
           AddMenuItem(menu, "option24", "Five Seven");
           SetMenuExitButton(menu, true);
           DisplayMenu(menu, client, MENU_TIME_FOREVER);
           guns_times[client]++;
           if(guns_times[client] >= guns) 
           {
               HasGuns[client] = true;
           }
           ReplyToCommand(client, "\x05[Guns] \x03Menu utilisé \x08%i/%i", guns_times[client], guns);
       }
       return Plugin_Continue;
    }
    
    public choix(Handle:menu, MenuAction:action, client, itemNum)
    {
       if ( action == MenuAction_Select )
       {
           switch (itemNum)
           {
               case 0:
               {
                   GivePlayerItem(client, "weapon_awp"); 
                   PrintToChat(client, PREFIX, "Vous avez choisis l'Awp");
               }
               case 1:
               {
                   GivePlayerItem(client, "weapon_g3sg1"); 
                   PrintToChat(client, PREFIX, "Vous avez choisis le G3sg1");
               }
               case 2:
               {
                   GivePlayerItem(client, "weapon_sg550");  
                   PrintToChat(client, PREFIX, "Vous avez choisis le Sg550");
               }
               case 3:
               {
                   GivePlayerItem(client, "weapon_galil"); 
                   PrintToChat(client, PREFIX, "Vous avez choisis le Gelil");
               }
               case 4:
               {
                   GivePlayerItem(client, "weapon_ak47"); 
                   PrintToChat(client, PREFIX, "Vous avez choisis l'AK47");
               }
               case 5:
               {
                   GivePlayerItem(client, "weapon_scout"); 
                   PrintToChat(client, PREFIX, "Vous avez choisis le Scout");
               }
               case 6:
               {
                   GivePlayerItem(client, "weapon_sg552"); 
                   PrintToChat(client, PREFIX, "Vous avez choisis le Sg552");
               }
               case 7:
               {
                   GivePlayerItem(client, "weapon_famas"); 
                   PrintToChat(client, PREFIX, "Vous avez choisis le Famas");
               }
               case 8:
               {
                   GivePlayerItem(client, "weapon_m4a1"); 
                   PrintToChat(client, PREFIX, "Vous avez choisis la M4A1");
               }
               case 9:
               {
                   GivePlayerItem(client, "weapon_aug"); 
                   PrintToChat(client, PREFIX, "Vous avez choisis le Aug");
               }
               case 10:
               {
                   GivePlayerItem(client, "weapon_m3"); 
                   PrintToChat(client, PREFIX, "Vous avez choisis le M3");
               }
               case 11:
               {
                   GivePlayerItem(client, "weapon_xm1014"); 
                   PrintToChat(client, PREFIX, "Vous avez choisis le XM1014");
               }
               case 12:
               {
                   GivePlayerItem(client, "weapon_mac10");
                   PrintToChat(client, PREFIX, "Vous avez choisis le Mac10");
               }
               case 13:
               {
                   GivePlayerItem(client, "weapon_tmp"); 
                   PrintToChat(client, PREFIX, "Vous avez choisis le tmp");
               }
               case 14:
               {
                   GivePlayerItem(client, "weapon_mp5navy");
                   PrintToChat(client, PREFIX, "Vous avez choisis le Mp5navy");
               }
               case 15:
               {
                   GivePlayerItem(client, "weapon_ump45");
                   PrintToChat(client, PREFIX, "Vous avez choisis le Ump45");
               }
               case 16:
               {
                   GivePlayerItem(client, "weapon_p90"); 
                   PrintToChat(client, PREFIX, "Vous avez choisis le P90");
               }
               case 17:
               {
                   GivePlayerItem(client, "weapon_m249"); 
                   PrintToChat(client, PREFIX, "Vous avez choisis la M249");
               }
               case 18:
               {
                   GivePlayerItem(client, "weapon_glock");
                   PrintToChat(client, PREFIX, "Vous avez choisis le Glock");
               }
               case 19:
               {
                   GivePlayerItem(client, "weapon_usp");
                   PrintToChat(client, PREFIX, "Vous avez choisis l'Usp");
               }
               case 20:
               {
                   GivePlayerItem(client, "weapon_p228");
                   PrintToChat(client, PREFIX, "Vous avez choisis le P228");
               }
               case 21:
               {
                   GivePlayerItem(client, "weapon_deagle");
                   PrintToChat(client, PREFIX, "Vous avez choisis le Deagle");
               }
               case 22:
               {
                   GivePlayerItem(client, "weapon_dual");
                   PrintToChat(client, PREFIX, "Vous avez choisis le Dual");        
               }
               case 23:
               {
                   GivePlayerItem(client, "weapon_fiveseven"); 
                   PrintToChat(client, PREFIX, "Vous avez choisis le Fiveseven");
               }
           }
       }
    }
    
    public OnClientDisconnect_Post(client)
    {
       HasGuns[client] = true;
       guns_times[client] = 0;
    }  
    

    --> La Cvar "sm_guns" permet de définir combiens de fois on peux utilisé le menu (Par round)

     

    Le plugin HE :

    #include <sourcemod>
    #include <cstrike>
    #include <sdktools>
    
    new Handle:sm_he = INVALID_HANDLE; 
    new he = 0;  
    new he_times[MAXPLAYERS] = 0;
    
    new bool:HasHe[MAXPLAYERS] = false;
    new bool:HasUseHe[MAXPLAYERS] = false;
    
    public Plugin:myinfo = 
    {
       name = "*~ he ~*",
       author = "Kriax",
       version = "1.0",
    }
    
    public OnPluginStart()
    {
       HookEvent("round_start", OnRoundStart);
       sm_he = CreateConVar("sm_he", "3", "Combien de fois on peux utilisé la grenade", FCVAR_NONE, true, 0.0);
       he = GetConVarInt(sm_he);
       HookConVarChange(sm_he, ConVarChanged);
    
       RegConsoleCmd("sm_he", amdcmd_he, "Commande de HE");
       AutoExecConfig(true, "sm_he");
    }
    
    public ConVarChanged(Handle:convar, const String:oldValue[], const String:newValue[])
    {
       he = GetConVarInt(sm_he);
    }
    
    public OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
    {
       new client = GetClientOfUserId(GetEventInt(event, "userid"));
       for(new i = 1; i <= MaxClients; i++)
       {
           HasHe[i] = false;
           HasUseHe[i] = false;
           he_times[i] = 0;
       }
    }
    
    public Action:amdcmd_he(client, args)
    {
       if(client == 0)
       {
           ReplyToCommand(client, "\x05[HE] \x03Commande non disponnible");
           return Plugin_Handled;
       }
    
       if(he <= 0) 
       {
           ReplyToCommand(client, "\x05[HE] \x03La commande est désactivé");
           return Plugin_Handled;
       }
       if(GetClientTeam(client) == 2)
       {
           ReplyToCommand(client, "\x05[HE] \x03Vous devez être humain");
           return Plugin_Handled;
       }
       if(GetClientTeam(client) == 1)
       {
           ReplyToCommand(client, "\x05[HE] \x03Vous ne pouvez pas utilisé cette commande en Spactateur");
           return Plugin_Handled;
       }
       if(HasHe[client])
       {
           ReplyToCommand(client, he_times[client] >= he ? "\x05[HE] \x03Vous avez utiliser toute vos grenades":"Vous ne pouvez plus avoir de grenades");
           return Plugin_Handled;
       }
       else
       {
           HasUseHe[client] = true;
           GivePlayerItem(client, "weapon_hegrenade");
           he_times[client]++;
    
           if(he_times[client] >= he) 
           {
               HasHe[client] = true;
           }
           ReplyToCommand(client, "\x05[HE] \x03Grenade utilisé \x08%i/%i", he_times[client], he);
       }
       return Plugin_Continue;
    
    }
    
    public OnClientDisconnect_Post(client)
    {
       HasHe[client] = true;
       he_times[client] = 0;
    }  
    

     

    --> La Cvar "sm_he" permet de définir combiens de fois on peux utilisé la commandes (Par round)

     

    Le plugin Nade :

     

    #include <sourcemod>
    #include <cstrike>
    #include <sdktools>
    
    new Handle:sm_nade = INVALID_HANDLE; 
    new nade = 0;  
    new nade_times[MAXPLAYERS] = 0;
    
    new bool:Hasnade[MAXPLAYERS] = false;
    new bool:HasUsenade[MAXPLAYERS] = false;
    
    public Plugin:myinfo = 
    {
       name = "*~ Nades ~*",
       author = "Kriax",
       version = "1.0",
    }
    
    public OnPluginStart()
    {
       HookEvent("round_start", OnRoundStart);
       sm_nade = CreateConVar("sm_nades", "2", "Combien de fois on peux utilisé le nade", FCVAR_NONE, true, 0.0);
       nade = GetConVarInt(sm_nade);
       HookConVarChange(sm_nade, ConVarChanged);
    
       RegConsoleCmd("sm_nades", s, "Commande de nades");
       AutoExecConfig(true, "sm_nades");
    }
    
    public ConVarChanged(Handle:convar, const String:oldValue[], const String:newValue[])
    {
       nade = GetConVarInt(sm_nade);
    }
    
    public OnRoundStart(Handle:event, const String:name[], bool:dontBroadcast)
    {
       new client = GetClientOfUserId(GetEventInt(event, "userid"));
       for(new i = 1; i <= MaxClients; i++)
       {
           Hasnade[i] = false;
           HasUsenade[i] = false;
           nade_times[i] = 0;
       }
    }
    
    public Action:amdcmd_nades(client, args)
    {
       if(client == 0)
       {
           ReplyToCommand(client, "\x05[Nades] \x03Commande non disponnible");
           return Plugin_Handled;
       }
    
       if(nade <= 0) 
       {
           ReplyToCommand(client, "\x05[Nades] \x03La commande est désactivé");
           return Plugin_Handled;
       }
       if(GetClientTeam(client) == 2)
       {
           ReplyToCommand(client, "\x05[Nades] \x03Vous devez être humain");
           return Plugin_Handled;
       }
       if(GetClientTeam(client) == 1)
       {
           ReplyToCommand(client, "\x05[Nades] \x03Vous ne pouvez pas utilisé cette commande en Spactateur");
           return Plugin_Handled;
       }
       if(Hasnade[client])
       {
           ReplyToCommand(client, nade_times[client] >= nade ? "\x05[Nades] \x03Vous avez utiliser toute vos nades":"Vous ne pouvez plus avoir de smoke ni de flash");
           return Plugin_Handled;
       }
       else
       {
           HasUsenade[client] = true;
           GivePlayerItem(client, "weapon_flashbang");
           GivePlayerItem(client, "weapon_smokegrenade");
           nade_times[client]++;
    
           if(nade_times[client] >= nade) 
           {
               Hasnade[client] = true;
           }
           ReplyToCommand(client, "\x05[Nades] \x03Nades utilisé \x08%i/%i", nade_times[client], nade);
       }
       return Plugin_Continue;
    
    }
    
    public OnClientDisconnect_Post(client)
    {
       Hasnade[client] = true;
       nade_times[client] = 0;
    }  
    

     

    --> La Cvar "sm_nades" permet de définir combiens de fois on peux utilisé la commandes (Par round)

     

    Les trois plugins sont les même à la base mais avec des modifications ^^

    Tant que j'y pense, ca fais un moment que j'ai pas poster de plugin non ? =o

    Kriax.

    Link to comment
    Share on other sites

    pour le guns, dans le AddMenuItem tu aurais du mettre genre weapon_awp a la place de optionX, et ensuite dans le menu =>

     

    new String:info[32];
    GetMenuItem(menu, param2, info, sizeof(info));
    
    GivePlayerItem(client, info);
    

     

    en une ligne sa give ce qu'il choisis, il me semble que cela fonctionne.

    Link to comment
    Share on other sites

    pour le guns, dans le AddMenuItem tu aurais du mettre genre weapon_awp a la place de optionX, et ensuite dans le menu =>

    Oui mais pour un plugin aussi petit je préfère faire avec les options ;)

     

    Si je le fais comme cela ces que j'ai mes raisons T_T

     

    Utilisable pour un ba_jail aussi je pense. ;)

     

    Il faut modifier les plugins alors, car le "Vous devez êtres humain" pour un ba_jail ^^"

     

    Kriax.

    Link to comment
    Share on other sites

    Je vois que tu recommences à coder (ou du moins à partager tes chefs-d’œuvres)!

     

    Je n'ai jamais arrêter, mais je me voit pas partager mes projet entamé et non terminer, comme mon Vip Menu V1.4 ^^

     

    De-rien :p

    Kriax.

    Link to comment
    Share on other sites

    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.

    Guest
    Reply to this topic...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.

     Share

    ×
    ×
    • Create New...