Raised This Month: $23 Target: $400
 5% 

Programming for starters


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-28-2009 , 19:40   Re: Programming for starters
Reply With Quote #21

Quote:
Originally Posted by joaquimandrade View Post
Its not suitable for what is written now because it is a function provided by amxmodx.
It is part of Pawns core per the pawn language guide so it is suitable for a pawn tutorial. If you choose to omit it just to illustrate if-statements then that's fine too.

Edit: Better off not using clamp and just using the if's so beginners can see what is going on.
__________________

Last edited by Bugsy; 04-28-2009 at 21:40.
Bugsy is offline
--kml--
Senior Member
Join Date: Jan 2009
Old 04-28-2009 , 20:25   Re: Programming for starters
Reply With Quote #22

omg

thank you very much about this thread + karma joaquimandrade
--kml-- is offline
--kml--
Senior Member
Join Date: Jan 2009
Old 04-28-2009 , 20:31   Re: Programming for starters
Reply With Quote #23

and can you put about public?

you have explained about new

but public can u explain it also
--kml-- is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-29-2009 , 06:49   Re: Programming for starters
Reply With Quote #24

Quote:
Originally Posted by --kml-- View Post
and can you put about public?

you have explained about new

but public can u explain it also
A function in your plugin can be called from inside your plugin or from an external source. As an example, plugin_init , plugin_precache ... are called from amxmodx when your plugin starts. Since they are called not from your plugin but from an external source they need to be public. The same happens for functions associated to console/server commands, for tasks, for menu handlers, and for functions in another plugins.
__________________
joaquimandrade is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-29-2009 , 12:01   Re: Programming for starters (Part 2, by Bugsy, added)
Reply With Quote #25

Part 2, by Bugsy, added.
__________________
joaquimandrade is offline
Arkshine
AMX Mod X Plugin Approver
Join Date: Oct 2005
Old 04-29-2009 , 12:09   Re: Programming for starters (Part 2, by Bugsy, added)
Reply With Quote #26

The last link you could directly give http://www.amxmodx.org/funcwiki.php?go=inc&id=5
Arkshine is offline
joaquimandrade
Veteran Member
Join Date: Dec 2008
Location: Portugal
Old 04-29-2009 , 12:11   Re: Programming for starters (Part 2, by Bugsy, added)
Reply With Quote #27

I'm sure Bugsy will agree so, i added it.
__________________
joaquimandrade is offline
Exolent[jNr]
Veteran Member
Join Date: Feb 2007
Location: Tennessee
Old 04-29-2009 , 16:04   Re: Programming for starters (Part 2, by Bugsy, added)
Reply With Quote #28

For the part about characters, you should also let them know that you don't have to use the ascii values.

Instead of this:
Code:
new szWord[5] szWord[0] = 119 //w szWord[1] = 111 //o szWord[2] = 114 //r szWord[3] = 100 //d szWord[4] = 0   //null //This is not needed since the default value of each element is 0.
You can do this:
Code:
new szWord[5] szWord[0] = 'w' //w szWord[1] = 'o' //o szWord[2] = 'r' //r szWord[3] = 'd' //d szWord[4] = 0   //null //This is not needed since the default value of each element is 0.
__________________
No private work or selling mods.
Quote:
Originally Posted by xPaw View Post
I love you exolent!
Exolent[jNr] is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 04-29-2009 , 17:58   Re: Programming for starters (Part 2, by Bugsy, added)
Reply With Quote #29

Good idea exolent. I was trying to get the understanding of how the array holds a character so I was sticking with the numbers. It is definitely a good idea to show character assignment as well.
__________________
Bugsy is offline
Nextra
Veteran Member
Join Date: Apr 2008
Location: Germany
Old 04-29-2009 , 18:03   Re: Programming for starters (Part 2, by Bugsy, added)
Reply With Quote #30

Well done. More indepth than the Wiki article but still it should be understandable for everyone. Nice
__________________
In Flames we trust!
Nextra is offline
Old 04-29-2009, 20:48
--kml--
This message has been deleted by Exolent[jNr]. Reason: Completely off-topic, so don't post it.
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:25.


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