Quote:
Originally Posted by redivcram
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 i = 0; i < sizeof(g_VipModels); i++) {
precache_model(g_VipModels[i]);
}
}
public fwHamSpawnPlayer(id) {
setVipModel(id);
}
public setVipModel(id, level, cid) {
if(get_user_flags(id) & ADMIN_LEVEL_A) {
if(cs_get_user_team(id) == CS_TEAM_CT) {
cs_set_user_model(id, g_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?