Raised This Month: $ Target: $400
 0% 

DEFINE Code in client_cmd command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
reinert
Veteran Member
Join Date: Feb 2007
Old 08-03-2010 , 17:02   DEFINE Code in client_cmd command
Reply With Quote #1

hey, how could I input an DEFINED name in client_cmd command. I've got alot of client_cmd commands with same functions in it, so not to change them every time I decided to make an DEFINE
PHP Code:
#define COLOR "255 255 255"

client_cmd(id"cl_crosshair_color <<<DEFINED COLOR HERE>>> "
Don't say just write an define with cl_crosshair_color, because I don't want to :p

EDIT: or should I do like:

PHP Code:
client_cmd(id"cl_crosshair_color %i"COLOR

Last edited by reinert; 08-03-2010 at 17:04.
reinert is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-03-2010 , 17:29   Re: DEFINE Code in client_cmd command
Reply With Quote #2

%s

May need to enclose the value in quotes, too.
__________________

Last edited by Bugsy; 08-03-2010 at 18:06.
Bugsy is offline
reinert
Veteran Member
Join Date: Feb 2007
Old 08-04-2010 , 04:28   Re: DEFINE Code in client_cmd command
Reply With Quote #3

PHP Code:
client_cmd(id"cl_crosshair_color "%s""COLOR


i will get errors what would be the correct way to do it right
reinert is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-04-2010 , 04:31   Re: DEFINE Code in client_cmd command
Reply With Quote #4

You need to espace " , use ^"
__________________
Arkshine is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 08-04-2010 , 04:37   Re: DEFINE Code in client_cmd command
Reply With Quote #5

I think he doesn't need to use quotes, because the define COLOR have already quotes ("255 255 255").
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 08-04-2010 , 04:39   Re: DEFINE Code in client_cmd command
Reply With Quote #6

You're wrong. Go learn more the pawn, you have just started to learn and you know nothing yet. ^^
__________________
Arkshine is offline
Devil259
Veteran Member
Join Date: Dec 2009
Location: France (59)
Old 08-04-2010 , 04:42   Re: DEFINE Code in client_cmd command
Reply With Quote #7

Ok ok.
__________________
You can do anything you set your mind to, man.

Devil259 is offline
Reply



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 00:10.


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