Raised This Month: $ Target: $400
 0% 

Bind variable into command ?


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
purple_pixie
Veteran Member
Join Date: Jun 2007
Location: Winchester, England
Old 01-07-2008 , 10:27   Re: Bind variable into command ?
Reply With Quote #2

Sort of like:
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

new const CLASS_NAMES[5][]=
{
	"No Class",
	"Warlock",
	"Mage",
	"Warrior",
	"Rogue"
}
 
public plugin_init() 
{
         register_clcmd("say showclass", "ShowChar")
 
}
public ShowChar(id) {            
    
 if ( PlayerClass[id] == CLASS_NOTHING) {    
            
  Change(id)
  
  set_hudmessage(0, 255, 255, -1.0, -1.0, 0, 6.0, 12.0)   
  show_hudmessage(id, "[WOW] You haven't choosen a class !")
            
  return PLUGIN_HANDLED;          
            
         }
 new message[64] ;
 format(message,sizeof message-1,"[WOW] You are a  %s !",CLASS_NAMES[PlayerClass[id]])
 set_hudmessage(0, 255, 255, -1.0, -1.0, 0, 6.0, 12.0)
 show_hudmessage(id, message)
 return PLUGIN_HANDLED;
}
?

And by "kinda giant" do you mean "straight from the tutorial"?
purple_pixie 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