Raised This Month: $32 Target: $400
 8% 

[L4D/L4D2] Character Select Menu (2.5a/b)


Post New Thread Reply   
 
Thread Tools Display Modes
sagurux
New Member
Join Date: Feb 2015
Old 02-16-2015 , 16:20   Re: [L4D/L4D2] Character Select Menu (2.5a/b)
Reply With Quote #691

Hey DeathChaos, thanks for your hard work. I dloaded your stuff and I get the Zoey model but still have Nick's voice. I had dloaded your precompiled csc and I tried switching to Nick 1st and then Zoey but still got same results. Help please and thanks once again.

*EDIT*
Nevermind, got it to work by dloading scene processor. Thanks again, man!

Last edited by sagurux; 02-16-2015 at 17:03.
sagurux is offline
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 02-16-2015 , 19:05   Re: [L4D/L4D2] Character Select Menu (2.5a/b)
Reply With Quote #692

Quote:
Originally Posted by sagurux View Post
Hey DeathChaos, thanks for your hard work. I dloaded your stuff and I get the Zoey model but still have Nick's voice. I had dloaded your precompiled csc and I tried switching to Nick 1st and then Zoey but still got same results. Help please and thanks once again.

*EDIT*
Nevermind, got it to work by dloading scene processor. Thanks again, man!
Did you also install SendProxy?

With Send Proxy, you also get Zoey hands and Icons, and everyone will see you as Zoey, even survivor bots have the Zoey tag if used on them.
__________________
DeathChaos25 is offline
Marcus101RR
Veteran Member
Join Date: Aug 2009
Location: Tampa, FL
Old 02-20-2015 , 23:38   Re: [L4D/L4D2] Character Select Menu (2.5a/b)
Reply With Quote #693

Mind me asking what is wrong with Zoey, I have been using Zoey since csm_a and no problems.
__________________
Marcus101RR is offline
Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
Sev
Veteran Member
Join Date: May 2010
Old 02-21-2015 , 06:34   Re: [L4D/L4D2] Character Select Menu (2.5a/b)
Reply With Quote #694

If you're using Linux.

You won't have any problems with Zoey.

When they added all the mutations in that update a year or two back. Bill no longer crashed windows servers, but then Francis and Zoey did, then eventually just Zoey.

Last edited by Sev; 02-21-2015 at 06:35.
Sev is offline
Marcus101RR
Veteran Member
Join Date: Aug 2009
Location: Tampa, FL
Old 02-22-2015 , 21:21   Re: [L4D/L4D2] Character Select Menu (2.5a/b)
Reply With Quote #695

Quote:
Originally Posted by Sev View Post
If you're using Linux.

You won't have any problems with Zoey.

When they added all the mutations in that update a year or two back. Bill no longer crashed windows servers, but then Francis and Zoey did, then eventually just Zoey.
Most likely not intentional then, cause they have no idea what we source modders do.
__________________
Marcus101RR is offline
Send a message via AIM to Marcus101RR Send a message via Skype™ to Marcus101RR
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 03-20-2015 , 12:28   Re: [L4D/L4D2] Character Select Menu (2.5a/b)
Reply With Quote #696

So, to fit a request from Bazrael, which was that he wanted the bots to be renamed to their survivor names when an Admin changes their characters for easier handling in Admin menus (instead of having Louis being named, say, Coach(3) and having to guess, he will now be named Louis in the menus like he should) I have updated the plugin.

List of Plugin commands :
!z or !zoey turns your character into Zoey (Linux only, Zoey crashes on Windows)
!l or !louis turns your character into Louis
!b or !bill turns your character into Bill
!f or !francis turns your character into Francis
!n or !nick turns your character into Nick
!e or !ellis turns your character into Ellis
!r or !rochelle turns your character into Rochelle
!c or !coach turns your character into Coach
!csm brings up the character select menu
!csc (ADMINS only!) brings up a panel that allows you to change the character of any other survivor
PHP Code:
#define PLUGIN_VERSION "1.3"  
#define PLUGIN_NAME "Survivor Chat Select"  

#include <sourcemod>  
#include <sdktools>  
#define MODEL_BILL "models/survivors/survivor_namvet.mdl" 
#define MODEL_FRANCIS "models/survivors/survivor_biker.mdl" 
#define MODEL_LOUIS "models/survivors/survivor_manager.mdl" 
#define MODEL_ZOEY "models/survivors/survivor_teenangst.mdl" 

#define MODEL_NICK "models/survivors/survivor_gambler.mdl" 
#define MODEL_ROCHELLE "models/survivors/survivor_producer.mdl" 
#define MODEL_COACH "models/survivors/survivor_coach.mdl" 
#define MODEL_ELLIS "models/survivors/survivor_mechanic.mdl" 

#define     NICK     0 
#define     ROCHELLE    1 
#define     COACH     2 
#define     ELLIS     3 
#define     BILL     4 
#define     ZOEY     5 
#define     FRANCIS     6 
#define     LOUIS     7 

static g_iSelectedClient 
static bool:g_bAdminsOnly 

public Plugin:myinfo =  
{  
    
name PLUGIN_NAME,  
    
author "DeatChaos25 & Mi123456",  
    
description "Select a survivor character by typing their name into the chat.",  
    
version PLUGIN_VERSION,  
}  

