Raised This Month: $ Target: $400
 0% 

[HELP] with Pawn Basics


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
ksapdude
Member
Join Date: Jul 2007
Old 07-13-2007 , 11:11   [HELP] with Pawn Basics
Reply With Quote #1

i really dont understand this, its too hard or im too dumb
i read all of http://www.amxmodx.org/doc/
Im in the "Scripting Tutorial"
i read the introduction already
and some first steps of the Pawn basics
i got it how strings, arrays and variables works out, but i have problem with Funtions

what is "return"? print? copy? i didnt get it what shall i do with this functions
and whats the point of "true\false" in boolean function?

im feeling too dumb, please help me somehow
thanks
ksapdude is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 07-13-2007 , 13:14   Re: [HELP] with Pawn Basics
Reply With Quote #2

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
ksapdude
Member
Join Date: Jul 2007
Old 07-13-2007 , 13:58   Re: [HELP] with Pawn Basics
Reply With Quote #3

ok thanks but i still dont get it
what is % in Pawn?
ksapdude is offline
Lee
AlliedModders Donor
Join Date: Feb 2006
Old 07-13-2007 , 14:13   Re: [HELP] with Pawn Basics
Reply With Quote #4

Format specifiers are used to place a value inside a string literal. In this case the contents of aVariable are placed inside an otherwise empty string as an integer.
Lee is offline
ksapdude
Member
Join Date: Jul 2007
Old 07-13-2007 , 15:16   Re: [HELP] with Pawn Basics
Reply With Quote #5

its too complicated for me =\
any other help\tricks with beginning?
ksapdude is offline
hlstriker
Green Gaben
Join Date: Mar 2006
Location: OH-IO!
Old 07-13-2007 , 16:27   Re: [HELP] with Pawn Basics
Reply With Quote #7

The last link that arkshine posted doesn't add the last ")" to the url. Make sure to add that if using the last link, or just click this one

Here is the correct link...
http://wiki.alliedmods.net/Category:...ng_(AMX_Mod_X)
hlstriker is offline
Reply


Thread Tools
Display Modes

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