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 , 07:36   Re: Call command under if of other command
Reply With Quote #1

I believe this is what he's asking for:
Code:
public func_money(id, money1, money2, const command[], paramsnum ) {     if(cs_get_user_money(id) >= money1)     {         cs_set_user_money(id, cs_get_user_money(id) + money2, 0)                 /*  paramsnum is how many parameters your function will have take player index             **  For example SetGlow .. paramsnum would be 1 ..             **  To set enabled or disabled         */                 new Data[ sizeof paramsnum ];         Data[ 0 ] = 1; //this is the value you want glow to be in this example                 set_task( 0.01, command, id, Data, sizeof Data );     }     else     {         NoMoney(id)     }     }   public SetGlow( enabled[], id ) {     if( enabled[ 0 ] )     {         //set glow     }     else        {           //remove glow     } }
__________________
Quote:
vBulletin Tip #42: Not much would be accomplished by merging this item with itself.
hornet is offline
Blizzard_87
Veteran Member
Join Date: Oct 2012
Old 04-23-2013 , 07:54   Re: Call command under if of other command
Reply With Quote #2

Quote:
Originally Posted by hornet View Post
I believe this is what he's asking for:
Code:
public func_money(id, money1, money2, const command[], paramsnum ) {     if(cs_get_user_money(id) >= money1)     {         cs_set_user_money(id, cs_get_user_money(id) + money2, 0)                 /*  paramsnum is how many parameters your function will have take player index             **  For example SetGlow .. paramsnum would be 1 ..             **  To set enabled or disabled         */                 new Data[ sizeof paramsnum ];         Data[ 0 ] = 1; //this is the value you want glow to be in this example                 set_task( 0.01, command, id, Data, sizeof Data );     }     else     {         NoMoney(id)     }     }   public SetGlow( enabled[], id ) {     if( enabled[ 0 ] )     {         //set glow     }     else        {           //remove glow     } }
thanks that also helps me too
__________________
Blizzard_87 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