|
Veteran Member
|

09-12-2013
, 16:54
Re: Menu Model Help
|
#7
|
Quote:
Originally Posted by dark_style
- Because it isn't needed.
- Your checks are wrong, they will throw an error if you don't put {} or simply if( !is_user_alive( id ) ) return PLUGIN_HANDLED.
- Use client_print() with index 0, it will print the message to everyone in the server.
- I can't really say this because I have never used the old menu style since I am scripting. You can find more info in new amxx menu style tutorial by Emp`, check out the comments.
- Always use pcvars.
- I would use Connor's colorchat.
|
- When i removed cs from reset_model or other it said error so it's needed? or i'm doing the code wrong?
- I added the {} now it's good?
- Um i said something in the ColorChat //... i used ColorChat(0,... see the question in the code please 
- I use his method, or the new menu method. It's easy and fun!
- Now the code has pcvar
- the question is in the same ColorChat //....
PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#define MAXPLAYERS 32
#define MODNAME "^x01 [^x04 GenderCheck^x01 ]"
new pcvargender
new SayText;
enum Color
{
NORMAL = 1,
GREEN, // Green Color
TEAM_COLOR, // Red, grey, blue
GREY, // grey
RED, // Red
BLUE, // Blue
}
public plugin_init()
{
register_plugin("GenderChecker", "1.1", "Baws")
pcvargender = register_cvar("amx_gender", "1") //added pcvar
register_menucmd(register_menuid("menu"), 1023, "menu_handler")
SayText = get_user_msgid("SayText");
}
public plugin_precache()
{
precache_model("cstrike/models/player/f_arctic/f_arctic.mdl")
precache_model("cstrike/models/player/f_guerilla/f_guerilla.mdl")
precache_model("cstrike/models/player/f_leet/f_leet.mdl")
precache_model("cstrike/models/player/f_terror/f_terror.mdl")
}
public ColorChat(id, Color:type, const msg[], {Float,Sql,Result,_}:...) //Connor color chat is better but i don't want to use a plugin to make this plugin use colorchat, i want coding you know or i just #include <colorchat> and its good with ColorChat()?
{
static SayText;
if(!SayText)
SayText = get_user_msgid("SayText");
static message[256];
switch(type)
{
case GREEN: // Green
{
message[0] = 0x04;
}
case TEAM_COLOR: // Team Color. Ie. Red (Terrorist) or blue (Counter-Terrorist).
{
message[0] = 0x03;
}
default: // Yellow.
{
message[0] = 0x01;
}
}
vformat(message[1], 251, msg, 4);
message[192] = '^0';
if(id)
{
if(is_user_connected(id))
{
message_begin(MSG_ONE, SayText, {0, 0, 0}, id);
write_byte(id);
write_string(message);
message_end();
}
} else {
static players[32]; new count, index;
get_players(players, count);
for(new i = 0; i < count; i++)
{
index = players[i];
message_begin(MSG_ONE, SayText, {0, 0, 0}, index);
write_byte(index);
write_string(message);
message_end();
}
}
}
public client_putinserver(id)
{
if(get_pcvar_num(pcvargender))
return PLUGIN_HANDLED
set_task(1.0, "GenderMenu", id) //Connor so here i put the "1.0" to "2.0" ?
return PLUGIN_HANDLED
}
public GenderMenu(id)
{
new menu = menu_create( "\yGender Checker: \rAre you a Guy or a Girl?", "menu_handler" )
menu_additem( menu, "\wI'm a Guy!", "", 0 );
menu_additem( menu, "\wI'm a Girl!", "", 0 );
menu_display( id, menu, 0 );
}
public menu_handler(id, menu, item)
{
new szName[64];
get_user_name(id, szName, charsmax(szName))
new message[132]
if(is_user_alive(id)) //here changes if user is alive *ADDED {}*
{
switch(item)
{
case 0:
{
ColorChat(0, GREEN, message, "%s Ladies! Mr. ^x04%s^x01 is coming.. but he's on the moon and he's walking!", MODNAME, szName) //Good?
}
case 1:
{
ColorChat(0, GREEN, message, "%s Guys! Ms. ^x04%s^x01 is coming.. but she's in the kitchen and she's on her way!", MODNAME, szName) //Good?
ShowGirlMenu(id)
}
case MENU_EXIT:
{
ColorChat(0, GREEN, message, "%s Ladies & Gentlemen ^x04%s^x01 is an Alien!", MODNAME, szName) //Good?
}
}
}
for (new i=0; i<get_maxplayers(); i++)
{
if(is_user_connected(i))
{
ColorChat(id, GREEN, message);
message_begin(MSG_ONE, SayText, _, i);
write_byte(id);
write_string(message);
message_end();
}
}
menu_destroy( menu );
return PLUGIN_HANDLED
}
ShowGirlMenu(id)
{
new menu = menu_create( "\yGC: \rGirls Model Menu!", "ShowGirlMenu_handler" )
menu_additem( menu, "\wGirl Arctic", "", 0 );
menu_additem( menu, "\wGirl Guerilla", "", 0 );
menu_additem( menu, "\wGirl Leet", "", 0 );
menu_additem( menu, "\wGirl Terror", "", 0 );
menu_additem( menu, "\wReset model", "", 0 );
menu_display( id, menu, 0 );
}
public ShowGirlMenu_handler(id, menu, item)
{
if(is_user_alive(id)) //if the user is alive his model will change *ADDED {}*
{
switch( item )
{
case 0:
{
cs_reset_user_model(id)
cs_set_user_model(id, "f_arctic")
ShowGirlMenu(id)
}
case 1:
{
cs_reset_user_model(id)
cs_set_user_model(id, "f_guerilla")
ShowGirlMenu(id)
}
case 2:
{
cs_reset_user_model(id)
cs_set_user_model(id, "f_leet")
ShowGirlMenu(id)
}
case 3:
{
cs_reset_user_model(id)
cs_set_user_model(id, "f_terror")
ShowGirlMenu(id)
}
case 4:
{
cs_reset_user_model(id)
cs_set_user_model(id, "sas")
ShowGirlMenu(id)
}
case 9: ColorChat( id, GREEN, "%s Menu Exited.", MODNAME)
}
}
menu_destroy( menu );
return PLUGIN_HANDLED
}
__________________
Like my clean plugins and work?
|
|