AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Repassing function arguments (https://forums.alliedmods.net/showthread.php?t=75434)

danielkza 08-05-2008 13:52

Repassing function arguments
 
Is thera a way to repasss funcion arguments to a secondary function? I will use that in an any:... format function like this:
PHP Code:

PrintActivity(id,key[],any:...)
{
    new 
name[32]
    
get_user_name(id,name,31)
    
show_activity(id,name"%L"LANG_PLAYERkeyany:...)


Got my idea? Is is possible?

draft 08-05-2008 14:49

Re: Repassing function arguments
 
What is show_activity?
May be u mean smth like this:
Code:

PrintActivity(id, key[], ...)
{
    new
name[32
]
   
get_user_name(id,name,31
)
   
show_activity(id, name, key, ...)

 
public show_activity(id, name, key, ...)
{
...
}


xPaw 08-05-2008 15:01

Re: Repassing function arguments
 
show_activity - Shows admin activity.
Syntax:
PHP Code:

show_activity id, const name[], ... ) 

Example:
PHP Code:

show_activity(id,playername,"slapped player"); 

If amx_show_activity is 2, will appear as: "ADMIN PlayerName: slapped player". If it is 1, it will appear as: "ADMIN: slapped player".

danielkza 08-05-2008 15:46

Re: Repassing function arguments
 
I though about vformat, but i was planning to pass them into show_acitivity,but i could just copy the code from amxmisc.inc and do the rest myself.

PS: For those who didn't understand, show_activity was only an example. I was going to use other functions, like log_amx and server_print. For now i'll stick with vformat.

Thanks for the help.


All times are GMT -4. The time now is 05:40.

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