AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Vip plugin - midifing hp bonus and CT/TT models (https://forums.alliedmods.net/showthread.php?t=188774)

Mavefus 06-30-2012 08:23

Vip plugin - midifing hp bonus and CT/TT models
 
1 Attachment(s)
Hello.

I have a problem. Some days ago I tried to modified plugin vip, which would add bonus hp for kills to vips and vip players have different models than normal players (vip in ct has different model in tt of course).

I tried that:
PHP Code:

register_cvar("hp_for_kill" "20")
.
.
.
public 
DeathMsg()
{
    new 
hpza get_cvar_num("hp_for_kill")
    new 
kid read_data(1)  //killer
    
new hs read_data(3)   // HeadShot (1 == true)
    
    
if(is_user_connected(kid) && is_user_alive(kid) && get_user_health(kid) <= 180)
    {
        if(
hs)
            
set_user_health(kidget_user_health(kid) + hpza// HP za HS
        
else
            
set_user_health(kidget_user_health(kid) + hpza// HP za KILL
        
Display_Fade(kid,2600,2600,0,0,255,0,15

But this adding bonus hp doesn't work ;/

Hmm... ok, I don't know what's wrong, so I decided to modified the second problem, with models.

I did that:
PHP Code:

public SetPlayerModel(id)
{
    if(
cs_get_user_team(id) == CS_TEAM_T)
    {
        
cs_set_user_model(id"pbVIP_tt");
    }
    else
    {
        
cs_set_user_model(id"pbVIP_ct");
    }
    
//cs_set_user_model(id, "vip");
}

.
.
.

public 
plugin_precache(){    

    
precache_model("models/player/pbVIP_tt.mdl");
    
precache_model("models/player/pbVIP_ct.mdl"); 

And it's doesn't work too ...

Also I give you a .sma code, to look for bigger mistake, if i made.
Ohw... so I don't know, when I made a mistake in this 2 modifications. Could someone help me? I will glad if you help me :)

Thank you.


All times are GMT -4. The time now is 15:09.

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