Raised This Month: $ Target: $400
 0% 

[HELP]Switch functions


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
SpaWn2KiLl
Member
Join Date: Aug 2012
Old 09-06-2013 , 15:50   Re: [HELP]Switch functions
Reply With Quote #8

You can't do
PHP Code:
new g_Class[33][Class] 
and use it with
PHP Code:
switch 

This is the final code:
PHP Code:
#include <amxmodx>

#define PLUGIN "asdasd"
#define VERSION "1.0"
#define AUTHOR "asdasd"

public plugin_init()
{
    
register_plugin(PLUGINVERSIONAUTHOR)
    
RegisterHam(Ham_Spawn"player""p_Spawn"1);
}

enum _:Class {
    
nc_regenerator,
    
nc_tank,
    
nc_hunter,
    
nc_hulk
    
}

new 
g_Class[33];

public 
p_Spawn(id)
{
    if(!
is_user_connected(id) || !is_user_alive(id))
        return 
1;
    
    
// if method
    
if(g_Class[id] == nc_regenerator)
    {
        
client_print(0print_chat"TEST")
    }
    
    
// switch method
    
switch(g_Class[id])
    {
        case 
nc_regenerator:
        {
        }
        case 
nc_tank:
        {
        }
        case 
nc_hunter:
        {
        }
        case 
nc_hulk:
        {
        }
    }
    return 
PLUGIN_CONTINUE

Thanks Black Rose for the help

Sorry for late answer.

EDIT: Added spawn function
__________________

Last edited by SpaWn2KiLl; 09-07-2013 at 23:04.
SpaWn2KiLl is offline
 



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 18:51.


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