Raised This Month: $51 Target: $400
 12% 

Help For Vip models


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
asdfdsdf
AlliedModders Donor
Join Date: Aug 2010
Location: Belgium
Old 12-30-2013 , 06:49   Help For Vip models
Reply With Quote #1

Hello,

I have a Zombie server with zombie plague advance on it where i also have a vip plugin on the server i know on zpa there is no such native that has zp_overrride_user_model for vip plugins like zp50 but i managed to copy the native and put it in my zpa sma file and also in the include the thing is now is there someone that can help me out with making a small code that i can use inside my vip plugin so vips have their own vip model ive tried this code http://forums.alliedmods.net/showthread.php?t=203116

this gives only the vip model when they become a sniper so it works but not like i want i want so players or either can choose in the vip menu for their own vip model or spawn with the vip model if anyone can help me with this thx in advance
asdfdsdf is offline
Catastrophe
Veteran Member
Join Date: Jul 2012
Location: somewhere between narnia
Old 12-30-2013 , 09:39   Re: Help For Vip models
Reply With Quote #2

If it doesnt work porperly..... then either the code u made is wrong or the native that u said u copied , u did it wrong somewhere....
__________________
You will find everything u need :-
Catastrophe is offline
asdfdsdf
AlliedModders Donor
Join Date: Aug 2010
Location: Belgium
Old 12-30-2013 , 14:45   Re: Help For Vip models
Reply With Quote #3

I managed to get it working but the only problem is when they choose a vip model now they have to redo it every round is it possible to when they join the server and they pick a vip model they keep it the whole map so they dont have to redo it every round only on a new map start so what do i exactly need is when they choose a vipmodel from the menu it should stay every round when new round starts now they have to open the menu again and choose the model again i will put my code what i have now from the menu

PHP Code:
public ModelMenu(iPlayer)
{
    new 
szText[555 char]
    
formatex(szTextcharsmax(szText), "\r%s \w-\yVIP \rModel Menu"g_szPrefix)
    new 
DrugMenumenu_create(szText"ModelMenuHandler")
    
    
formatex(szTextcharsmax(szText), "\wHitman \y[\rHuman\y]")
    
menu_additem(DrugMenuszText"1"0)
    
    
formatex(szTextcharsmax(szText), "\wSonic \y[\rHuman\y]")
    
menu_additem(DrugMenuszText"2"0)
    
    
formatex(szTextcharsmax(szText), "\wTerminator \y[\rZombie\y]")
    
menu_additem(DrugMenuszText"3"0)
    
    
menu_setprop(DrugMenuMPROP_EXITMEXIT_ALL)
    
menu_display(iPlayerDrugMenu0)
    
    return 
PLUGIN_HANDLED
}

public 
ModelMenuHandler(idmenuitem)
{
    if(
item == MENU_EXIT)
    {
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED
    
}
    if(!
is_user_aliveid ) )
    {
        
ColorChat(idGREY"^4%s You need to be alive to Change^4 Model"g_szVipPrefix)
        
menu_destroy(menu)
        return 
PLUGIN_HANDLED    
    
}
    
    new 
data[6], iName[64], accesscallback
    menu_item_getinfo
(menuitemaccessdatacharsmax(data), iNamecharsmax(iName), callback )
    new 
key str_to_num(data)
    
    switch(
key)
    {
        case 
1:
        {
            if(!
zp_get_user_zombie(id) && is_user_alive (id))
            {
                
zp_override_user_model(id"favip_hitman")
                
ColorChat(idGREY"%s ^3You succesfully Changed Your^4 VIP Model"g_szVipPrefix)
            }
            new 
szName[33]
            
get_user_name(idszName32)
            
ColorChat(0GREY"%s ^3%s ^4 Activated ^3His Vip Model"g_szVipPrefixszName)
            
            if(
zp_get_user_zombie(id) && is_user_alive (id))
            {
                
ColorChat(idGREY"%s You need to be a Human to choose this ^4 Model"g_szVipPrefix)
            }
                
        }
        case 
2:
        {
            if(!
zp_get_user_zombie(id) && is_user_alive (id))
            {
                
zp_override_user_model(id"favip_sonic")
                
ColorChat(idGREY"%s ^3You succesfully Changed Your^4 VIP Model"g_szVipPrefix)
            }
            new 
szName[33]
            
get_user_name(idszName32)
            
            
ColorChat(0GREY"%s ^3%s ^4 Activated ^3His Vip Model"g_szVipPrefixszName)
            if(
zp_get_user_zombie(id) && is_user_alive (id))
            {
                
ColorChat(idGREY"%s You need to be a Human to choose this ^4 Model"g_szVipPrefix)
            }
                
        }
        case 
3:
        {
            if(
zp_get_user_zombie(id) && is_user_alive (id))
            {
                
zp_override_user_model(id"favip_terminator")
                
ColorChat(idGREY"%s ^3You succesfully Changed Your^4 VIP Model"g_szVipPrefix)
            }
            new 
szName[33]
            
get_user_name(idszName32)
            
ColorChat(0GREY"%s ^3%s ^4 Activated ^3His Vip Model"g_szVipPrefixszName)
            
            if(!
zp_get_user_zombie(id) && is_user_alive (id))
            {
                
ColorChat(idGREY"%s You need to be a Zombie to choose this ^4 Model"g_szVipPrefix)
            }
        }
         }
    return 
