Aller au contenu
News ticker
  • Bienvenue sur le nouveau forum VeryGames
  • Welcome to the new VeryGames forum
  • VeryNews

    grenade illimiter


    rayco

    Messages recommandés

    Salut,

     

    Dans ton "mani_server.cfg" vers le bas,tu trouveras cette commande:

     

    // 0 = 1 grenade par joueur

    // 1 = Grenades illimitees

    mani_unlimited_grenades 1

     

     

    RÉVEIL !!

     

     

     

    C'est possible avec un plugin, mais il te faudra un autre plugin pour empêcher les joueurs mal-intentionnés de crasher ton serveur.

    Lien vers le commentaire
    Partager sur d’autres sites

    Voila un plugin tout frais pour toi.

    Je te conseille d'installer aussi ce plugin qui supprime le son "ca va péter" et qui enlève la phrase du tchat : http://forums.alliedmods.net/showthread.php?p=466271

     

     

    Tout est activé par défaut, mais tu peux changer en mettant cette commande dans amxx.cfg :

     

    nades_arena "abc"

     

    a pour les HE, b pour les Flashs, et c pour les smokes, enlève la lettre si tu ne veux pas d'une grenade.

     

     

    -edit-

    Plugin Optimisé !

    -edit2-

    Fix d'une typo.

    /*	Copyright © 2008, ConnorMcLeod
    
    Unlimited Nades is free software;
    you can redistribute it and/or modify it under the terms of the
    GNU General Public License as published by the Free Software Foundation.
    
    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.
    
    You should have received a copy of the GNU General Public License
    along with Unlimited Nades; if not, write to the
    Free Software Foundation, Inc., 59 Temple Place - Suite 330,
    Boston, MA 02111-1307, USA.
    */
    
    #include <amxmodx>
    #include <fakemeta>
    #include <hamsandwich>
    
    #define PLUGIN "Unlimited Nades"
    #define AUTHOR "ConnorMcLeod"
    #define VERSION "0.1.1"
    
    #define OFFSET_FLASH_AMMO			387
    #define OFFSET_HE_AMMO				388
    #define OFFSET_SMOKE_AMMO			389
    
    #define	HE_FLAG	(1<<CSW_HEGRENADE)
    #define	FB_FLAG	(1<<CSW_FLASHBANG)
    #define	SG_FLAG	(1<<CSW_SMOKEGRENADE)
    
    new g_iArena = (HE_FLAG|FB_FLAG|SG_FLAG)
    new g_iMaxPlayers
    
    public plugin_init()
    {
    register_plugin( PLUGIN, VERSION, AUTHOR )
    
    register_forward(FM_SetModel, "SetModel", 1)
    RegisterHam(Ham_Spawn, "player", "Spawn", 1)
    
    register_concmd("nades_arena", "Command_Arena", ADMIN_CFG)
    
    g_iMaxPlayers = get_maxplayers()
    }
    
    public Command_Arena(id, level)
    {
    if( !( get_user_flags(id) & level ) )
    {
    	return PLUGIN_HANDLED
    }
    
    if( read_argc() < 2 )
    {
    	client_print(id, print_console, "Usage: nades_arena <flags>")
    	return PLUGIN_HANDLED
    }
    
    new szFlags[4]
    read_argv(1, szFlags, 3)
    GetNadesFlags(szFlags)
    
    for(new id = 1; id <= g_iMaxPlayers; id++)
    {
    	// This actually only gives nades to alive players
    	// Nobody will be spawned ;)
    	Spawn(id)
    }
    
    return PLUGIN_HANDLED
    }
    
    GetNadesFlags(const szFlags[]) 
    {
    static const iNadesIds[] = { CSW_HEGRENADE, CSW_FLASHBANG, CSW_SMOKEGRENADE }
    
    new i, cLetter, iVal
    g_iArena = 0
    
    while( ( cLetter = szFlags[i++] ) )
    {
    	iVal = cLetter - 'a'
    	if( 0 <= iVal < sizeof(iNadesIds) )
    	{
    		g_iArena |= (1<<( iNadesIds[iVal] ))
    	}
    }
    }
    
    public Spawn(id)
    {
    if( is_user_alive(id) )
    {
    	if( g_iArena & HE_FLAG )
    	{
    		fm_give_item( id, "weapon_hegrenade")
    	}
    	if( g_iArena & FB_FLAG )
    	{
    		fm_give_item( id, "weapon_flashbang")
    	}
    	if( g_iArena & SG_FLAG )
    	{
    		fm_give_item( id, "weapon_smokegrenade")
    	}
    }
    }
    
    public SetModel(iEnt, szModel[])
    {
    if(!pev_valid(iEnt))
    {
    	return
    }
    
    // strlen("models/w_hegrenade.mdl")    models/ [w] [_]
    if( strlen(szModel) < 22 || szModel[7] != 'w' || szModel[8] != '_' )
    	return
    
    new iGrenType
    switch( szModel[9] )
    {
    	// models/w_ [h] egrenade.mdl
    	case 'h':
    	{
    		iGrenType = CSW_HEGRENADE
    	}
    	// models/w_ [f] [l] ashbang.mdl
    	case 'f':
    	{
    		if( szModel[10] != 'l' )
    		{
    			return
    		}
    		iGrenType = CSW_FLASHBANG
    	}
    	// models/w_ [s] [m] okegrenade.mdl
    	case 's':
    	{
    		if( szModel[10] != 'm' )
    		{
    			return
    		}
    		iGrenType = CSW_SMOKEGRENADE
    	}
    	default:return
    }
    
    if( !( g_iArena & (1<<iGrenType) ) )
    {
    	return
    }
    
    static Float:flGravity
    pev(iEnt, pev_gravity, flGravity)
    if( !flGravity )
    	return
    
    new id = pev(iEnt, pev_owner)
    
    if( !is_user_alive(id) )
    	return
    
    cs_set_user_nade_bpammo(id, iGrenType, 2)
    }
    
    fm_give_item(index, const item[])
    {
    new ent = engfunc(EngFunc_CreateNamedEntity, engfunc(EngFunc_AllocString,item));
    if (!pev_valid(ent))
    	return 0;
    
    new Float:origin[3];
    pev(index, pev_origin, origin);
    set_pev(ent, pev_origin, origin);
    set_pev(ent, pev_spawnflags, pev(ent, pev_spawnflags) | SF_NORESPAWN);
    dllfunc(DLLFunc_Spawn, ent);
    
    new save = pev(ent, pev_solid);
    dllfunc(DLLFunc_Touch, ent, index);
    if (pev(ent, pev_solid) != save)
    	return ent;
    
    engfunc(EngFunc_RemoveEntity, ent);
    
    return -1;
    }
    
    cs_set_user_nade_bpammo(id, iWeapon, iAmount)
    {
    switch(iWeapon)
    {
    	case CSW_FLASHBANG: set_pdata_int(id, OFFSET_FLASH_AMMO, iAmount)
    	case CSW_HEGRENADE: set_pdata_int(id, OFFSET_HE_AMMO, iAmount)
    	case CSW_SMOKEGRENADE: set_pdata_int(id, OFFSET_SMOKE_AMMO, iAmount)
    }
    }

    Modifié par dentelle
    Lien vers le commentaire
    Partager sur d’autres sites

    comme tous les plugins.

    very.wiki est ton ami ==> http://wiki.verygames.net/index.php?title=AMX_Mod_et_AMX_Mod_X#Installation_de_AmxModX

     

    dans le lien qu'il t'a donné tu a un .sma(la souce) et un .amxx (le plugins compiler).

    tu place le .amxx dans ton czero/addons/amxmodx/plugins

    et tu declare ce plugins dans ton plugins.ini (czero/addons/amxmodx/configs/plugins.ini)

    N'oublie pas de configurer les CVAR

    Tout est activé par défaut, mais tu peux changer en mettant cette commande dans amxx.cfg :

     

    nades_arena "abc"

     

    a pour les HE, b pour les Flashs, et c pour les smokes, enlève la lettre si tu ne veux pas d'une grenade.

     

    Tu REBOOT ton serv et c'est bon.

     

    Good game.

    Modifié par PITBULL13
    Lien vers le commentaire
    Partager sur d’autres sites

    Le lien que je lui ai filé n'est qu'un complément, il faut compiler le code que j'ai mis pour avoir le plugin principal.

     

    Pour compiler, copie/colle le code que je t'ai donné ici : http://webcomp.ak-team.com/index.php

    Choisi le compiler qui correspond à ta version d'amxx (j'espère pour toi 1.8.1), clique sur compiler, un lien (valide pendant 10min) te sera donné pour télécharger le plugin.

     

    P.S. : Un changement de map suffit, jamais besoin de rebooter un serveur pour installer un plugin amx/x, uniquement quand on installe un plugin metamod (amxx, steambans, logmod, monstermod etc...)

    Modifié par dentelle
    Lien vers le commentaire
    Partager sur d’autres sites

    Je pense avoir installer ton plugin correctement mais il ne fonctionne pas j'ai fait:

    -je les compiler comme tu ma dit

    -je les transférer dans .../addons/amxmodx/plugins/

    -je les déclarer dans plugins.ini (linux addons/amxmodx/plugins/grenade_illimiter(2).amxx)

    j'ai reboot le serveur mais aucune grenade n'est illimitée ... es que j'ai sauter ou mal fait une étape ?

    Lien vers le commentaire
    Partager sur d’autres sites

    Oui c'est bien la dernière version de ton plugin voila se que me donne meta list:

    description stat pend file vers src load unlod

    [ 1] AMX Mod X RUN - amxmodx_mm_i386. v1.8.1.3 ini Start ANY

    [ 2] <models_player. badf load models_player.am v - ini - -

    [ 3] <grenade_illimi badf load grenade_illimite v - ini - -

    [ 4] Fun RUN - fun_amxx_i386.so v1.8.1.3 pl1 ANY ANY

    [ 5] Engine RUN - engine_amxx_i386 v1.8.1.3 pl1 ANY ANY

    [ 6] CStrike RUN - cstrike_amxx_i38 v1.8.1.3 pl1 ANY ANY

    [ 7] CSX RUN - csx_amxx_i386.so v1.8.1.3 pl1 ANY ANY

    [ 8] FakeMeta RUN - fakemeta_amxx_i3 v1.8.1.3 pl1 ANY ANY

    [ 9] Ham Sandwich RUN - hamsandwich_amxx v1.8.1.3 pl1 ANY ANY

    [10] CSDM2 RUN - csdm_amxx_i386.s v2.1.1 pl1 ANY ANY

    10 plugins, 8 running

     

    et voila se que me donne amxx list :

    name version author file status

    [ 1] Admin Base 1.8.1.3746 AMXX Dev Team admin.amxx running

    [ 2] Admin Commands 1.8.1.3746 AMXX Dev Team admincmd.amxx running

    [ 3] Admin Help 1.8.1.3746 AMXX Dev Team adminhelp.amxx running

    [ 4] Slots Reservation 1.8.1.3746 AMXX Dev Team adminslots.amxx running

    [ 5] Multi-Lingual System 1.8.1.3746 AMXX Dev Team multilingual.am running

    [ 6] Menus Front-End 1.8.1.3746 AMXX Dev Team menufront.amxx running

    [ 7] Commands Menu 1.8.1.3746 AMXX Dev Team cmdmenu.amxx running

    [ 8] Players Menu 1.8.1.3746 AMXX Dev Team plmenu.amxx running

    [ 9] Maps Menu 1.8.1.3746 AMXX Dev Team mapsmenu.amxx running

    [ 10] Plugin Menu 1.8.1.3746 AMXX Dev Team pluginmenu.amxx running

    [ 11] Admin Chat 1.8.1.3746 AMXX Dev Team adminchat.amxx running

    [ 12] Anti Flood 1.8.1.3746 AMXX Dev Team antiflood.amxx running

    [ 13] Scrolling Message 1.8.1.3746 AMXX Dev Team scrollmsg.amxx running

    [ 14] Info. Messages 1.8.1.3746 AMXX Dev Team imessage.amxx running

    18:34:05 [ 15] Admin Votes 1.8.1.3746 AMXX Dev Team adminvote.amxx running

    [ 16] NextMap 1.8.1.3746 AMXX Dev Team nextmap.amxx running

    [ 17] Nextmap Chooser 1.8.1.3746 AMXX Dev Team mapchooser.amxx running

    [ 18] TimeLeft 1.8.1.3746 AMXX Dev Team timeleft.amxx running

    [ 19] Pause Plugins 1.8.1.3746 AMXX Dev Team pausecfg.amxx running

    [ 20] Stats Configuration 1.8.1.3746 AMXX Dev Team statscfg.amxx running

    [ 21] StatsX 1.8.1.3746 AMXX Dev Team statsx.amxx running

    [ 22] AMX Match Deluxe 7.03 Infra amx_match_delux running

    [ 23] Parachute 1.3 KRoT@L/JTP10181 amx_parachute.a running

    [ 24] GunGame AMXX 2.11c Avalanche gungame.amxx running

    [ 25] Zombie Plague 4.05c MeRcyLeZZ zombie_plague40 running

    [ 26] [ZP] Default Zombie Cl 4.05 MeRcyLeZZ zp_zclasses40.a running

    [ 27] CSDM Main 2.1.1 CSDM Team csdm_main.amxx running

    [ 28] CSDM Equip 2.1.1 CSDM Team csdm_equip.amxx running

    [ 29] CSDM Mod 2.1.1 CSDM Team csdm_spawn_pres running

    18:34:05 [ 30] CSDM Misc 2.1.1 CSDM Team csdm_misc.amxx running

    [ 31] CSDM Protection 2.1.1 BAILOPAN csdm_protection running

    [ 32] CSDM Main 2.1.1 CSDM Team csdm_ffa.amxx running

    32 plugins, 32 running

     

    et pour le (2) c'est par se que j'ai plusieurs foi le fichier dans mon dossier téléchargement.

    Lien vers le commentaire
    Partager sur d’autres sites

    Rejoindre la conversation

    Vous pouvez publier maintenant et vous inscrire plus tard. Si vous avez un compte, connectez-vous maintenant pour publier avec votre compte.

    Invité
    Répondre à ce sujet…

    ×   Collé en tant que texte enrichi.   Coller en tant que texte brut à la place

      Seulement 75 émoticônes maximum sont autorisées.

    ×   Votre lien a été automatiquement intégré.   Afficher plutôt comme un lien

    ×   Votre contenu précédent a été rétabli.   Vider l’éditeur

    ×   Vous ne pouvez pas directement coller des images. Envoyez-les depuis votre ordinateur ou insérez-les depuis une URL.

    ×
    ×
    • Créer...