AlliedModders

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

Shadowless 08-05-2018 19:33

[DELETED]
 
---

remix.allstarz 08-05-2018 22:58

Re: [HELP] ADMIN + VIP Models
 
1 Attachment(s)
or u mean this
sry for my bad english but i can help you xD

soumyadip77 08-05-2018 22:59

Re: [HELP] ADMIN + VIP Models
 
Quote:

Originally Posted by remix.allstarz (Post 2608457)
What is your problem ?

if u need .amxx here

REMOVE AMXX and upload sma

soumyadip77 08-05-2018 23:14

Re: [HELP] ADMIN + VIP Models
 
you can try this one..

PHP Code:

/* Sublime AMXX Editor v2.2 */

#include <amxmodx>
// #include <amxmisc>
#include <cstrike>
// #include <engine>
// #include <fakemeta>
// #include <hamsandwich>
// #include <fun>
// #include <xs>
// #include <sqlx>

#define PLUGIN  "New Plug-In"
#define VERSION "1.0"
#define AUTHOR  "Author"

#define VIP_LEVEL ADMIN_LEVEL_H              // edit vip flag here
#define ADMIN_LEVEL ADMIN_KICK           //edit admin flag here


public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);

    
register_event("ResetHUD""resetModel""b");
}

public 
plugin_precache() 
{
    
precache_model("models/player/admin_te/admin_te.mdl");        //for admin ts
    
precache_model("models/player/admin_ct/admin_ct.mdl");       //for admin ct
    
precache_model("models/player/vip_ts/vip_ts.mdl");     //for vip ts
    
precache_model("models/player/vip_ct/vip_ct.mdl");   //vor vip ct

}

public 
resetModel(idlevelcid
{
    new 
CsTeams:userTeam cs_get_user_team(id);

        if (
get_user_flags(id) & ADMIN_LEVEL
        { 
            switch( 
userTeam )
            {
                case 
CS_TEAM_Tcs_set_user_model(id"admin_te");   //edit 
                
case CS_TEAM_CTcs_set_user_model(id"admin_ct");   //edit 
            
}
        }

        else if( 
get_user_flags(id) & VIP_LEVEL )
        {

            switch( 
userTeam )
            {
                case 
CS_TEAM_Tcs_set_user_model(id"vip_ts");   //edit 
                
case CS_TEAM_CTcs_set_user_model(id"vip_ct");   //edit 
            
}
        }

        return 
0;



Ghosted 08-06-2018 10:33

Re: [HELP] ADMIN + VIP Models
 
Quote:

Originally Posted by Shadowless (Post 2608596)
TNX, and one question

where add !is_user_bot(id)


like this? or am i wrong? if(get_user_flags(id) & ADMIN_LEVEL & !is_user_bot(id))

if(get_user_flags(id) & ADMIN_LEVEL && !is_user_bot(id))

&& = AND
|| = OR

soumyadip77 08-06-2018 11:04

Re: [HELP] ADMIN + VIP Models
 
&& use for 1 condition and & use to add 2 condition to make 1 condition if i am right i cant explain properly ....if u want any thing extra you can post here :)

Ghosted 08-06-2018 11:04

Re: [HELP] ADMIN + VIP Models
 
Quote:

Originally Posted by Shadowless (Post 2608599)
&& = AND
|| = OR
& = ? <-- whats one & means?

once upon a time i was IRC scripter :D

& = if contains specified bit (its like >=, <, == ...)

PHP Code:

new Variable

can have 32 bits
1 2 4 8 16 32 64...
This is used to reduce memory

Setting bits:
PHP Code:

Variable = (<< 0

PHP Code:

Variable |= (<< 0

(Last one adds bits)
(1 << 0) = 1
(1 << 1) = 2
(1 << 2) = 4 ... up to (1 << 31)

Setting more than 1 bits:
PHP Code:

Variable |= (<< 0)|(<< 1); 

Checking for bits:

PHP Code:

if (Variable & (<< 0)) 

or
PHP Code:

if (Variable 1

...

Unsetting bits:
PHP Code:

Variable &= ~(<< 0


Ghosted 08-06-2018 11:35

Re: [HELP] ADMIN + VIP Models
 
Quote:

Originally Posted by Shadowless (Post 2608610)
now i got other problem
i have both access on server (ADMIN_LEVEL_C and ADMIN_KICK) (flags "c" and "o")
and i`m with model of VIP, i want to be with model higher access ADMIN_KICK with model ADMIN


PHP Code:

#include <amxmodx>
#include <cstrike>
#define PLUGIN  "ADMIN + VIP Model"
#define VERSION "1.0"
#define AUTHOR  "Author"
#define VIP_MODEL ADMIN_LEVEL_C
#define ADMIN_MODEL ADMIN_KICK

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR);
    
register_event("ResetHUD""resetModel""b");
}

public 
plugin_precache() 
{
    
precache_model("models/player/admin_te/admin_te.mdl");
    
precache_model("models/player/admin_ct/admin_ct.mdl");
    
precache_model("models/player/vip_te/vip_te.mdl");
    
precache_model("models/player/vip_ct/vip_ct.mdl");
}

public 
resetModel(idlevelcid
{
    new 
CsTeams:userTeam cs_get_user_team(id);
    if(
get_user_flags(id) & ADMIN_MODEL && !is_user_bot(id))
    {
        switch( 
userTeam )
        {
            case 
CS_TEAM_Tcs_set_user_model(id"admin_te");
                case 
CS_TEAM_CTcs_set_user_model(id"admin_ct");
            }
    }
    if(
get_user_flags(id) & VIP_MODEL && !is_user_bot(id))
    {
        switch( 
userTeam )
        {
            case 
CS_TEAM_Tcs_set_user_model(id"vip_te");
                case 
CS_TEAM_CTcs_set_user_model(id"vip_ct");
            }
    }    
    return 
0;
}
/* AMXX-Studio Notes - DO NOT MODIFY BELOW HERE
*{\\ rtf1\\ ansi\\ deff0{\\ fonttbl{\\ f0\\ fnil Tahoma;}}\n\\ viewkind4\\ uc1\\ pard\\ lang1049\\ f0\\ fs16 \n\\ par }
*/ 


Code:

if(get_user_flags(id) & ADMIN_MODEL && !is_user_bot(id))
    {
        switch( userTeam )
        {
            case CS_TEAM_T: cs_set_user_model(id, "admin_te");
                case CS_TEAM_CT: cs_set_user_model(id, "admin_ct");
            }
    }
    else if(get_user_flags(id) & VIP_MODEL && !is_user_bot(id))
    {
        switch( userTeam )
        {
            case CS_TEAM_T: cs_set_user_model(id, "vip_te");
                case CS_TEAM_CT: cs_set_user_model(id, "vip_ct");
            }
    }


soumyadip77 08-06-2018 11:39

Re: [HELP] ADMIN + VIP Models
 
remove level c for admin give them other flag but if u want u can add many flags like this

PHP Code:

#define VIP_MODEL ADMIN_LEVEL_C & ADMIN_LEVEL_H
#define ADMIN_MODEL ADMIN_KICK & ADMIN_BAN 


Ghosted 08-06-2018 11:40

Re: [HELP] ADMIN + VIP Models
 
Quote:

Originally Posted by Shadowless (Post 2608614)
?

Check carefully what i changed in code.


All times are GMT -4. The time now is 12:19.

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