AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   New at coding (https://forums.alliedmods.net/showthread.php?t=134500)

Ludacriss 08-05-2010 13:18

New at coding
 
Hello!

I got a zombie mod server and i am working on a menu so the human can choose between 6 models.

Can someone fix it and so only humans can open it not zombies and so the models work and the print_chat works.

PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <fun>

#define PLUGIN    "Model Changer"
#define AUTHOR    "Ludacriss"
#define VERSION    "1.0"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
    
register_clcmd("say /menu","PlayerMenu");
}
public 
PlayerMenu(id)
{
    new 
menu menu_create("\r Choose your player model:""menu_handler");
    
menu_additem(menu"\yZoey""\r1"0);
    
menu_additem(menu"\yFrancis""\r2"0);
    
menu_additem(menu"\yBill""\r3"0);
    
menu_additem(menu"\yLouis""\r4"0);
    
menu_additem(menu"\yEllis""\r5"0);
    
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
}
public 
menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    new 
key str_to_num(data);
    switch(
key)
    {
        case 
1:
        {
            
client_print(idprint_chat"You selected Zoey as your player model!");
            
menu_destroy(menu);
            return 
PLUGIN_HANDLED;
        }
        case 
2:
        {
            
client_print(idprint_chat"You selected Francis as your player model!");
            
menu_destroy(menu);
            return 
PLUGIN_HANDLED;
        }
        case 
3:
        {
            
client_print(idprint_chat"You selected Bill as your player model!");
            
menu_destroy(menu);
            return 
PLUGIN_HANDLED;
        }
        case 
4:
        {
            
client_print(idprint_chat"You selected Louis as your player model!");
            
menu_destroy(menu);
            return 
PLUGIN_HANDLED;
        }
        case 
5:
        {
            
client_print(idprint_chat"You selected Ellis as your player model!");
            
menu_destroy(menu);
            return 
PLUGIN_HANDLED;
        }
    }
    
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;



Shaw 08-05-2010 14:22

Re: New at coding
 
You're ZombieFreak and got banned. What are you doing back lol.

Vechta 08-06-2010 08:48

Re: New at coding
 
Quote:

Originally Posted by Shaw (Post 1262459)
You're ZombieFreak and got banned. What are you doing back lol.

+1

Afro-Ankan 08-06-2010 08:53

Re: New at coding
 
now the client_print works, do you want me to add Models to ?

PHP Code:

#include <amxmodx>
#include <fakemeta>
#include <fun>
#define PLUGIN    "Model Changer"
#define AUTHOR    "Ludacriss"
#define VERSION    "1.0"
public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
 
    
register_clcmd("say /menu","PlayerMenu");
}
public 
PlayerMenu(id)
{
    new 
menu menu_create("\r Choose your player model:""menu_handler");
    
menu_additem(menu"\yZoey""1"0);
    
menu_additem(menu"\yFrancis""2"0);
    
menu_additem(menu"\yBill""3"0);
    
menu_additem(menu"\yLouis""4"0);
    
menu_additem(menu"\yEllis""5"0);
 
    
menu_setprop(menuMPROP_EXITMEXIT_ALL);
    
menu_display(idmenu0);
}
public 
menu_handler(idmenuitem)
{
    if( 
item == MENU_EXIT)
    {
        
menu_destroy(menu);
        return 
PLUGIN_HANDLED;
    }
    new 
data[6], iName[64];
    new 
accesscallback;
    
menu_item_getinfo(menuitemaccessdata,5iName63callback);
    new 
key str_to_num(data);
    switch(
key)
    {
        case 
1:
        {
            
client_print(idprint_chat"You selected Zoey as your player model!");
        }
        case 
2:
        {
            
client_print(idprint_chat"You selected Francis as your player model!");
        }
        case 
3:
        {
            
client_print(idprint_chat"You selected Bill as your player model!");
        }
        case 
4:
        {
            
client_print(idprint_chat"You selected Louis as your player model!");
        }
        case 
5:
        {
            
client_print(idprint_chat"You selected Ellis as your player model!");
        }
    }
    
menu_destroy(menu);
    return 
PLUGIN_HANDLED;



drekes 08-06-2010 09:03

Re: New at coding
 
he's banned, why would you still fix this?

Afro-Ankan 08-06-2010 09:10

Re: New at coding
 
didn't know he was banned

DruGzOG 08-06-2010 09:30

Re: New at coding
 
It doesn't matter if hes banned or not. Soon he will be banned again. Doesn't mean hes not permitted to not have support. Theres nothing like that in the rules.

Emp0wer 08-06-2010 14:53

Re: New at coding
 
Quote:

Originally Posted by Shaw (Post 1262459)
You're ZombieFreak and got banned. What are you doing back lol.

Omg is the reason of banning getting interested in zombie mod? Then I was banned not with the stupidest reason on this forum :mrgreen:

YamiKaitou 08-06-2010 14:59

Re: New at coding
 
Quote:

Originally Posted by Emp0wer (Post 1263508)
Omg is the reason of banning getting interested in zombie mod? Then I was banned not with the stupidest reason on this forum :mrgreen:

No, he was banned for Ban Evasion (not the first time). You were banned for Non-Steam (not a stupid reason). I could ban you again for Evading...

Emp0wer 08-06-2010 15:15

Re: New at coding
 
Quote:

Originally Posted by YamiKaitou (Post 1263511)
No, he was banned for Ban Evasion (not the first time). You were banned for Non-Steam (not a stupid reason). I could ban you again for Evading...

Thx for not banning again, but I have a steam account. And you banned me because of helping non-steam player. Am I not right?


All times are GMT -4. The time now is 00:17.

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