AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   [HELP] with Pawn Basics (https://forums.alliedmods.net/showthread.php?t=57878)

ksapdude 07-13-2007 11:11

[HELP] with Pawn Basics
 
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

Lee 07-13-2007 13:14

Re: [HELP] with Pawn Basics
 
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;

ksapdude 07-13-2007 13:58

Re: [HELP] with Pawn Basics
 
ok thanks but i still dont get it
what is % in Pawn?

Lee 07-13-2007 14:13

Re: [HELP] with Pawn Basics
 
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.

ksapdude 07-13-2007 15:16

Re: [HELP] with Pawn Basics
 
its too complicated for me =\
any other help\tricks with beginning?

Arkshine 07-13-2007 15:21

Re: [HELP] with Pawn Basics
 
http://wiki.alliedmods.net/Pawn_Tutorial
http://wiki.alliedmods.net/Introduction_to_Pawn
http://wiki.alliedmods.net/Intro_to_AMX_Mod_X_Scripting

http://wiki.alliedmods.net/Category:...ing_(AMX_Mod_X)

hlstriker 07-13-2007 16:27

Re: [HELP] with Pawn Basics
 
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 :P

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


All times are GMT -4. The time now is 21:33.

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