Raised This Month: $ Target: $400
 0% 

Help with first work


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 05-23-2014 , 07:13   Re: [how to]
Reply With Quote #5

Code:
public plugin_init() { register_clcmd( "say", "stop_say" ) } public stop_say( id ) {     new szArgs[106], szCommand[16], szValue[8];     read_args(szArgs, charsmax(szArgs));     remove_quotes(szArgs);         if(equal(szArgs, "hp"))     {         chat_color(id, ".v[prefix].g Syntax error")         return PLUGIN_HANDLED     }         parse(szArgs, szCommand, charsmax(szCommand), szArgs, charsmax(szArgs) ,szValue,charsmax(szValue));         new iPlayer = cmd_target(id, szArgs, 8);             if(equal(szCommand, "hp"))     {         new hashpe=get_user_health(id)         set_user_health(iPlayer, hashpe + szValue)         } }

don't forget to add admin check, and check for syntax error if there is no value
aron9forever 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 09:35.


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