PLUGIN_HANDLED;


Last edited by asdfdsdf; 12-30-2013 at 15:14.
asdfdsdf is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 12-30-2013 , 15:28   Re: Help For Vip models
Reply With Quote #4

Save the model the player selected (e. g. case 1: g_iModel[id] =1), hook Ham_Spawn and set the model based on the previous saved model.
__________________
Kia is offline
asdfdsdf
AlliedModders Donor
Join Date: Aug 2010
Location: Belgium
Old 12-30-2013 , 17:04   Re: Help For Vip models
Reply With Quote #5

Doesnt work i just need to know when vip chooses a model that model will get back the next round
asdfdsdf is offline
Catastrophe
Veteran Member
Join Date: Jul 2012
Location: somewhere between narnia
Old 12-31-2013 , 00:23   Re: Help For Vip models
Reply With Quote #6

follow post #4 .... its correct... better to call Ham_spawn rather than HLTV ....
__________________
You will find everything u need :-
Catastrophe is offline
asdfdsdf
AlliedModders Donor
Join Date: Aug 2010
Location: Belgium
Old 12-31-2013 , 05:14   Re: Help For Vip models
Reply With Quote #7

Can maybe someone give me an example of how i should use it with the code above i posted because i already tried it but doesnt work and im pretty noob at scripting thx in advance
asdfdsdf is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 12-31-2013 , 05:41   Re: Help For Vip models
Reply With Quote #8

Easy, but no so efficient version :

For example, in case 1: of your handler you add g_iModel[id] = 1 (declare variable first new g_iModel[33]).
Now, you hook Ham_Spawn, and at Spawn you control with switch(g_iModel[id]) which model to set, e.g. :

PHP Code:
public PlayerSpawned(id)
{
        switch(
g_iModel[id])
        {
                case 
1zp_override_user_model(id"favip_hitman"
                case 
2zp_override_user_model(id"favip_sonic"
        }

Not so easy, but more efficient version

You create a const where you hold all your models.
PHP Code:
new g_szModels[][] =
{
"models/mymodel1/mymodel1.mdl",
"models/mymodel2/mymodel2.mdl"
}

new 
g_szModelNames[g_szModels][] =
{
"mymodel1",
"mymodel2"

Then you need to precache them all using a for-Loop.
At your menu handler you simply add :
PHP Code:
g_iModel[id] = item 
Since the first model is index 0, we need to reduce 1 from the case, or if you start with case 0: you don't have to reduce anything.

Now at Ham_Spawn you simply assign the model based on Index we have.
PHP Code:
public PlayerSpawned(id)
{
        
zp_override_user_model(idg_szModelNames[g_iModel[id]])

I think it's also possible to make it without the g_szModelNames by cutting out the path from the first const.
__________________
Kia is offline
asdfdsdf
AlliedModders Donor
Join Date: Aug 2010
Location: Belgium
Old 12-31-2013 , 06:48   Re: Help For Vip models
Reply With Quote #9

Weird ive done everything you say i still need to rechoose the model each new round
asdfdsdf is offline
Kia
AlliedModders Donor
Join Date: Apr 2010
Location: In a world of madness
Old 12-31-2013 , 07:15   Re: Help For Vip models
Reply With Quote #10

What method did you use?
__________________
Kia is offline
Reply



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 02:25.


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