AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   VIP Models Help (https://forums.alliedmods.net/showthread.php?t=206356)

zEEDu 01-21-2013 09:31

VIP Models Help
 
Yo, need some help with some stuff :)

Models:

When i'm ingame and choose ex. Mr Smith model and then if i want another one or maybe reset the model but i i can't. Neither the message appears.
Why?

PHP Code:

public ModelMenuCTid 

    new 
menu menu_create("\yVIP Menu^n\wCounter-Terrorist Models^n\d -www.Scandic-Gamers.com""HandleModelsMenuCT"
    
menu_additemmenu"Mr Smith""1"); 
    
menu_additemmenu"Master Chief""2"); 
    
menu_additemmenu"\yReset Model""3");     
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );  
    
menu_displayidmenu); 


public 
ModelMenuTid 

    new 
menu menu_create("\yVIP Menu^n\wTerrorist Models^n\d -www.Scandic-Gamers.com""HandleModelsMenuTerr"
    
menu_additemmenu"Rebel""1"); 
    
menu_additemmenu"50 Cent""2"); 
    
menu_additemmenu"\yReset Model""3"); 
    
menu_setpropmenuMPROP_EXITMEXIT_ALL );  
    
menu_displayidmenu); 



public 
HandleModelsMenuCT(idkeymenuitem) {  
   if(
is_user_alive(id))
   {   
    switch(
key)
    {
        case 
0: {
            
cs_set_user_model(id,"VIP_CT"
            
ColorChat(idBLUE"%s Selected Model loaded successfully!"prefix)
        }
        case 
1: {
            
cs_set_user_model(id,"VIP_CT2"
            
ColorChat(idBLUE"%s Selected Model loaded successfully!"prefix)
        }
        case 
2: {
            
cs_reset_user_model(id
            
ColorChat(idBLUE"%s Model resetted sucessfully!"prefix)
       }
        }
    }
    return 
PLUGIN_HANDLED


public 
HandleModelsMenuTerr(idkeymenuitem) {  
   if(
is_user_alive(id))
   {   
    switch(
key)
    {
        case 
0: {
            
cs_set_user_model(id,"VIP_T"
            
ColorChat(idRED"%s Selected Model loaded successfully!"prefix)
        }
        case 
1: {
            
cs_set_user_model(id,"VIP_T2"
            
ColorChat(idRED"%s Selected Model loaded successfully!"prefix)
        }
        case 
2: {
            
cs_reset_user_model(id
            
ColorChat(idRED"%s Model resetted sucessfully!"prefix)
       }
        }
    }
    return 
PLUGIN_HANDLED


Toggles:

I need a VIP tag in scoreboard that and so a player writes with green color (colorchat) that you can choose from a menu if you want it OFF or ON.
Ex.

1. Scoreboard Tag [ON] = Enabled & OFF = Disabled
2. Green Chat [ON] = Enabled & OFF = Disabled

How do i do this?

Thanks in advance! :)

ironskillz1 01-21-2013 14:34

Re: VIP Models Help
 
Do it like this
:)

Code:

public ModelMenuCT( id ) {
new menu = menu_create("Model:", "Model_handler")
new szTemp[32]
formatex(szTemp, charsmax(szTemp), "\yMr Smith [\r%s\y]", Model[id] ? "ON" : "OFF")
menu_additem(menu, szTemp, "1")
menu_display(id, menu)
}
public Model_handler(id, menu, item) {
    if(item == MENU_EXIT) {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }
   
    if((Model[id] = !Model[id])) {
            cs_set_user_model(id,"VIP_CT")
            ColorChat(id, BLUE, "%s Model is on", prefix)
        }
    }
    else {
            cs_reset_user_model(id)
            ColorChat(id, BLUE, "%s Model is off", prefix)
    }
    ModelMenuCT(id)
    return PLUGIN_CONTINUE
}


zEEDu 01-21-2013 14:49

Re: VIP Models Help
 
Quote:

Originally Posted by ironskillz1 (Post 1877589)
Do it like this
:)

Code:

public ModelMenuCT( id ) {
new menu = menu_create("Model:", "Model_handler")
new szTemp[32]
formatex(szTemp, charsmax(szTemp), "\yMr Smith [\r%s\y]", Model[id] ? "ON" : "OFF")
menu_additem(menu, szTemp, "1")
menu_display(id, menu)
}
public Model_handler(id, menu, item) {
    if(item == MENU_EXIT) {
        menu_destroy(menu)
        return PLUGIN_HANDLED
    }
   
    if((Model[id] = !Model[id])) {
            cs_set_user_model(id,"VIP_CT")
            ColorChat(id, BLUE, "%s Model is on", prefix)
        }
    }
    else {
            cs_reset_user_model(id)
            ColorChat(id, BLUE, "%s Model is off", prefix)
    }
    ModelMenuCT(id)
    return PLUGIN_CONTINUE
}


Thanks, but no thanks.
I don't need a on/off function, i already had that but i changed my mind.

So anyone else?

AngeIII 01-21-2013 17:06

Re: VIP Models Help
 
i think because your handler incorrect:
menu_handler(id, menu, item)
http://forums.alliedmods.net/showthread.php?t=46364

zEEDu 01-22-2013 03:12

Re: VIP Models Help
 
Quote:

Originally Posted by AngeIII (Post 1877685)
i think because your handler incorrect:
menu_handler(id, menu, item)
http://forums.alliedmods.net/showthread.php?t=46364

Oh, yeah. You're right, didn't see that, didn't even think about it :D

I'll take a look at it when i get home, i'm in school now..

zEEDu 01-22-2013 10:04

Re: VIP Models Help
 
Thanks, i got it figured out :)

But what about the other things, the greenchat and VIP tag? I don't know how to put the functions into the toggle.


All times are GMT -4. The time now is 13:44.

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