AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   he grenade prb hns (https://forums.alliedmods.net/showthread.php?t=184014)

Sum 04-29-2012 16:33

he grenade prb hns
 
Heyo, i got problem, this plugin gives admin_level_h flagged player at spawn each round He but only for 0.5 ms :) after its like sthk restricts it can u fix it please???


Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <hamsandwich>
#include <fun>
#include <fakemeta_util>

#define PLUGIN "HE SPAWN"
#define VERSION "1.0"
#define AUTHOR "Johny"


public plugin_init()
{
        RegisterHam(Ham_Spawn, "player", "fwHamPlayerSpawnPost", 1)       
}
public fwHamPlayerSpawnPost() {

        new players[32], player, pnum;
        get_players(players, pnum, "a");
        for(new i = 0; i < pnum; i++)
        {
                player = players[i];
                if(is_user_alive(player) && get_user_flags(player) & ADMIN_LEVEL_H)
                {
                give_item(player, "weapon_hegrenade");
                }
        }
        return PLUGIN_HANDLED
}


<VeCo> 04-29-2012 16:39

Re: he grenade prb hns
 
Remove that loop and get_players. Ham_Spawn is called seperately on every player's spawn and has the 'id' parameter.
Also you need only amxmodx, amxmisc, hamsandwich and fun includes.

<VeCo> 04-29-2012 17:34

Re: he grenade prb hns
 
This is correct:

PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <hamsandwich>
#include <fun>
 
#define PLUGIN "HE SPAWN"
#define VERSION "1.0"
#define AUTHOR "Johny"
 
public plugin_init()
{
    
RegisterHam(Ham_Spawn"player""fwHamPlayerSpawnPost"1);  
}
 
public 
fwHamPlayerSpawnPost(id
{
    if(
is_user_alive(id) && get_user_flags(id) & ADMIN_LEVEL_H)
    {
        
give_item(id"weapon_hegrenade");
    }



Sum 04-30-2012 05:03

Re: he grenade prb hns
 
This is not workin :( , in hud it prints me He grenade icon but its red, somehow hns by exolent blocks He grenades by cvar, but i dont want to allow it at all, i want it restricted :)


All times are GMT -4. The time now is 07:46.

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