Raised This Month: $ Target: $400
 0% 

Bind variable into command ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
AlexanderM
Junior Member
Join Date: Dec 2007
Old 01-07-2008 , 10:14   Bind variable into command ?
Reply With Quote #1

Hi.

Im a litle new, begining to understand some of the code, but still new to amx modx.

In my plugin I want to tell the client wich 'class' he is. My plugin is kinda
giant so ill just post som of the code in PHP.

PHP Code:
#include <amxmodx>
#include <amxmisc>
#include <cstrike>
#include <fakemeta>
 
#define CLASS_NOTHING 0     
#define CLASS_WARLOCK 1
#define CLASS_MAGE 2
#define CLASS_WARRIOR 3
#define CLASS_ROUGE 4
 
public plugin_init() 
{
         
register_clcmd("say showclass""ShowChar")
 
}
public 
ShowChar(id) {            
 
 if ( 
PlayerClass[id] == CLASS_NOTHING) {    
 
  
Change(id)
 
  
set_hudmessage(0255255, -1.0, -1.006.012.0)   
  
show_hudmessage(id"[WOW] You haven't choosen a class !")
 
  return 
PLUGIN_HANDLED;          
 
         }
 if ( 
PlayerClass[id] == CLASS_WARLOCK) { 
 
            
set_hudmessage(0255255, -1.0, -1.006.012.0)
            
show_hudmessage(id"[WOW] You are a Warlock !")
 
            return 
PLUGIN_HANDLED;
 
        }   
        if ( 
PlayerClass[id] == CLASS_MAGE) { 
 
            
set_hudmessage(0255255, -1.0, -1.006.012.0)
            
show_hudmessage(id"[WOW] You are a Mage !")
 
            return 
PLUGIN_HANDLED;
 
        }   
        if ( 
PlayerClass[id] == CLASS_WARRIOR) { 
 
            
set_hudmessage(0255255, -1.0, -1.006.012.0)
            
show_hudmessage(id"[WOW] You are a Warrior !")
 
            return 
PLUGIN_HANDLED;
 
        }   
        if ( 
PlayerClass[id] == CLASS_ROUGE) { 
 
            
set_hudmessage(0255255, -1.0, -1.006.012.0)
            
show_hudmessage(id"[WOW] You are a Rouge !")
 
            return 
PLUGIN_HANDLED;
        }
 return 
PLUGIN_HANDLED;

This is kinda huge, and I have 9 classes, so coulden't I make this another way ?
Attached Files
File Type: sma Get Plugin or Get Source (tbc_mod.sma - 601 views - 68.5 KB)
__________________
Uhm... More Pizza...
______________________________
| Home | Search | Google | Steam |

Last edited by AlexanderM; 01-07-2008 at 10:41. Reason: Posted the .sma file ;P
AlexanderM 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 11:13.


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