SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Plugin Development

Reply
 
Thread Tools Display Modes
Old 09/04/2016, 08:49 AM   #341
Revolutionize
Little Clucker
 
Revolutionize's Avatar
 
Join Date: Mar 2016
Posts: 8
Reputation: 0
Default Re: Gamemode SDK for C/C++ (GDK)

It says the plugin failed to load, doesn't say why, is there a way to find out why?
Quote:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3.7-R2, (C)2005-2015 SA-MP Team

[01:42:44] filterscripts = "" (string)
[01:42:44]
[01:42:44] Server Plugins
[01:42:44] --------------
[01:42:44] Loading plugin: CopsAndRobbers.dll
[01:42:44] Failed.
[01:42:44] Loaded 0 plugins.

[01:42:44]
[01:42:44] Filterscripts
[01:42:44] ---------------
[01:42:44] Loaded 0 filterscripts.

[01:42:44] Number of vehicle models: 0
Quote:
1>------ Build started: Project: CopsAndRobbers, Configuration: Release Win32 ------
1> CopsAndRobbers.cpp
1> Creating library C:\Users\MikeK\OneDrive\San Andreas Multiplayer\plugins\CopsAndRobbers.lib and object C:\Users\MikeK\OneDrive\San Andreas Multiplayer\plugins\CopsAndRobbers.exp
1> Generating code
1> 0 of 74 functions ( 0.0%) were compiled, the rest were copied from previous compilation.
1> 0 functions were new in current compilation
1> 0 functions had inline decision re-evaluated but remain unchanged
1> Finished generating code
1> CopsAndRobbers.vcxproj -> C:\Users\MikeK\OneDrive\San Andreas Multiplayer\plugins\CopsAndRobbers.dll
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
Windows 10 64-bit.
Latest Visual Studio Community 2015.
C/C++ -> Pre-processor -> Definitions:
Quote:
HAVE_STDINT_H;
Linker -> Input -> Add. Deps.:
Quote:
SAMP_GDK/sampgdk4.lib;
Code is exact same as the code in the main thread.
Revolutionize is offline   Reply With Quote
Old 21/06/2016, 10:30 PM   #342
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,984
Reputation: 1392
Default Re: Gamemode SDK for C/C++ (GDK)

I have a problem with making a function work when is used in PAWN script.
Code:
static cell AMX_NATIVE_CALL PrintFunc(AMX *amx, cell *params)
{
	logprintf("PrintFunc is working.");
	return 1;
}

AMX_NATIVE_INFO PluginNatives[] =
{
	{"PrintFunc", PrintFunc},
	{0, 0}
};
and yes, I do have SUPPORTS_AMX_NATIVES defined in Supports() function. It gives run time error 19 for function "PrintFunc" not found.

I use amalgamation version.
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 21/06/2016, 11:57 PM   #343
RaeF
Huge Clucker
 
Join Date: Dec 2014
Location: Indonesia
Posts: 265
Reputation: 27
Default Re: Gamemode SDK for C/C++ (GDK)

Have you defined the "native PrintFunc();" in your include or pwn file?
Quote:
Originally Posted by Konstantinos View Post
I have a problem with making a function work when is used in PAWN script.
and yes, I do have SUPPORTS_AMX_NATIVES defined in Supports() function. It gives run time error 19 for function "PrintFunc" not found.

I use amalgamation version.
__________________
Release:

- Nothing - I dont have idea to release something.
RaeF is offline   Reply With Quote
Old 22/06/2016, 07:14 AM   #344
Yashas
Gangsta
 
Join Date: Jun 2012
Location: India
Posts: 866
Reputation: 295
Default Re: Gamemode SDK for C/C++ (GDK)

@Konstantinos
Did you register the natives in AmxLoad? The script will be aware of the natives only when you register them. The register process basically fills the native functions table (the PAWN compiler leaves the address field as 0) with the correct addresses. If there is one or more function whose address isn't set, you'll get that error.
Yashas is offline   Reply With Quote
Old 22/06/2016, 10:12 AM   #345
Konstantinos
Spam Machine
 
Konstantinos's Avatar
 
Join Date: Dec 2011
Posts: 11,984
Reputation: 1392
Default Re: Gamemode SDK for C/C++ (GDK)

Quote:
Originally Posted by RaeF View Post
Have you defined the "native PrintFunc();" in your include or pwn file?
I wouldn't be able to compile the PAWN script otherwise.

Quote:
Originally Posted by Yashas View Post
@Konstantinos
Did you register the natives in AmxLoad? The script will be aware of the natives only when you register them. The register process basically fills the native functions table (the PAWN compiler leaves the address field as 0) with the correct addresses. If there is one or more function whose address isn't set, you'll get that error.
Indeed that was the problem. I was playing around with "helloworld" and when I decided to add some functions, forgot to add "AmxLoad" - thanks.
__________________
Life is like riding a bicycle. To keep your balance, you must keep moving.

[Tutorial] How to use SQLite
[FilterScript] Tune System
Konstantinos is offline   Reply With Quote
Old 19/08/2016, 05:19 PM   #346
doreto
High-roller
 
doreto's Avatar
 
