AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   DEFINE Code in client_cmd command (https://forums.alliedmods.net/showthread.php?t=134351)

reinert 08-03-2010 17:02

DEFINE Code in client_cmd command
 
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


Bugsy 08-03-2010 17:29

Re: DEFINE Code in client_cmd command
 
%s

May need to enclose the value in quotes, too.

reinert 08-04-2010 04:28

Re: DEFINE Code in client_cmd command
 
PHP Code:

client_cmd(id"cl_crosshair_color "%s""COLOR



i will get errors :( what would be the correct way to do it right :)

Arkshine 08-04-2010 04:31

Re: DEFINE Code in client_cmd command
 
You need to espace " , use ^"

Devil259 08-04-2010 04:37

Re: DEFINE Code in client_cmd command
 
I think he doesn't need to use quotes, because the define COLOR have already quotes ("255 255 255").

Arkshine 08-04-2010 04:39

Re: DEFINE Code in client_cmd command
 
You're wrong. Go learn more the pawn, you have just started to learn and you know nothing yet. ^^

Devil259 08-04-2010 04:42

Re: DEFINE Code in client_cmd command
 
Ok ok. :3


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

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