public 
OnPluginStart()  
{  
    
RegConsoleCmd("sm_zoey"ZoeyUse"Changes your survivor character into Zoey");  
    
RegConsoleCmd("sm_nick"NickUse"Changes your survivor character into Nick");  
    
RegConsoleCmd("sm_ellis"EllisUse"Changes your survivor character into Ellis");  
    
RegConsoleCmd("sm_coach"CoachUse"Changes your survivor character into Coach");  
    
RegConsoleCmd("sm_rochelle"RochelleUse"Changes your survivor character into Rochelle");  
    
RegConsoleCmd("sm_bill"BillUse"Changes your survivor character into Bill");  
    
RegConsoleCmd("sm_francis"BikerUse"Changes your survivor character into Francis");  
    
RegConsoleCmd("sm_louis"LouisUse"Changes your survivor character into Louis");  
    
    
RegConsoleCmd("sm_z"ZoeyUse"Changes your survivor character into Zoey");  
    
RegConsoleCmd("sm_n"NickUse"Changes your survivor character into Nick");  
    
RegConsoleCmd("sm_e"EllisUse"Changes your survivor character into Ellis");  
    
RegConsoleCmd("sm_c"CoachUse"Changes your survivor character into Coach");  
    
RegConsoleCmd("sm_r"RochelleUse"Changes your survivor character into Rochelle");  
    
RegConsoleCmd("sm_b"BillUse"Changes your survivor character into Bill");  
    
RegConsoleCmd("sm_f"BikerUse"Changes your survivor character into Francis");  
    
RegConsoleCmd("sm_l"LouisUse"Changes your survivor character into Louis");  
    
    
RegAdminCmd("sm_csc"InitiateMenuAdminADMFLAG_GENERIC"Brings up a menu to select a client's character"); 
    
RegConsoleCmd("sm_csm"ShowMenu"Brings up a menu to select a client's character"); 
    
    new 
Handle:AdminsOnly CreateConVar("l4d_csm_admins_only""1","Changes access to the sm_csm command. 1 = Admin access only.",FCVAR_PLUGIN|FCVAR_SPONLY,true0.0true1.0);
    
g_bAdminsOnly GetConVarBool(AdminsOnly);
    
HookConVarChange(AdminsOnly_ConVarChange__AdminsOnly);
    
    
AutoExecConfig(true"l4dscs")
}  


public 
Action:ZoeyUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"ZOEY);  
    
SetEntityModel(clientMODEL_ZOEY);  
    if (
IsFakeClient(client))
    {
        
SetClientInfo(client"name""Zoey");
    }
}  

public 
Action:NickUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"NICK);  
    
SetEntityModel(clientMODEL_NICK);  
    if (
IsFakeClient(client))
    {
        
SetClientInfo(client"name""Nick");
    }
}  

public 
Action:EllisUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"ELLIS);  
    
SetEntityModel(clientMODEL_ELLIS);  
    if (
IsFakeClient(client))
    {
        
SetClientInfo(client"name""Ellis");
    }
}  

public 
Action:CoachUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"COACH);  
    
SetEntityModel(clientMODEL_COACH);  
    if (
IsFakeClient(client))
    {
        
SetClientInfo(client"name""Coach");
    }
}  

public 
Action:RochelleUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"ROCHELLE);  
    
SetEntityModel(clientMODEL_ROCHELLE);  
    if (
IsFakeClient(client))
    {
        
SetClientInfo(client"name""Rochelle");
    }
}  

public 
Action:BillUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"BILL);  
    
SetEntityModel(clientMODEL_BILL);  
    if (
IsFakeClient(client))
    {
        
SetClientInfo(client"name""Bill");
    }
}  

public 
Action:BikerUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"FRANCIS);  
    
SetEntityModel(clientMODEL_FRANCIS);  
    if (
IsFakeClient(client))
    {
        
SetClientInfo(client"name""Francis");
    }
}  

public 
Action:LouisUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"LOUIS);  
    
SetEntityModel(clientMODEL_LOUIS);  
    if (
IsFakeClient(client))
    {
        
SetClientInfo(client"name""Louis");
    }
}  

public 
OnMapStart() 
{     
    
SetConVarInt(FindConVar("precache_all_survivors"), 1); 
    
    if (!
IsModelPrecached("models/survivors/survivor_teenangst.mdl"))    PrecacheModel("models/survivors/survivor_teenangst.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_biker.mdl"))     PrecacheModel("models/survivors/survivor_biker.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_manager.mdl"))    PrecacheModel("models/survivors/survivor_manager.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_namvet.mdl"))     PrecacheModel("models/survivors/survivor_namvet.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_gambler.mdl"))    PrecacheModel("models/survivors/survivor_gambler.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_coach.mdl"))     PrecacheModel("models/survivors/survivor_coach.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_mechanic.mdl"))    PrecacheModel("models/survivors/survivor_mechanic.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_producer.mdl"))     PrecacheModel("models/survivors/survivor_producer.mdl"false); 


/* This Admin Menu was taken from csm, all credits go to Mi123645 */ 
public Action:InitiateMenuAdmin(clientargs)  

    if (
client == 0)  
    { 
        
ReplyToCommand(client"Menu is in-game only."); 
        return; 
    } 
    
    
decl String:name[MAX_NAME_LENGTH], String:number[10]; 
    
    new 
Handle:menu CreateMenu(ShowMenu2); 
    
SetMenuTitle(menu"Select a client:"); 
    
    for (new 
1<= MaxClientsi++) 
    { 
        if (!
IsClientInGame(i)) continue; 
        if (
GetClientTeam(i) != 2) continue; 
        if (
== client) continue; 
        
        
Format(namesizeof(name), "%N"i); 
        
Format(numbersizeof(number), "%i"i); 
        
AddMenuItem(menunumbername); 
    } 
    
    
    
SetMenuExitButton(menutrue); 
    
DisplayMenu(menuclientMENU_TIME_FOREVER); 


