AlliedModders

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

oxygen935 02-10-2013 14:44

[Q]Help With ujbm
 
Hello everyone,
i want to add a vip model when the player is ct... but when is ct nothing happens, the default model...

the public player_spawn...

PHP Code:

public player_spawn(id)
{
    static 
CsTeams:team

    
if(!is_user_connected(id))
        return 
HAM_IGNORED
    
    set_pdata_float
(idm_fNextHudTextArgsGameTimeget_gametime() + 999999.0)
    
player_strip_weapons(id)
    if(
g_RoundEnd)
    {
        
g_RoundEnd 0
        g_JailDay
++
    }
    
    
set_user_rendering(idkRenderFxNone000kRenderNormal0)
    
    
set_user_footstepsid);
    
    
set_user_gravityid );    
    
    
clear_bit(g_PlayerWantedid)
    
team cs_get_user_team(id)
    
    if (!
get_bit(g_NoShowShop,id)) cmd_shop(id)
    
    
set_user_godmode(id0)
    
clear_bit(g_PlayerCrowbarid)
    
clear_bit(g_PlayerZMHandsid)
    
set_bit(g_PlayerFist,id)
    
    if(
cs_get_user_team(id) == CS_TEAM_CT && get_user_flags(id) & ADMIN_LEVEL_H)
    { 
        
cs_set_user_model(id"bond"
    }
    
    switch(
team)
    {
        case(
CS_TEAM_T):
        {
            
g_PlayerLast 0
            
if(!g_PlayerReason[id])
                
g_PlayerReason[id] = random_num(16)
            
            
player_hudmessage(id05.0, {2550255}, "%L %L"LANG_SERVER"UJBM_PRISONER_REASON",
            
LANG_SERVERg_Reasons[g_PlayerReason[id]])
            
            
            
//client_infochanged(id)
            
entity_set_int(idEV_INT_body2)
            if (
g_GameMode == 0)
            { 
                
entity_set_int(idEV_INT_skin3)
            }  else
            
/*if(get_bit(g_FreedayAuto, id))
        {            
            freeday_set(0, id)
            clear_bit(g_FreedayAuto, id)
        }
        else*/
    
{
        
entity_set_int(idEV_INT_skinrandom_num(02))
    }
    
    
            
cs_set_user_armor(id0CS_ARMOR_NONE)

}
case(
CS_TEAM_CT):
{
    
    
    
g_PlayerSimon[id]++
    
    
set_user_info(id"model""ujbm_v1")
    
entity_set_int(idEV_INT_body3)
    
cs_set_user_armor(id100CS_ARMOR_VESTHELM)
    
    new 
random_num(1,3)
    switch (
r)
    {
        case 
1:
        {
            
set_hudmessage(25500, -1.0, -1.006.06.0)
            
show_hudmessage(id"%L"LANG_SERVER"UJBM_WARN_FK")
        }
        case 
2:
        {
            
set_hudmessage(02550, -1.00.6006.06.0)
            
show_hudmessage(id"%L"LANG_SERVER"UJBM_WARN_RULES")
        }
        default:
    {
        
set_hudmessage(0212255, -1.00.8006.06.0)
        
show_hudmessage(id"%L"LANG_SERVER"UJBM_WARN_MICR")
    }
}

}
}




    if (
g_GameMode == || g_GameMode == 5)
{
    
if (
cs_get_user_team(id) == CS_TEAM_CT)
{

set_bit(g_BackToCTid)
cs_set_user_team2(idCS_TEAM_T)
}

new 
0;            
strip_user_weapons(id)
random_num(0sizeof(_WeaponsFree) - 1)    
give_item(id"weapon_knife")
give_item(id_WeaponsFree[j])
cs_set_user_bpammo(id_WeaponsFreeCSW[j], _WeaponsFreeAmmo[j])

}


    return 
HAM_IGNORED


i also tried to add this on a different plugin but again the default model... please help.... i'm an amateur on amxx scripting....

Unkolix 02-10-2013 14:47

Re: [Q]Help With ujbm
 
Have you precashed the model?
f.e.
PHP Code:

public plugin_precache() 
{
    
precache_model("models/player/adminash_ct/adminash_ct.mdl")
    
precache_model("models/player/adminash_t/adminash_t.mdl")

    return 
PLUGIN_CONTINUE



oxygen935 02-10-2013 14:48

Re: [Q]Help With ujbm
 
haha man i'm not so noob, i precashed the model...

p.s. yes exactly like that (the same folder and model name)

oxygen935 02-10-2013 14:56

Re: [Q]Help With ujbm
 
~~~ SORRy, DELETE THIS!~~

oxygen935 02-10-2013 14:57

Re: [Q]Help With ujbm
 
could i try with something like that??

PHP Code:

new vipmodel[ ]        = "models/player/bond/bond";

public 
plugin_precache()
{
        
precache_model(vipmodel)

        return 
PLUGIN_CONTINUE
}  

public 
player_spawn(id

    if(
cs_get_user_team(id) == CS_TEAM_CT && get_user_flags(id) & ADMIN_LEVEL_H
    {  
        
cs_set_user_model(idvipmodel)  
    } 



Unkolix 02-10-2013 14:58

Re: [Q]Help With ujbm
 
Don't make multiple posts!!! You can use edit button on the right top corner of your post!

oxygen935 02-10-2013 15:14

Re: [Q]Help With ujbm
 
i'm really sorry i don't think it..., but could use the mode i told with the " new vipmode[ ]" ??


All times are GMT -4. The time now is 20:40.

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