Raised This Month: $12 Target: $400
 3% 

A tag that I can call back to?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ibanezez
SourceMod Donor
Join Date: Aug 2014
Location: Earth
Old 10-05-2014 , 13:03   A tag that I can call back to?
Reply With Quote #1

Is there some kind of tag that I can call back to, such as the stock functions, but with the functions (not sure what they are called) that the name changes what exactly it does, such as OnPluginStart and OnClientPutInServer, etc. This is part of a bigger plugin, where I need to put taunt data into other functions. Here are the functions that I need to put inside the other functions:
PHP Code:
public Action:HUD(Handle:timerany:client)
{

}

public 
OnEntityCreated(entity, const String:classname[])
{

}

public 
SDKHookCB_OnSceneSpawnedPost(entity)
{


I need to put all of those into a bigger plugin, but I can't put functions inside of functions, so is there a different way to do this?

I know this probably sounds really weird, but if you can figure out what looking for, I would really appreciate help.

Thanks!

EDIT
I already know about stock functions, where you can type:
PHP Code:
public Action:Command_Spycrab(clientargs)
{
    
tauntdata(client)
}

stock tauntdata(client)
{
    
PrintToChat(client"TAUNT DATA");
    return 
Plugin_Handled;

I'm just looking for a tag that you can add that creates a name for it, and you can call it inside another function, such as:

public Action:Command_Spycrab(client, args, stock:<insertnamehere>(client))
and call it with <insertnamehere>(client)

Something like that, though I know stock isn't a tag.

My main reason of wanting this, is that I want to put spycrab taunt data inside the Map Zones plugin, where only if you are inside a Map Zone, you will be killed if you spycrab.
__________________
Hello

Last edited by Ibanezez; 10-05-2014 at 13:07.
Ibanezez is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 10-05-2014 , 13:21   Re: A tag that I can call back to?
Reply With Quote #2

You can call any function from any other function within the same plugin, in exactly the same way you posted in your EDIT.

The only exception is "static" functions, which can only be accessed by other functions within the same file. (the source file, not the plugin).
__________________
ddhoward is offline
Marcus_Brown001
AlliedModders Donor
Join Date: Nov 2012
Location: Illinois, United States
Old 10-05-2014 , 13:24   Re: A tag that I can call back to?
Reply With Quote #3

Quote:
Originally Posted by Ibanezez View Post
My main reason of wanting this, is that I want to put spycrab taunt data inside the Map Zones plugin, where only if you are inside a Map Zone, you will be killed if you spycrab.
So edit the Map Zones plugin. Check if the player is a spycrab when he enters a zone, and if he is kill him. What you are trying to do with the stock:namehere is not possible.
Marcus_Brown001 is offline
Ibanezez
SourceMod Donor
Join Date: Aug 2014
Location: Earth
Old 10-05-2014 , 14:08   Re: A tag that I can call back to?
Reply With Quote #4

Not exactly, it's a different kind of spycrab, the one that has a small chance of happening when you taunt with the PDA as a spy. How would this be possible though? I've seen other plugins that do this. (Spycrab inside a map zone)

I appreciate you guys responding!
__________________
Hello
Ibanezez is offline
Ibanezez
SourceMod Donor
Join Date: Aug 2014
Location: Earth
Old 10-05-2014 , 14:52   Re: A tag that I can call back to?
Reply With Quote #5

Quote:
Originally Posted by ddhoward View Post
You can call any function from any other function within the same plugin, in exactly the same way you posted in your EDIT.

The only exception is "static" functions, which can only be accessed by other functions within the same file. (the source file, not the plugin).
Could you give an example of what static function would look like?
__________________
Hello
Ibanezez is offline
VoiDeD
AlliedModders Donor
Join Date: Mar 2009
Location: Illinois, USA
Old 10-06-2014 , 13:32   Re: A tag that I can call back to?
Reply With Quote #6

Given the volume of questions you keep posting in this forum, you need a tutorial.

And given how apparently you've been deleting your example code that you've been posting as it's "private", I feel genuinely sorry for whoever contracted you to make this plugin.
__________________
VoiDeD is offline
Dr. Greg House
Professional Troll,
Part-Time Asshole
Join Date: Jun 2010
Old 10-06-2014 , 14:54   Re: A tag that I can call back to?
Reply With Quote #7

Quote:
Originally Posted by VoiDeD View Post
Given the volume of questions you keep posting in this forum, you need a tutorial.[...]
That doesn't help him. The tutorial is intended for those who have experiences with other languages.
I second the rest of your posting. Why is that allowed BTW? Isn't the purpose of a forum to collect answered questions so others can find them without having to ask the same questions again?
__________________
Santa or Satan?

Watch out when you're paying people for private requests! Most stuff already exists and you can hardly assess the quality of what you'll get, and if it's worth the money.

Last edited by Dr. Greg House; 10-06-2014 at 14:55.
Dr. Greg House is offline
ddhoward
Veteran Member
Join Date: May 2012
Location: California
Old 10-06-2014 , 20:57   Re: A tag that I can call back to?
Reply With Quote #8

Quote:
Originally Posted by Ibanezez View Post
Could you give an example of what static function would look like?
It is a function with the word "static" in the front. Where you sometimes see "public" and/or "stock".


I agree with everyone else. You need to seriously take some time to figure out exactly what you are doing, and what the code you are using actually does, rather than copy/pasting things and hoping they work, asking questions over and over, etc.

Here are some nice reads. Note that some of this may have statements and references that only work with AMX Mod X and not Sourcemod.

https://forums.alliedmods.net/showthread.php?t=94381
https://forums.alliedmods.net/showthread.php?t=91207
https://forums.alliedmods.net/showthread.php?t=187025
__________________

Last edited by ddhoward; 10-06-2014 at 21:02.
ddhoward 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 02:34.


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