Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Topics - jokeritoval

#1
General Discussion / Add Unicode to game
Jan 21, 2018, 05:53 AM
All players wanna see unicode in the VCMP. ALL!
All players want write in chat on speaking language, but not english.

Please add unicode to a VCMP. Mainly in chat. Even though for chat
This is very important

Sorry for my bad English.
Thanks!
#2
Please give me a some examples how to use this functions in VCMP SDK

ExportFunctions
GetPluginExports

I am see how it works in Squirrel plugin sources
but dont understand how it works

Please give some SIMPLE examples how to use it

I am try to use

mainplugin.c
int GetSrv()
{
return 900;
}
typedef struct
{
int structSize;

int (*GetSrv)(void); // pointer to funct
} ExportFunc;

extern EXPORT unsigned int VcmpPluginInit( PluginFuncs* pluginFuncs, PluginCallbacks* pluginCalls, PluginInfo* pluginInfo )
{
int ret;
ExportFunc *fc = (ExportFunc*)malloc(sizeof(ExportFunc));
fc->GetSrv = GetSrv;



    pluginInfo->apiMajorVersion = PLUGIN_API_MAJOR;
    pluginInfo->apiMinorVersion = PLUGIN_API_MINOR;

// give name plugin for other finding plugins
pluginInfo->pluginVersion = 0x100;
strcpy(pluginInfo->name, "main_plugin");



// Export them
pluginFuncs->ExportFunctions( pluginInfo->pluginId, (void **)&fc, sizeof(ExportFunc) );
}

and

additional_plugin.c
typedef struct
{
int structSize;

int (*GetSrv)(void); // указатель на функцию
} ExportFunc;

void OnSquirrelScriptLoad()
{
int err;

unsigned int size;
int sqId = functions->FindPlugin("main_plugin");
const void **sqExports = functions->GetPluginExports(sqId, &size);

// We do!
if (sqExports != NULL && size > 0)
{

ExportFunc *sqFuncs = (ExportFunc *)(sqExports);

if( sqFuncs )
{
int tea = sqFuncs->GetSrv();
printf("get size = %d\n", tea );
}
}
else {
printf("Failed to attach to pawn_plugin\n");
}
}

in console i see "get size = " and get Fatal Error

Please give me some SIMPLE example how to use ExportFunctions and GetPluginExports, NOT "solution" of my code

Thanks!