Raised This Month: $ Target: $400
 0% 

[HELP] with Pawn Basics


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 07-13-2007 , 13:14   Re: [HELP] with Pawn Basics
Reply With Quote #1

return is used to exit the current function. You can optionally include a value that can be stored for later use.

Code:
aFunction() {     return 25; } public plugin_init() {     new aVariable = 19;     client_print(0, print_console, "%i", aVariable);     aFunction(); //in this case does nothing useful - return value is discarded     client_print(0, print_console, "%i", aVariable);     aVariable = aFunction();     client_print(0, print_console, "%i", aVariable); }
Code:
Output to every player's console:

19
19
25
Boolean variables are used as flags - that is they can only have one of two states: on or off. For example:

Code:
new bool:isDead; if(is_user_alive(id)) isDead = false else isDead = true;

Last edited by Lee; 07-13-2007 at 13:20.
Lee 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 21:33.


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