public 
ShowMenu2(Handle:menuMenuAction:actionparam1param2)  

    switch (
action)  
    { 
        case 
MenuAction_Select:  
        { 
            
decl String:number[4]; 
            
GetMenuItem(menuparam2numbersizeof(number)); 
            
            
g_iSelectedClient StringToInt(number); 
            
            new 
args
            
ShowMenuAdmin(param1args); 
        } 
        case 
MenuAction_Cancel
        { 
            
        } 
        case 
MenuAction_End:  
        { 
            
CloseHandle(menu); 
        } 
    } 


public 
Action:ShowMenuAdmin(clientargs)  

    
decl String:sMenuEntry[8]; 
    
    new 
Handle:menu CreateMenu(CharMenuAdmin); 
    
SetMenuTitle(menu"Choose a character:"); 
    
    
    
IntToString(NICKsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Nick"); 
    
IntToString(ROCHELLEsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Rochelle"); 
    
IntToString(COACHsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Coach"); 
    
IntToString(ELLISsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Ellis"); 
    
    
IntToString(BILLsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Bill");     
    
IntToString(ZOEYsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Zoey"); 
    
IntToString(FRANCISsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Francis"); 
    
IntToString(LOUISsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Louis"); 
    
    
SetMenuExitButton(menutrue); 
    
DisplayMenu(menuclientMENU_TIME_FOREVER); 


public 
CharMenuAdmin(Handle:menuMenuAction:actionparam1param2)  

    switch (
action)  
    { 
        case 
MenuAction_Select:  
        { 
            
decl String:item[8]; 
            
GetMenuItem(menuparam2itemsizeof(item)); 
            
            switch(
StringToInt(item))  
            { 
                case 
NICK:        {    NickUse(g_iSelectedClientNICK);        }  
                case 
ROCHELLE:    {    RochelleUse(g_iSelectedClientROCHELLE);    }  
                case 
COACH:        {    CoachUse(g_iSelectedClientCOACH);        }  
                case 
ELLIS:        {    EllisUse(g_iSelectedClientELLIS);        }  
                case 
BILL:        {    BillUse(g_iSelectedClientBILL);        }  
                case 
ZOEY:        {    ZoeyUse(g_iSelectedClientZOEY);        }  
                case 
FRANCIS:    {    BikerUse(g_iSelectedClientFRANCIS);    }  
                case 
LOUIS:        {    LouisUse(g_iSelectedClientLOUIS);        }  
                
            } 
        } 
        case 
MenuAction_Cancel
        { 
            
        } 
        case 
MenuAction_End:  
        { 
            
CloseHandle(menu); 
        } 
    } 


public 
Action:ShowMenu(clientargs
{
    if (
client == 0
    {
        
ReplyToCommand(client"[CSM] Character Select Menu is in-game only.");
        return;
    }
    if (
GetClientTeam(client) != 2)
    {
        
ReplyToCommand(client"[CSM] Character Select Menu is only available to survivors.");
        return;
    }
    if (!
IsPlayerAlive(client)) 
    {
        
ReplyToCommand(client"[CSM] You must be alive to use the Character Select Menu!");
        return;
    }
    if (
GetUserFlagBits(client) == && g_bAdminsOnly)
    {
        
ReplyToCommand(client"[CSM] Character Select Menu is only available to admins.");
        return;
    }
    
decl String:sMenuEntry[8];
    
    new 
Handle:menu CreateMenu(CharMenu);
    
SetMenuTitle(menu"Choose a character:");
    
    
    
IntToString(NICKsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Nick");
    
IntToString(ROCHELLEsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Rochelle");
    
IntToString(COACHsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Coach");
    
IntToString(ELLISsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Ellis");
    
    
IntToString(BILLsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Bill");    
    
IntToString(ZOEYsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Zoey");
    
IntToString(FRANCISsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Francis");
    
IntToString(LOUISsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Louis");
    
    
SetMenuExitButton(menutrue);
    
DisplayMenu(menuclientMENU_TIME_FOREVER);
}


public 
CharMenu(Handle:menuMenuAction:actionparam1param2
{
    switch (
action
    {
        case 
MenuAction_Select
        {
            
decl String:item[8];
            
GetMenuItem(menuparam2itemsizeof(item));
            
            switch(
StringToInt(item)) 
            {
                case 
NICK:        {    NickUse(param1NICK);        }
                case 
ROCHELLE:    {    RochelleUse(param1ROCHELLE);    }
                case 
COACH:        {    CoachUse(param1COACH);        }
                case 
ELLIS:        {    EllisUse(param1ELLIS);        }
                case 
BILL:        {    BillUse(param1BILL);        }
                case 
ZOEY:        {    ZoeyUse(param1ZOEY);        }
                case 
FRANCIS:    {    BikerUse(param1FRANCIS);    }
                case 
LOUIS:        {    LouisUse(param1LOUIS);        }
                
            }
        }
        case 
MenuAction_Cancel:
        {
            
        }
        case 
MenuAction_End
        {
            
CloseHandle(menu);
        }
    }
}

public 
_ConVarChange__AdminsOnly(Handle:convar, const String:oldValue[], const String:newValue[]) 
{
    
g_bAdminsOnly GetConVarBool(convar);
}    

/* Credits to Machine for this stock bool ;p*/
stock bool:IsSurvivor(client)
{
    if (
client && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2)
    {
        return 
true;
    }
    return 
false;

THIS IS FOR LINUX ONLY!
I'll upload a windows version later.
Attached Files
File Type: smx survivor_chat_select.smx (7.7 KB, 619 views)
__________________

Last edited by DeathChaos25; 03-20-2015 at 12:30.
DeathChaos25 is offline
winged_box
Senior Member
Join Date: Aug 2013
Location: Singapore
Old 04-12-2015 , 03:36   Re: [L4D/L4D2] Character Select Menu (2.5a/b)
Reply With Quote #697

Quote:
Originally Posted by DeathChaos25 View Post
So, to fit a request from Bazrael, which was that he wanted the bots to be renamed to their survivor names when an Admin changes their characters for easier handling in Admin menus (instead of having Louis being named, say, Coach(3) and having to guess, he will now be named Louis in the menus like he should) I have updated the plugin.

List of Plugin commands :
!z or !zoey turns your character into Zoey (Linux only, Zoey crashes on Windows)
!l or !louis turns your character into Louis
!b or !bill turns your character into Bill
!f or !francis turns your character into Francis
!n or !nick turns your character into Nick
!e or !ellis turns your character into Ellis
!r or !rochelle turns your character into Rochelle
!c or !coach turns your character into Coach
!csm brings up the character select menu
!csc (ADMINS only!) brings up a panel that allows you to change the character of any other survivor
PHP Code:
#define PLUGIN_VERSION "1.3"  
#define PLUGIN_NAME "Survivor Chat Select"  

#include <sourcemod>  
#include <sdktools>  
#define MODEL_BILL "models/survivors/survivor_namvet.mdl" 
#define MODEL_FRANCIS "models/survivors/survivor_biker.mdl" 
#define MODEL_LOUIS "models/survivors/survivor_manager.mdl" 
#define MODEL_ZOEY "models/survivors/survivor_teenangst.mdl" 

#define MODEL_NICK "models/survivors/survivor_gambler.mdl" 
#define MODEL_ROCHELLE "models/survivors/survivor_producer.mdl" 
#define MODEL_COACH "models/survivors/survivor_coach.mdl" 
#define MODEL_ELLIS "models/survivors/survivor_mechanic.mdl" 

#define     NICK     0 
#define     ROCHELLE    1 
#define     COACH     2 
#define     ELLIS     3 
#define     BILL     4 
#define     ZOEY     5 
#define     FRANCIS     6 
#define     LOUIS     7 

static g_iSelectedClient 
static bool:g_bAdminsOnly 

public Plugin:myinfo =  
{  
    
name PLUGIN_NAME,  
    
author "DeatChaos25 & Mi123456",  
    
description "Select a survivor character by typing their name into the chat.",  
    
version PLUGIN_VERSION,  
}  

public 
OnPluginStart()  
{  
    
RegConsoleCmd("sm_zoey"ZoeyUse"Changes your survivor character into Zoey");  
    
RegConsoleCmd("sm_nick"NickUse"Changes your survivor character into Nick");  
    
RegConsoleCmd("sm_ellis"EllisUse"Changes your survivor character into Ellis");  
    
RegConsoleCmd("sm_coach"CoachUse"Changes your survivor character into Coach");  
    
RegConsoleCmd("sm_rochelle"RochelleUse"Changes your survivor character into Rochelle");  
    
RegConsoleCmd("sm_bill"BillUse"Changes your survivor character into Bill");  
    
RegConsoleCmd("sm_francis"BikerUse"Changes your survivor character into Francis");  
    
RegConsoleCmd("sm_louis"LouisUse"Changes your survivor character into Louis");  
    
    
RegConsoleCmd("sm_z"ZoeyUse"Changes your survivor character into Zoey");  
    
RegConsoleCmd("sm_n"NickUse"Changes your survivor character into Nick");  
    
RegConsoleCmd("sm_e"EllisUse"Changes your survivor character into Ellis");  
    
RegConsoleCmd("sm_c"CoachUse"Changes your survivor character into Coach");  
    
RegConsoleCmd("sm_r"RochelleUse"Changes your survivor character into Rochelle");  
    
RegConsoleCmd("sm_b"BillUse"Changes your survivor character into Bill");  
    
RegConsoleCmd("sm_f"BikerUse"Changes your survivor character into Francis");  
    
RegConsoleCmd("sm_l"LouisUse"Changes your survivor character into Louis");  
    
    
RegAdminCmd("sm_csc"InitiateMenuAdminADMFLAG_GENERIC"Brings up a menu to select a client's character"); 
    
RegConsoleCmd("sm_csm"ShowMenu"Brings up a menu to select a client's character"); 
    
    new 
Handle:AdminsOnly CreateConVar("l4d_csm_admins_only""1","Changes access to the sm_csm command. 1 = Admin access only.",FCVAR_PLUGIN|FCVAR_SPONLY,true0.0true1.0);
    
g_bAdminsOnly GetConVarBool(AdminsOnly);
    
HookConVarChange(AdminsOnly_ConVarChange__AdminsOnly);
    
    
AutoExecConfig(true"l4dscs")
}  


public 
Action:ZoeyUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"ZOEY);  
    
SetEntityModel(clientMODEL_ZOEY);  
    if (
IsFakeClient(client))
    {
        
SetClientInfo(client"name""Zoey");
    }
}  

public 
Action:NickUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"NICK);  
    
SetEntityModel(clientMODEL_NICK);  
    if (
IsFakeClient(client))
    {
        
SetClientInfo(client"name""Nick");
    }
}  

public 
Action:EllisUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"ELLIS);  
    
SetEntityModel(clientMODEL_ELLIS);  
    if (
IsFakeClient(client))
    {
        
SetClientInfo(client"name""Ellis");
    }
}  

public 
Action:CoachUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"COACH);  
    
SetEntityModel(clientMODEL_COACH);  
    if (
IsFakeClient(client))
    {
        
SetClientInfo(client"name""Coach");
    }
}  

public 
Action:RochelleUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"ROCHELLE);  
    
SetEntityModel(clientMODEL_ROCHELLE);  
    if (
IsFakeClient(client))
    {
        
SetClientInfo(client"name""Rochelle");
    }
}  

public 
Action:BillUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"BILL);  
    
SetEntityModel(clientMODEL_BILL);  
    if (
IsFakeClient(client))
    {
        
SetClientInfo(client"name""Bill");
    }
}  

public 
Action:BikerUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"FRANCIS);  
    
SetEntityModel(clientMODEL_FRANCIS);  
    if (
IsFakeClient(client))
    {
        
SetClientInfo(client"name""Francis");
    }
}  

public 
Action:LouisUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"LOUIS);  
    
SetEntityModel(clientMODEL_LOUIS);  
    if (
IsFakeClient(client))
    {
        
SetClientInfo(client"name""Louis");
    }
}  

public 
OnMapStart() 
{     
    
SetConVarInt(FindConVar("precache_all_survivors"), 1); 
    
    if (!
IsModelPrecached("models/survivors/survivor_teenangst.mdl"))    PrecacheModel("models/survivors/survivor_teenangst.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_biker.mdl"))     PrecacheModel("models/survivors/survivor_biker.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_manager.mdl"))    PrecacheModel("models/survivors/survivor_manager.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_namvet.mdl"))     PrecacheModel("models/survivors/survivor_namvet.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_gambler.mdl"))    PrecacheModel("models/survivors/survivor_gambler.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_coach.mdl"))     PrecacheModel("models/survivors/survivor_coach.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_mechanic.mdl"))    PrecacheModel("models/survivors/survivor_mechanic.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_producer.mdl"))     PrecacheModel("models/survivors/survivor_producer.mdl"false); 


/* This Admin Menu was taken from csm, all credits go to Mi123645 */ 
public Action:InitiateMenuAdmin(clientargs)  

    if (
client == 0)  
    { 
        
ReplyToCommand(client"Menu is in-game only."); 
        return; 
    } 
    
    
decl String:name[MAX_NAME_LENGTH], String:number[10]; 
    
    new 
Handle:menu CreateMenu(ShowMenu2); 
    
SetMenuTitle(menu"Select a client:"); 
    
    for (new 
1<= MaxClientsi++) 
    { 
        if (!
IsClientInGame(i)) continue; 
        if (
GetClientTeam(i) != 2) continue; 
        if (
== client) continue; 
        
        
Format(namesizeof(name), "%N"i); 
        
Format(numbersizeof(number), "%i"i); 
        
AddMenuItem(menunumbername); 
    } 
    
    
    
SetMenuExitButton(menutrue); 
    
DisplayMenu(menuclientMENU_TIME_FOREVER); 


public 
ShowMenu2(Handle:menuMenuAction:actionparam1param2)  

    switch (
action)  
    { 
        case 
MenuAction_Select:  
        { 
            
decl String:number[4]; 
            
GetMenuItem(menuparam2numbersizeof(number)); 
            
            
g_iSelectedClient StringToInt(number); 
            
            new 
args
            
ShowMenuAdmin(param1args); 
        } 
        case 
MenuAction_Cancel
        { 
            
        } 
        case 
MenuAction_End:  
        { 
            
CloseHandle(menu); 
        } 
    } 


public 
Action:ShowMenuAdmin(clientargs)  

    
decl String:sMenuEntry[8]; 
    
    new 
Handle:menu CreateMenu(CharMenuAdmin); 
    
SetMenuTitle(menu"Choose a character:"); 
    
    
    
IntToString(NICKsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Nick"); 
    
IntToString(ROCHELLEsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Rochelle"); 
    
IntToString(COACHsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Coach"); 
    
IntToString(ELLISsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Ellis"); 
    
    
IntToString(BILLsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Bill");     
    
IntToString(ZOEYsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Zoey"); 
    
IntToString(FRANCISsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Francis"); 
    
IntToString(LOUISsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Louis"); 
    
    
SetMenuExitButton(menutrue); 
    
DisplayMenu(menuclientMENU_TIME_FOREVER); 


public 
CharMenuAdmin(Handle:menuMenuAction:actionparam1param2)  

    switch (
action)  
    { 
        case 
MenuAction_Select:  
        { 
            
decl String:item[8]; 
            
GetMenuItem(menuparam2itemsizeof(item)); 
            
            switch(
StringToInt(item))  
            { 
                case 
NICK:        {    NickUse(g_iSelectedClientNICK);        }  
                case 
ROCHELLE:    {    RochelleUse(g_iSelectedClientROCHELLE);    }  
                case 
COACH:        {    CoachUse(g_iSelectedClientCOACH);        }  
                case 
ELLIS:        {    EllisUse(g_iSelectedClientELLIS);        }  
                case 
BILL:        {    BillUse(g_iSelectedClientBILL);        }  
                case 
ZOEY:        {    ZoeyUse(g_iSelectedClientZOEY);        }  
                case 
FRANCIS:    {    BikerUse(g_iSelectedClientFRANCIS);    }  
                case 
LOUIS:        {    LouisUse(g_iSelectedClientLOUIS);        }  
                
            } 
        } 
        case 
MenuAction_Cancel
        { 
            
        } 
        case 
MenuAction_End:  
        { 
            
CloseHandle(menu); 
        } 
    } 


public 
Action:ShowMenu(clientargs
{
    if (
client == 0
    {
        
ReplyToCommand(client"[CSM] Character Select Menu is in-game only.");
        return;
    }
    if (
GetClientTeam(client) != 2)
    {
        
ReplyToCommand(client"[CSM] Character Select Menu is only available to survivors.");
        return;
    }
    if (!
IsPlayerAlive(client)) 
    {
        
ReplyToCommand(client"[CSM] You must be alive to use the Character Select Menu!");
        return;
    }
    if (
GetUserFlagBits(client) == && g_bAdminsOnly)
    {
        
ReplyToCommand(client"[CSM] Character Select Menu is only available to admins.");
        return;
    }
    
decl String:sMenuEntry[8];
    
    new 
Handle:menu CreateMenu(CharMenu);
    
SetMenuTitle(menu"Choose a character:");
    
    
    
IntToString(NICKsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Nick");
    
IntToString(ROCHELLEsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Rochelle");
    
IntToString(COACHsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Coach");
    
IntToString(ELLISsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Ellis");
    
    
IntToString(BILLsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Bill");    
    
IntToString(ZOEYsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Zoey");
    
IntToString(FRANCISsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Francis");
    
IntToString(LOUISsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Louis");
    
    
SetMenuExitButton(menutrue);
    
DisplayMenu(menuclientMENU_TIME_FOREVER);
}


public 
CharMenu(Handle:menuMenuAction:actionparam1param2
{
    switch (
action
    {
        case 
MenuAction_Select
        {
            
decl String:item[8];
            
GetMenuItem(menuparam2itemsizeof(item));
            
            switch(
StringToInt(item)) 
            {
                case 
NICK:        {    NickUse(param1NICK);        }
                case 
ROCHELLE:    {    RochelleUse(param1ROCHELLE);    }
                case 
COACH:        {    CoachUse(param1COACH);        }
                case 
ELLIS:        {    EllisUse(param1ELLIS);        }
                case 
BILL:        {    BillUse(param1BILL);        }
                case 
ZOEY:        {    ZoeyUse(param1ZOEY);        }
                case 
FRANCIS:    {    BikerUse(param1FRANCIS);    }
                case 
LOUIS:        {    LouisUse(param1LOUIS);        }
                
            }
        }
        case 
MenuAction_Cancel:
        {
            
        }
        case 
MenuAction_End
        {
            
CloseHandle(menu);
        }
    }
}

public 
_ConVarChange__AdminsOnly(Handle:convar, const String:oldValue[], const String:newValue[]) 
{
    
g_bAdminsOnly GetConVarBool(convar);
}    

/* Credits to Machine for this stock bool ;p*/
stock bool:IsSurvivor(client)
{
    if (
client && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2)
    {
        return 
true;
    }
    return 
false;

THIS IS FOR LINUX ONLY!
I'll upload a windows version later.
Hi, It works well in L4D2 campaign but I can't change to Rochelle when playing L4D1 campaign.

UPDATE: Sorry, it works now ^_^.

Is there a way to change the character icon as well? Now it's just the model that changed.

Last edited by winged_box; 04-12-2015 at 03:42.
winged_box is offline
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 04-12-2015 , 10:21   Re: [L4D/L4D2] Character Select Menu (2.5a/b)
Reply With Quote #698

If you want L4D2 survivors in L4D1 campaigns, I made a post explaining how to do so in the FakeZoey thread.
Do note that in L4D1 campaigns the L4D2 survivors don't have their arms/icons loaded, so Rochelle will have Zoey arms/icons, Nick has Bill arms/icons, etc
__________________
DeathChaos25 is offline
Krufftys Killers
Senior Member
Join Date: Jan 2014
Old 04-13-2015 , 18:35   Re: [L4D/L4D2] Character Select Menu (2.5a/b)
Reply With Quote #699

Quote:
Originally Posted by DeathChaos25 View Post
I admit this was a very big oversight on my part, as I never bothered to code in a check to see if the client is in the survivor team.

But that's dealt with and fixed now, updated the plugin, the commands are only availible to survivors now.

PHP Code:
#define PLUGIN_VERSION "1.3"  
#define PLUGIN_NAME "Survivor Chat Select"  

#include <sourcemod>  
#include <sdktools>  

#define MODEL_BILL "models/survivors/survivor_namvet.mdl" 
#define MODEL_FRANCIS "models/survivors/survivor_biker.mdl" 
#define MODEL_LOUIS "models/survivors/survivor_manager.mdl" 
#define MODEL_ZOEY "models/survivors/survivor_teenangst.mdl" 

#define MODEL_NICK "models/survivors/survivor_gambler.mdl" 
#define MODEL_ROCHELLE "models/survivors/survivor_producer.mdl" 
#define MODEL_COACH "models/survivors/survivor_coach.mdl" 
#define MODEL_ELLIS "models/survivors/survivor_mechanic.mdl" 

#define     NICK     0 
#define     ROCHELLE    1 
#define     COACH     2 
#define     ELLIS     3 
#define     BILL     4 
#define     ZOEY     5 
#define     FRANCIS     6 
#define     LOUIS     7 

static g_iSelectedClient 
static bool:g_bAdminsOnly 

public Plugin:myinfo =  
{  
    
name PLUGIN_NAME,  
    
author "DeatChaos25 & Mi123456",  
    
description "Select a survivor character by typing their name into the chat.",  
    
version PLUGIN_VERSION,  
}  

public 
OnPluginStart()  
{  
    
RegConsoleCmd("sm_zoey"ZoeyUse"Changes your survivor character into Zoey");  
    
RegConsoleCmd("sm_nick"NickUse"Changes your survivor character into Nick");  
    
RegConsoleCmd("sm_ellis"EllisUse"Changes your survivor character into Ellis");  
    
RegConsoleCmd("sm_coach"CoachUse"Changes your survivor character into Coach");  
    
RegConsoleCmd("sm_rochelle"RochelleUse"Changes your survivor character into Rochelle");  
    
RegConsoleCmd("sm_bill"BillUse"Changes your survivor character into Bill");  
    
RegConsoleCmd("sm_francis"BikerUse"Changes your survivor character into Francis");  
    
RegConsoleCmd("sm_louis"LouisUse"Changes your survivor character into Louis");  
    
    
RegConsoleCmd("sm_z"ZoeyUse"Changes your survivor character into Zoey");  
    
RegConsoleCmd("sm_n"NickUse"Changes your survivor character into Nick");  
    
RegConsoleCmd("sm_e"EllisUse"Changes your survivor character into Ellis");  
    
RegConsoleCmd("sm_c"CoachUse"Changes your survivor character into Coach");  
    
RegConsoleCmd("sm_r"RochelleUse"Changes your survivor character into Rochelle");  
    
RegConsoleCmd("sm_b"BillUse"Changes your survivor character into Bill");  
    
RegConsoleCmd("sm_f"BikerUse"Changes your survivor character into Francis");  
    
RegConsoleCmd("sm_l"LouisUse"Changes your survivor character into Louis");  
    
    
RegAdminCmd("sm_csc"InitiateMenuAdminADMFLAG_GENERIC"Brings up a menu to select a client's character"); 
    
RegConsoleCmd("sm_csm"ShowMenu"Brings up a menu to select a client's character"); 
    
    new 
Handle:AdminsOnly CreateConVar("l4d_csm_admins_only""1","Changes access to the sm_csm command. 1 = Admin access only.",FCVAR_PLUGIN|FCVAR_SPONLY,true0.0true1.0);
    
g_bAdminsOnly GetConVarBool(AdminsOnly);
    
HookConVarChange(AdminsOnly_ConVarChange__AdminsOnly);
    
    
AutoExecConfig(true"l4dscs")
}  


public 
Action:ZoeyUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"ZOEY);  
    
SetEntityModel(clientMODEL_ZOEY);  
}  

public 
Action:NickUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"NICK);  
    
SetEntityModel(clientMODEL_NICK);  
}  

public 
Action:EllisUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"ELLIS);  
    
SetEntityModel(clientMODEL_ELLIS);  
}  

public 
Action:CoachUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"COACH);  
    
SetEntityModel(clientMODEL_COACH);  
}  

public 
Action:RochelleUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"ROCHELLE);  
    
SetEntityModel(clientMODEL_ROCHELLE);  
}  

public 
Action:BillUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"BILL);  
    
SetEntityModel(clientMODEL_BILL);  
}  

public 
Action:BikerUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"FRANCIS);  
    
SetEntityModel(clientMODEL_FRANCIS);  
}  

public 
Action:LouisUse(clientargs)  
{  
    if (!
IsSurvivor(client)){
        
PrintToChat(client"You must be in the survivor team to use this command!")
        return
    }
    
SetEntProp(clientProp_Send"m_survivorCharacter"LOUIS);  
    
SetEntityModel(clientMODEL_LOUIS);  
}  

public 
OnMapStart() 
{     
    
SetConVarInt(FindConVar("precache_all_survivors"), 1); 
    
    if (!
IsModelPrecached("models/survivors/survivor_teenangst.mdl"))    PrecacheModel("models/survivors/survivor_teenangst.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_biker.mdl"))     PrecacheModel("models/survivors/survivor_biker.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_manager.mdl"))    PrecacheModel("models/survivors/survivor_manager.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_namvet.mdl"))     PrecacheModel("models/survivors/survivor_namvet.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_gambler.mdl"))    PrecacheModel("models/survivors/survivor_gambler.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_coach.mdl"))     PrecacheModel("models/survivors/survivor_coach.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_mechanic.mdl"))    PrecacheModel("models/survivors/survivor_mechanic.mdl"false); 
    if (!
IsModelPrecached("models/survivors/survivor_producer.mdl"))     PrecacheModel("models/survivors/survivor_producer.mdl"false); 


/* This Admin Menu was taken from csm, all credits go to Mi123645 */ 
public Action:InitiateMenuAdmin(clientargs)  

    if (
client == 0)  
    { 
        
ReplyToCommand(client"Menu is in-game only."); 
        return; 
    } 
    
    
decl String:name[MAX_NAME_LENGTH], String:number[10]; 
    
    new 
Handle:menu CreateMenu(ShowMenu2); 
    
SetMenuTitle(menu"Select a client:"); 
    
    for (new 
1<= MaxClientsi++) 
    { 
        if (!
IsClientInGame(i)) continue; 
        if (
GetClientTeam(i) != 2) continue; 
        if (
== client) continue; 
        
        
Format(namesizeof(name), "%N"i); 
        
Format(numbersizeof(number), "%i"i); 
        
AddMenuItem(menunumbername); 
    } 
    
    
    
SetMenuExitButton(menutrue); 
    
DisplayMenu(menuclientMENU_TIME_FOREVER); 


public 
ShowMenu2(Handle:menuMenuAction:actionparam1param2)  

    switch (
action)  
    { 
        case 
MenuAction_Select:  
        { 
            
decl String:number[4]; 
            
GetMenuItem(menuparam2numbersizeof(number)); 
            
            
g_iSelectedClient StringToInt(number); 
            
            new 
args
            
ShowMenuAdmin(param1args); 
        } 
        case 
MenuAction_Cancel
        { 
            
        } 
        case 
MenuAction_End:  
        { 
            
CloseHandle(menu); 
        } 
    } 


public 
Action:ShowMenuAdmin(clientargs)  

    
decl String:sMenuEntry[8]; 
    
    new 
Handle:menu CreateMenu(CharMenuAdmin); 
    
SetMenuTitle(menu"Choose a character:"); 
    
    
    
IntToString(NICKsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Nick"); 
    
IntToString(ROCHELLEsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Rochelle"); 
    
IntToString(COACHsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Coach"); 
    
IntToString(ELLISsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Ellis"); 
    
    
IntToString(BILLsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Bill");     
    
IntToString(ZOEYsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Zoey"); 
    
IntToString(FRANCISsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Francis"); 
    
IntToString(LOUISsMenuEntrysizeof(sMenuEntry)); 
    
AddMenuItem(menusMenuEntry"Louis"); 
    
    
SetMenuExitButton(menutrue); 
    
DisplayMenu(menuclientMENU_TIME_FOREVER); 


public 
CharMenuAdmin(Handle:menuMenuAction:actionparam1param2)  

    switch (
action)  
    { 
        case 
MenuAction_Select:  
        { 
            
decl String:item[8]; 
            
GetMenuItem(menuparam2itemsizeof(item)); 
            
            switch(
StringToInt(item))  
            { 
                case 
NICK:        {    NickUse(g_iSelectedClientNICK);        }  
                case 
ROCHELLE:    {    RochelleUse(g_iSelectedClientROCHELLE);    }  
                case 
COACH:        {    CoachUse(g_iSelectedClientCOACH);        }  
                case 
ELLIS:        {    EllisUse(g_iSelectedClientELLIS);        }  
                case 
BILL:        {    BillUse(g_iSelectedClientBILL);        }  
                case 
ZOEY:        {    ZoeyUse(g_iSelectedClientZOEY);        }  
                case 
FRANCIS:    {    BikerUse(g_iSelectedClientFRANCIS);    }  
                case 
LOUIS:        {    LouisUse(g_iSelectedClientLOUIS);        }  
                
            } 
        } 
        case 
MenuAction_Cancel
        { 
            
        } 
        case 
MenuAction_End:  
        { 
            
CloseHandle(menu); 
        } 
    } 


public 
Action:ShowMenu(clientargs
{
    if (
client == 0
    {
        
ReplyToCommand(client"[CSM] Character Select Menu is in-game only.");
        return;
    }
    if (
GetClientTeam(client) != 2)
    {
        
ReplyToCommand(client"[CSM] Character Select Menu is only available to survivors.");
        return;
    }
    if (!
IsPlayerAlive(client)) 
    {
        
ReplyToCommand(client"[CSM] You must be alive to use the Character Select Menu!");
        return;
    }
    if (
GetUserFlagBits(client) == && g_bAdminsOnly)
    {
        
ReplyToCommand(client"[CSM] Character Select Menu is only available to admins.");
        return;
    }
    
decl String:sMenuEntry[8];
    
    new 
Handle:menu CreateMenu(CharMenu);
    
SetMenuTitle(menu"Choose a character:");
    
    
    
IntToString(NICKsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Nick");
    
IntToString(ROCHELLEsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Rochelle");
    
IntToString(COACHsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Coach");
    
IntToString(ELLISsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Ellis");
    
    
IntToString(BILLsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Bill");    
    
IntToString(ZOEYsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Zoey");
    
IntToString(FRANCISsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Francis");
    
IntToString(LOUISsMenuEntrysizeof(sMenuEntry));
    
AddMenuItem(menusMenuEntry"Louis");
    
    
SetMenuExitButton(menutrue);
    
DisplayMenu(menuclientMENU_TIME_FOREVER);
}


public 
CharMenu(Handle:menuMenuAction:actionparam1param2
{
    switch (
action
    {
        case 
MenuAction_Select
        {
            
decl String:item[8];
            
GetMenuItem(menuparam2itemsizeof(item));
            
            switch(
StringToInt(item)) 
            {
                case 
NICK:        {    NickUse(param1NICK);        }
                case 
ROCHELLE:    {    RochelleUse(param1ROCHELLE);    }
                case 
COACH:        {    CoachUse(param1COACH);        }
                case 
ELLIS:        {    EllisUse(param1ELLIS);        }
                case 
BILL:        {    BillUse(param1BILL);        }
                case 
ZOEY:        {    ZoeyUse(param1ZOEY);        }
                case 
FRANCIS:    {    BikerUse(param1FRANCIS);    }
                case 
LOUIS:        {    LouisUse(param1LOUIS);        }
                
            }
        }
        case 
MenuAction_Cancel:
        {
            
        }
        case 
MenuAction_End
        {
            
CloseHandle(menu);
        }
    }
}

public 
_ConVarChange__AdminsOnly(Handle:convar, const String:oldValue[], const String:newValue[]) 
{
    
g_bAdminsOnly GetConVarBool(convar);
}    

/* Credits to Machine for this stock bool ;p*/
stock bool:IsSurvivor(client)
{
    if (
client && client <= MaxClients && IsClientInGame(client) && GetClientTeam(client) == 2)
    {
        return 
true;
    }
    return 
false;

Again, Linux and Windows Versions, Linux is the unlabelled first, and the only labeled "(windows)" is just that.
Can you please post the .sp file?
Thanks Kruffty
Krufftys Killers is offline
DeathChaos25
Senior Member
Join Date: Jan 2014
Location: Puerto Rico
Old 04-13-2015 , 19:29   Re: [L4D/L4D2] Character Select Menu (2.5a/b)
Reply With Quote #700

Quote:
Originally Posted by Krufftys Killers View Post
Can you please post the .sp file?
Thanks Kruffty
That big PHP block is the .sp but written in the post for easier access, I could attach it if needed.

This post has the commands listed, but contains only the linux version.

If you are using Windows, I strongly suggest you use the version packaged with this plugin, as it will give you a working Zoey on windows rather than simply having her be a Rochelle with Zoey skin, the zips all contain the sources to all the plugins posted.
__________________
DeathChaos25 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 22:24.


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