AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [Help] Admin Level (https://forums.alliedmods.net/showthread.php?t=98954)

LostSkill 07-31-2009 05:32

[Help] Admin Level
 
PHP Code:

#include <amxmodx>

#define PLUGIN "Bullet Damage"
#define AUTHOR "ConnorMcLeod"
#define VERSION "0.0.1"

#define MAX_PLAYERS    32

new const Float:g_flCoords[][] = 
{
    {
0.500.40},
    {
0.560.44},
    {
0.600.50},
    {
0.560.56},
    {
0.500.60},
    {
0.440.56},
    {
0.400.50},
    {
0.440.44}
}

new 
g_iPlayerPos[MAX_PLAYERS+1]

new 
g_iMaxPlayers
new g_pCvarEnabled

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)

    
g_pCvarEnabled register_cvar("bullet_damage""1")

    
register_event("Damage""Event_Damage""b""2>0""3=0")

    
g_iMaxPlayers get_maxplayers()
}

public 
Event_DamageiVictim )
{
    if( 
get_pcvar_num(g_pCvarEnabled) && (read_data(4) || read_data(5) || read_data(6)) )
    {
        new 
id get_user_attacker(iVictim)
        if( (
<= id <= g_iMaxPlayers) && is_user_connected(id) )
        {
            new 
iPos = ++g_iPlayerPos[id]
            if( 
iPos == sizeof(g_flCoords) )
            {
                
iPos g_iPlayerPos[id] = 0
            
}
            
set_hudmessage(04080Float:g_flCoords[iPos][0], Float:g_flCoords[iPos][1], 00.12.50.020.02, -1)
            
show_hudmessage(id"%d"read_data(2))
        }
    }


Helloi got question maybe somebody can do that show this DMG only for user's who got ADMIN_LEVEL_G? Becouse i try'ed to add it but no luck dont know what i am doing wrong ;/

[ --<-@ ] Black Rose 07-31-2009 06:29

Re: [Help] Admin Level
 
get_user_flags(iVictim) & ADMIN_LEVEL_G

LostSkill 07-31-2009 06:38

Re: [Help] Admin Level
 
i try'ed this and whit ID but no luck... maybe i was add'ing to bad positions but i dont think so ;/

[ --<-@ ] Black Rose 07-31-2009 17:23

Re: [Help] Admin Level
 
if( get_user_level(iVictim) & ADMIN_LEVEL_G && get_pcvar_num(g_pCvarEnabled) && (read_data(4) || read_data(5) || read_data(6)) )

LostSkill 07-31-2009 18:02

Re: [Help] Admin Level
 
PHP Code:

if( get_user_flags(iVictim) & ADMIN_LEVEL_H && get_pcvar_num(g_pCvarEnabled) && (read_data(4) || read_data(5) || read_data(6)) ) 

Dont works :(

fysiks 07-31-2009 18:45

Re: [Help] Admin Level
 
Quote:

Originally Posted by LostSkill (Post 886968)
PHP Code:

if( get_user_flags(iVictim) & ADMIN_LEVEL_H && get_pcvar_num(g_pCvarEnabled) && (read_data(4) || read_data(5) || read_data(6)) ) 

Dont works :(

You should use "id" and not "iVictim".

PHP Code:

if( get_user_flags(id) & ADMIN_LEVEL_H && get_pcvar_num(g_pCvarEnabled) && (read_data(4) || read_data(5) || read_data(6)) ) 

Well, that is how I interpreted your request anyways.

LostSkill 08-01-2009 01:56

Re: [Help] Admin Level
 
I cant do id b/c only after this like i get "new id" so it dont accept another word in this like ;/

[ --<-@ ] Black Rose 08-01-2009 07:20

Re: [Help] Admin Level
 
My bad, I thought the message was for iVictim.
if ( 1 <= id <= g_iMaxPlayers && get_user_flags(id) & ADMIN_LEVEL_H && is_user_connected(id) )

LostSkill 08-01-2009 11:45

Re: [Help] Admin Level
 
Dont works too >.<

[ --<-@ ] Black Rose 08-01-2009 14:57

Re: [Help] Admin Level
 
Show full script. WHAT doesn't work?


All times are GMT -4. The time now is 18:31.

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