Join Date: Aug 2010
Posts: 1,710
Reputation: 118
Default Re: Gamemode SDK for C/C++ (GDK)

Does anyone manage to fix HTTP crash or find a way to use it ? I'm experiencing crashes or not calling at all. More you can find here https://github.com/Zeex/sampgdk/issues/164
doreto is offline   Reply With Quote
Old 19/08/2016, 06:29 PM   #347
Spmn
Gangsta
 
Join Date: Jun 2015
Location: Romania
Posts: 537
Reputation: 129
Default Re: Gamemode SDK for C/C++ (GDK)

Quote:
Originally Posted by doreto View Post
Does anyone manage to fix HTTP crash or find a way to use it ? I'm experiencing crashes or not calling at all. More you can find here https://github.com/Zeex/sampgdk/issues/164
Did you try to execute that code directly in PAWN? AFAIK HTTP native function is faulty.

Anyway, if you're coding a plugin, why don't you use an advanced library like curl?

// Are you sure HTTP parameters are correct? It seems you lack data param.
(index, type, url[], data[], callback[])
Spmn is offline   Reply With Quote
Old 23/08/2016, 01:54 PM   #348
doreto
High-roller
 
doreto's Avatar
 
Join Date: Aug 2010
Posts: 1,710
Reputation: 118
Default Re: Gamemode SDK for C/C++ (GDK)

It has everything that is required while my callback isn't been called at all. I decided to use SAMP HTTP because of the familiarity and easy of use (cause I'm not so good with C+).
I'm sorry for late comment, but I have a rough week.
doreto is offline   Reply With Quote
Old 13/12/2016, 10:06 PM   #349
Arturo226
Little Clucker
 
Join Date: Oct 2009
Location: England
Posts: 17
Reputation: 0
Default Re: Gamemode SDK for C/C++ (GDK)

After following the instructions on the wiki for setting up a CMake project, every time I try to run the plugin, I get a
Code:
segmentation fault (core dumped)
error. I've tried using crashdetect, however it doesn't return anything meaningful:
Code:
[debug] Server crashed due to an unknown error
[debug] Native backtrace:
[debug] #0 f7390ca0 in _Z13GetStackTraceRSt6vectorI10StackFrameSaIS0_EEPv () from plugins/crashdetect.so
[debug] #1 f7389d22 in _ZN11CrashDetect20PrintNativeBacktraceERSoPv () from plugins/crashdetect.so
[debug] #2 f738a314 in _ZN11CrashDetect20PrintNativeBacktraceEPv () from plugins/crashdetect.so
[debug] #3 f738c964 in _ZN11CrashDetect11OnExceptionEPv () from plugins/crashdetect.so
[debug] #4 f73905cd in ?? () from plugins/crashdetect.so
[debug] #5 f7783bd0 in ?? ()
[debug] #6 f74f152f in ?? () from /lib32/libc.so.6
[debug] #7 f734b3b6 in ?? () from plugins/helloworld.so
[debug] #8 f73e5345 in bsearch () from /lib32/libc.so.6
[debug] #9 f734b42e in ?? () from plugins/helloworld.so
[debug] #10 f734b48b in ?? () from plugins/helloworld.so
[debug] #11 f734b5ae in sampgdk_callback_init () from plugins/helloworld.so
[debug] #12 f7347fde in sampgdk_module_init () from plugins/helloworld.so
[debug] #13 f734cac2 in ?? () from plugins/helloworld.so
[debug] #14 f734cb76 in ?? () from plugins/helloworld.so
[debug] #15 f734cce6 in sampgdk_Load () from plugins/helloworld.so
[debug] #16 f7347f5d in _ZN7sampgdk4LoadEPPv () from plugins/helloworld.so
[debug] #17 f7347ed9 in Load () from plugins/helloworld.so
[debug] #18 080d2742 in ?? () from ./samp03svr
[debug] #19 080d2afa in ?? () from ./samp03svr
[debug] #20 080aa0d0 in ?? () from ./samp03svr
[debug] #21 f73d0637 in __libc_start_main () from /lib32/libc.so.6
[debug] #22 0804b4e1 in ?? () from ./samp03svr
Arturo226 is offline   Reply With Quote
Old 14/01/2017, 12:43 PM   #350
cawfee
Little Clucker
 
cawfee's Avatar
 
Join Date: Oct 2011
Location: United States
Posts: 25
Reputation: 24
Default Re: Gamemode SDK for C/C++ (GDK)

Great plugin!

Why isn't everyone using this?
__________________
cawfee is offline   Reply With Quote
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Gamemode is unknown. When i connect theres no gamemode. Shannon_Brown Server Support 11 09/09/2012 08:49 AM
[GameMode] Brasil Drift Show [BDS] - Primeiro GameMode vitorzero3um PortuguÍs/Portuguese 3 29/02/2012 06:48 PM
[ENG] Ideas for new GameMode [NL] Ideeen voor nieuwe Gamemode Xtreme-Nicole Everything and Nothing 10 10/07/2011 11:20 AM
[ENG] Ideas for new GameMode [NL] Ideeen voor nieuwe GameMode Xtreme-Nicole Help Archive 2 09/07/2011 11:24 AM


All times are GMT. The time now is 01:42 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.