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

Having trouble with the new syntax


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
blaize
Junior Member
Join Date: Sep 2010
Old 09-12-2021 , 12:41   Having trouble with the new syntax
Reply With Quote #1

Hello,
I'm trying to recompile my old plugins from 2012 with the new sourcemod but I have some issus.

I have made an extension that pick a random function. Plugins can register functions into this extension to get the randomness.

I have this header

Quote:
#if defined _random_func_included
#endinput
#endif
#define _random_func_included

funcenum RandomFunction
{
public(client, Float:pos[3])
};

/**
* @brief Add a function to the random list
*
* @param funcid_t Function handler
* @return int 0
*/
native rf_add_function(RandomFunction:hook);

/**
* @brief Remove a function from the random list
*
* @param funcid_t Function handler
* @return int 0
*/
native rf_remove_function(RandomFunction:hook);

/**
* @brief Execute one of the added function
*
* @param int client that call the function
* @param float postion vector where the function must do something
* @return int 0 on success, -1 if no function
*/
native rf_execute_function(client, Float:pos[3]);
The problem come from

Quote:
funcenum RandomFunction
{
public(client, Float:pos[3])
};
I get this error :

Quote:
random_func.inc(7) : fatal error 196: deprecated syntax; see https://wiki.alliedmods.net/SourcePa...yntax#Typedefs
Ok, I changed by this:

Quote:
typeset RandomFunction
{
function void (int client, Float:pos[3])
};
but now I have this error:

Quote:
random_func.inc(9) : error 120: methodmap and class signatures must use new-style type declarations
Can't make it work. I don't want to recode my plugins too much, just porting with the new syntax. Any help ?
Thanks
blaize is offline
Psyk0tik
Veteran Member
Join Date: May 2012
Location: Homeless
Old 09-12-2021 , 12:53   Re: Having trouble with the new syntax
Reply With Quote #2

PHP Code:
float pos[3
__________________
Psyk0tik is offline
blaize
Junior Member
Join Date: Sep 2010
Old 09-12-2021 , 12:56   Re: Having trouble with the new syntax
Reply With Quote #3

You are the boss
blaize 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 10:58.


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