Raised This Month: $ Target: $400
 0% 

Call command under if of other command


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
hornet
AMX Mod X Plugin Approver
Join Date: Mar 2010
Location: Australia
Old 04-23-2013 , 06:30   Re: Call command under if of other command
Reply With Quote #1

Make command a string and use set_task().
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
dady000
Junior Member
Join Date: May 2012
Old 04-23-2013 , 06:46   Re: Call command under if of other command
Reply With Quote #2

Quote:
Originally Posted by hornet View Post
Make command a string and use set_task().
Eh, how?
dady000 is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 04-23-2013 , 06:59   Re: Call command under if of other command
Reply With Quote #3

Quote:
Originally Posted by dady000 View Post
Eh, how?
another way of doing it is to make a stock...

Code:
stock func_money( id, cost, const command[] ) {     new money = cs_get_user_money(id);         if( money < cost )     {         NoMoney(id)         return PLUGIN_HANDLED;     }         if( equal(command, "SetGod" ) // example: func_money( id, 200, "SetGod" )     {         set_user_godmode( id, 1 ) // execute command here           }         cs_set_user_money( id, money - cost )         return PLUGIN_HANDLED; }

not 100% sure ive done it right as I'm only going off what you showed in your code.
__________________

Last edited by Blizzard_87; 04-23-2013 at 07:01.
Blizzard_87 is offline
dady000
Junior Member
Join Date: May 2012
Old 04-23-2013 , 07:17   Re: Call command under if of other command
Reply With Quote #4

Quote:
Originally Posted by Blizzard_87 View Post
another way of doing it is to make a stock...

Code:
stock func_money( id, cost, const command[] ) {     new money = cs_get_user_money(id);         if( money < cost )     {         NoMoney(id)         return PLUGIN_HANDLED;     }         if( equal(command, "SetGod" ) // example: func_money( id, 200, "SetGod" )     {         set_user_godmode( id, 1 ) // execute command here           }         cs_set_user_money( id, money - cost )         return PLUGIN_HANDLED; }

not 100% sure ive done it right as I'm only going off what you showed in your code.
Actually, it isnt code that I need. The command that I meant is already coded. So SetGlow(id, 1) is used to set glow of player to 1 (coded color). So I need to add coded command to this command and execute it at the if(). Like: func_money(id, 10 (if user have 10 money), -10 (set user money -10), SetGlow(id, 1) or other command - this is the command to execute at specified place in code) So that.
dady000 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 10:45.


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