Raised This Month: $7 Target: $400
 1% 

top3 models need help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
aaa131
Junior Member
Join Date: May 2011
Location: Turkey
Old 01-17-2012 , 04:10   top3 models need help
Reply With Quote #1

I tried to make model for rank top1,top2 and top3 but, it didn't work good. I saw all people turned to top1's model. Can someone help me? Can make this plugin?


PHP Code:
#include <amxmodx> 
#include <cstrike> 
#include <csx> 

public plugin_init() { 
    
register_plugin("Top Model""1.0""Kakarott"
    
register_event("ResetHUD""resetModel""b"


public 
plugin_precache() { 
    
precache_model("models/player/top1/top1.mdl"
    
precache_model("models/player/top1/top1T.mdl"
    
precache_model("models/player/top2/top2.mdl"
    
precache_model("models/player/top3/top3.mdl"


public 
resetModel(id

    new 
izStats[8] = {0, ...} 
    new 
izBody[8
    new 
iRankPos 
     
    iRankPos 
get_user_stats(idizStatsizBody
     
    if (
<= iRankPos )
        
cs_set_user_model(id"top1"
    else if(
iRankPos == )
        
cs_set_user_model(id"top2"
    else if(
iRankPos == )
        
cs_set_user_model(id"top3"
    else
        return 
PLUGIN_HANDLED 
        
    
return PLUGIN_CONTINUE 

Thank you in advance...
aaa131 is offline
DarkGL
Senior Member
Join Date: Aug 2010
Location: Warsaw, Poland
Old 01-17-2012 , 09:55   Re: top3 models need help
Reply With Quote #2

Code:
if (iRankPos == 1 ) 
        cs_set_user_model(id, "top1")  
    else if(iRankPos == 2 ) 
        cs_set_user_model(id, "top2")  
    else if(iRankPos == 3 ) 
        cs_set_user_model(id, "top3")  
    else 
        return PLUGIN_HANDLED
__________________

Last edited by DarkGL; 01-17-2012 at 09:56.
DarkGL is offline
aaa131
Junior Member
Join Date: May 2011
Location: Turkey
Old 01-19-2012 , 03:11   Re: top3 models need help
Reply With Quote #3

Quote:
Originally Posted by DarkGL View Post
Code:
if (iRankPos == 1 ) 
        cs_set_user_model(id, "top1")  
    else if(iRankPos == 2 ) 
        cs_set_user_model(id, "top2")  
    else if(iRankPos == 3 ) 
        cs_set_user_model(id, "top3")  
    else 
        return PLUGIN_HANDLED
are you kidding?
aaa131 is offline
DarkGL
Senior Member
Join Date: Aug 2010
Location: Warsaw, Poland
Old 01-19-2012 , 09:05   Re: top3 models need help
Reply With Quote #4

Did you try me code ? I think no

You have 1 <= iRankPos

for example if player have pos 4 it will be

1 <= 4 it's true so he will get top1 model
__________________
DarkGL is offline
OvidiuS
Chillaxin'
Join Date: Dec 2009
Location: Serbia
Old 01-19-2012 , 10:05   Re: top3 models need help
Reply With Quote #5

try
Code:
#include <amxmodx>  
#include <cstrike>  
#include <csx>  

public plugin_init() 
{  
    register_plugin("Top Model", "1.0", "Kakarott")  
    register_event("ResetHUD", "resetModel", "b")  
}  

public plugin_precache() {  
    precache_model("models/player/top1/top1.mdl")  
    precache_model("models/player/top1/top1T.mdl")  
    precache_model("models/player/top2/top2.mdl")  
    precache_model("models/player/top3/top3.mdl")  
}  

public resetModel(id)  
{  
    new iRankPos  
      
    iRankPos = get_statsnum()   
      
    switch(iRankPos)
    {
        case 1:cs_set_user_model(id, "top1")
        case 2:cs_set_user_model(id, "top2")
        case 3:cs_set_user_model(id, "top3")
    }
}
btw avoid using cs_set_user_model because you will have a lot of reliable channel errors.
Try using set_user_info for setting player model ;)

Last edited by OvidiuS; 01-19-2012 at 10:11.
OvidiuS is offline
Send a message via Skype™ to OvidiuS
aaa131
Junior Member
Join Date: May 2011
Location: Turkey
Old 01-20-2012 , 04:01   Re: top3 models need help
Reply With Quote #6

Quote:
Originally Posted by OvidiuS View Post
try
Code:
#include <amxmodx>  
#include <cstrike>  
#include <csx>  

public plugin_init() 
{  
    register_plugin("Top Model", "1.0", "Kakarott")  
    register_event("ResetHUD", "resetModel", "b")  
}  

public plugin_precache() {  
    precache_model("models/player/top1/top1.mdl")  
    precache_model("models/player/top1/top1T.mdl")  
    precache_model("models/player/top2/top2.mdl")  
    precache_model("models/player/top3/top3.mdl")  
}  

public resetModel(id)  
{  
    new iRankPos  
      
    iRankPos = get_statsnum()   
      
    switch(iRankPos)
    {
        case 1:cs_set_user_model(id, "top1")
        case 2:cs_set_user_model(id, "top2")
        case 3:cs_set_user_model(id, "top3")
    }
}
btw avoid using cs_set_user_model because you will have a lot of reliable channel errors.
Try using set_user_info for setting player model ;)
Thanks, you are right but, I don't know how to use it is a bit confused
aaa131 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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