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

Error 100, Function Prototypes. How to Fix?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Hostile_Badger
Junior Member
Join Date: Jul 2022
Old 07-14-2022 , 21:47   Error 100, Function Prototypes. How to Fix?
Reply With Quote #1

I'm new to source scripting and trying to create a mini plugin that does a command on round end.

Line that's creating errors:
HookEvent("teamplay_round_win",event);

also the code file is uploaded as well
Attached Files
File Type: sp Get Plugin or Get Source (adminreloader.sp - 30 views - 470 Bytes)
Hostile_Badger is offline
nosoop
Veteran Member
Join Date: Aug 2014
Old 07-14-2022 , 23:57   Re: Error 100, Function Prototypes. How to Fix?
Reply With Quote #2

Your event function needs to have one of these exact return types and arguments, since that's what HookEvent expects.

Code:
void event(Event ev, const char[] name, bool dontBroadcast) {
    // ...
}
__________________
I do TF2, TF2 servers, and TF2 plugins.
I don't do DMs over Discord -- PM me on the forums regarding inquiries.
AlliedModders Releases / Github / TF2 Server / Donate (BTC / BCH / coffee)

Last edited by nosoop; 07-14-2022 at 23:57.
nosoop is offline
Sreaper
髪を用心
Join Date: Nov 2009
Old 07-15-2022 , 00:15   Re: Error 100, Function Prototypes. How to Fix?
Reply With Quote #3

Although already answered above, here is corrected version of your code.
You also don't need to include public for the event callback either. Only SM and third party plugin forwards need to have public.

PHP Code:
public void OnPluginStart()
{
    
HookEvent("teamplay_round_win"SomeNameHere);
}

void SomeNameHere(Handle eventchar[] namebool dontBroadcast)
{    
    
PrintToServer("Admins Reloaded");
    
ServerCommand("sm_reloadadmins");


Last edited by Sreaper; 07-15-2022 at 00:28.
Sreaper is offline
Hostile_Badger
Junior Member
Join Date: Jul 2022
Old 07-15-2022 , 11:05   Re: Error 100, Function Prototypes. How to Fix?
Reply With Quote #4

Thanks for the help you two, I couldn't find the documentation for that anywhere on the wiki or even youtube.

I'll be using that API directory that noscoop sent alot more.
Hostile_Badger is offline
Marttt
Veteran Member
Join Date: Jan 2019
Location: Brazil
Old 07-15-2022 , 11:21   Re: Error 100, Function Prototypes. How to Fix?
Reply With Quote #5

Events (SourceMod Scripting) - Post Hooks
__________________

Last edited by Marttt; 07-15-2022 at 11:23.
Marttt is offline
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 06:17.


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