Raised This Month: $ Target: $400
 0% 

The type of a variable!!??


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 07-11-2014 , 17:05   Re: The type of a variable!!??
Reply With Quote #4

Quote:
Originally Posted by xbennY View Post
This would work perfectly in other programming languages ​​but it does not works in Pawn because when the variable is Boolean he can not take the value 0 or 1, only the values ​​true and false.
That is not true. Pawn is a typeless language therefore, true = 1 and false = 0. Tagging a variable in Pawn is merely artificial unlike a typed language. One exception might be the Float tag.

So, you can simple set a boolean to 0.

IMO, you should never be looping through variables of different types. I believe that in some other languages, you would create multiple functions with different headers to achieve something like this.

Code:
myfunction(bool:bVariable)
myfunction(Float:fVariable)
where each one would use the appropriate underlying code corresponding to the input.

In your case, you can simply make one function to reset kills and another to reset the alive variable.
__________________

Last edited by fysiks; 07-11-2014 at 17:07.
fysiks 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 21:10.


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