Raised This Month: $32 Target: $400
 8% 

Questions About Coding


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 01-15-2011 , 14:24   Questions About Coding
Reply With Quote #1

I have Little cuestions about the coding in sourcemod.

1 ) The AMX, have a funcion called set_task , in SM , what is this funcion ?
2 ) How i can call a directly funcion , EX:

Code:
// in AMXX
public clcmd_mypublic(index) hi(index)
public hi(index) client_print(index, print_chat, "[Oh , Hi thar]")
In sourcemod , how i can make , because have a lot of changes .

3 ) When i try to hook a command ( Example /simon ) , Always i should hook the say & say_team ?

4 ) Why In the public actions have a parameter called args ?

ex
Code:
public Action:lololol( client, args )

5 ) What is the diference between 'decl' and 'new or static' ?

Ok , that are my cuestion .

Thanks you very much.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 01-15-2011 , 16:57   Re: Questions About Coding
Reply With Quote #2

Quote:
Originally Posted by lucas_7_94 View Post
I have Little cuestions about the coding in sourcemod.

1 ) The AMX, have a funcion called set_task , in SM , what is this funcion ?
CreateTimer

Quote:
Originally Posted by lucas_7_94 View Post
2 ) How i can call a directly funcion , EX:

Code:
// in AMXX
public clcmd_mypublic(index) hi(index)
public hi(index) client_print(index, print_chat, "[Oh , Hi thar]")
In sourcemod , how i can make , because have a lot of changes .
You call it the same way you do on AMXX.

Quote:
Originally Posted by lucas_7_94 View Post
3 ) When i try to hook a command ( Example /simon ) , Always i should hook the say & say_team ?
You can also start your command names with "sm_", so SourceMod will automagically call it if the user uses /command or !command.

Quote:
Originally Posted by lucas_7_94 View Post
4 ) Why In the public actions have a parameter called args ?

ex
Code:
public Action:lololol( client, args )
args is the argument count i.e. how many arguments have been passed to your command:
Code:
sm_command a b c d e f // args = 6

Quote:
Originally Posted by lucas_7_94 View Post
5 ) What is the diference between 'decl' and 'new or static' ?
'decl' doesn't initialize the variable, which means if you do
Code:
decl String:hey[40]
the values of the cells on the string can be anything. If you use 'new' all the cells will have their default value (0).
Seta00 is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 01-15-2011 , 20:10   Re: Questions About Coding
Reply With Quote #3

That is a awesome answer , but can you give me a little example for the point 3 ?

Another thanks seta
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
Seta00
The Seta00 user has crashed.
Join Date: Jan 2010
Location: Berlin
Old 01-15-2011 , 20:40   Re: Questions About Coding
Reply With Quote #4

http://wiki.alliedmods.net/Commands_...#Chat_Triggers
Seta00 is offline
lucas_7_94
Leche Loco
Join Date: Mar 2009
Location: Argentina
Old 01-15-2011 , 20:42   Re: Questions About Coding
Reply With Quote #5

That is a really usefull , thanks you

[OFF]

Holy shit , now moderator , oh yeah , congrats.
__________________
ATWWMH - MiniDuels
Madness is like gravity, just need a little push.
lucas_7_94 is offline
Send a message via Skype™ to lucas_7_94
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 00:56.


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