Raised This Month: $ Target: $400
 0% 

give_item


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 02-12-2007 , 23:46   Re: give_item
Reply With Quote #18

You only need to use curly braces {} if the "if" statement contains multiple lines of code to be executed. Since "return" is just one line of code, you don't need the braces. For example:

Code:
if(statement) line1 // line1 is executed if statement is true if(statement)    line1 // line1 is executed if statement is true if(statement)    line1 // line1 is executed if statement is true line2 // line2 is always executed, because there are no curly braces to group this with the if above, and it's not the first line after the if statement if(statement) {      line1 // line1 is executed if statement is true      line2 // line2 is executed if statement is true }

As for lastDeathMsg, what it is doing is recording at what time a player dies. Then, when a death message comes up, it compares that time with the time the death message was called. If this death message was called within 0.2 seconds of the last one, then it must be a glitchy death message from give_item, because no one naturally dies twice within 0.2 seconds.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX 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 11:07.


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