AlliedModders

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

romi 09-28-2015 08:25

[Help] VIP model BB
 
Hello ,, i found this plugin for admin model and i want to turn it for vip vip acc = H ,, i want that vip has a speciall model when its CT but when its TT it has the normal basebuilder zombie choosen ,, help pls :
PHP Code:

#include <amxmodx>
#include <amxmisc>
#include <cstrike>

public plugin_init() {
        
register_plugin("AMX Admin Model""1.1.1""whitemike")
        
register_event("ResetHUD""resetModel""b")
        return 
PLUGIN_CONTINUE
}

public 
plugin_precache() {
        
precache_model("models/player/pgeu_ct/pgeu_ct.mdl")
        
precache_model("models/player/pgeu_t/pgeu_t.mdl")

        return 
PLUGIN_CONTINUE
}

public 
resetModel(idlevelcid) {
        if (
get_user_flags(id) & ADMIN_LEVEL_A) {
                new 
CsTeams:userTeam cs_get_user_team(id)
                if (
userTeam == CS_TEAM_T) {
                        
cs_set_user_model(id"pgeu_t")
                }
                else if(
userTeam == CS_TEAM_CT) {
                        
cs_set_user_model(id"pgeu_ct")
                }
                else {
                        
cs_reset_user_model(id)
                }
        }

        return 
PLUGIN_CONTINUE



redivcram 09-28-2015 14:49

Re: [Help] VIP model BB
 
PHP Code:

if (get_user_flags(id) & ADMIN_LEVEL_A

:arrow:

PHP Code:

if (get_user_flags(id) & ADMIN_CFG

https://wiki.alliedmods.net/Adding_Admins_(AMX_Mod_X)
If you can't remember admin flags, Search before you post...

romi 09-29-2015 09:51

Re: [Help] VIP model BB
 
Quote:

Originally Posted by redivcram (Post 2347932)
PHP Code:

if (get_user_flags(id) & ADMIN_LEVEL_A

:arrow:

PHP Code:

if (get_user_flags(id) & ADMIN_CFG

https://wiki.alliedmods.net/Adding_Admins_(AMX_Mod_X)
If you can't remember admin flags, Search before you post...

I Don't want admin level cause i can change it but i want that when be tt it be the choosen zm model cause it's a tt model !

redivcram 09-29-2015 13:39

Re: [Help] VIP model BB
 
Quote:

Originally Posted by romi (Post 2348147)
I Don't want admin level

"Vip level" is Admin Level, any custom permission group must have admin level, you want vip's access flag "h" right? ADMIN_CFG is flag "h"
Unless you wanted ADMIN_LEVEL_H ? then replace it with that...

Quote:

Originally Posted by romi (Post 2348147)
cause i can change it but i want that when be tt it be the choosen zm model cause it's a tt model !

Please speak English... You make no sense. You say that when you're tt your chosen model is a zombie for tt?

Is that what you wanted to say?

romi 10-01-2015 06:48

Re: [Help] VIP model BB
 
Man ,, i want that when a player is zm (tt) it be the normal zombie / zombie claw and not a tt model / claw model
do you got me now ?

redivcram 10-01-2015 09:54

Re: [Help] VIP model BB
 
You need to speak English if you want me to understand you
But after trying to figure out what you posted I think I got it...

Are pgeu_ct and pgeu_t default or special models?

CodingIsHard 10-01-2015 10:32

Re: [Help] VIP model BB
 
Quote:

Originally Posted by redivcram (Post 2348633)
You need to speak English if you want me to understand you
But after trying to figure out what you posted I think I got it...

Are pgeu_ct and pgeu_t default or special models?

I belive those are the "VIP models". Nevertheless hooking to ResetHUD have been over this forum for a long time, read the following thread https://forums.alliedmods.net/showthread.php?t=42159 why it isn't a good idea to hook it without defining when to.

This is what I would use.

PHP Code:


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

new const g_VipModels[][] = {

    
"models/player/pgeu_ct/pgeu_ct.mdl",
    
"models/player/pgeu_t/pgeu_t.mdl"

}

public 
plugin_init() {
    
    
register_plugin("AMX Admin Model""1.1.1""whitemike");
    
RegisterHam(Ham_Spawn"player""fwHamSpawnPlayer"1)  
    
// return PLUGIN_CONTINUE  Why?
}

public 
plugin_precache() {

    for(new 
0sizeof(g_VipModels); i++) {
        
precache_model(g_VipModels[i]);
    }

}

public 
fwHamSpawnPlayer(id) {

    
setVipModel(id);

}

public 
setVipModel(idlevelcid) {

    if(
get_user_flags(id) & ADMIN_LEVEL_A) {
        
        if(
cs_get_user_team(id) == CS_TEAM_CT) {
           
cs_set_user_model(idg_VipModels[0]);
        }
        }
   return 
PLUGIN_HANDLED;


NB! This is not tested, if it works, it works, if not, i might fix it later.
Just don't set the model to T? What you can also do is check which model the current player has, if he/she has a default model, then switch it to whatever you like, if not.. return PLUGIN_HANDLED?

redivcram 10-02-2015 12:55

Re: [Help] VIP model BB
 
But wait.. Terrors will have their default models?


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

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