Raised This Month: $ Target: $400
 0% 

This plugin crashes my server (natives help!)


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
KaLoIaN
Senior Member
Join Date: Feb 2013
Old 05-15-2016 , 09:41   This plugin crashes my server (natives help!)
Reply With Quote #1

Thanks to everybody
#trashit

Last edited by KaLoIaN; 05-20-2016 at 10:18.
KaLoIaN is offline
Whitez
Member
Join Date: Apr 2016
Location: London, UK
Old 05-15-2016 , 11:42   Re: This plugin crashes my server
Reply With Quote #2

Remove natives and see if it works
Whitez is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 05-15-2016 , 12:47   Re: This plugin crashes my server
Reply With Quote #3

it's probably Nvault causing the crash.
Your save file maybe corrupted.

Last edited by SpeeDeeR; 05-15-2016 at 12:48.
SpeeDeeR is offline
KaLoIaN
Senior Member
Join Date: Feb 2013
Old 05-15-2016 , 15:12   Re: This plugin crashes my server
Reply With Quote #4

No it wasn't from nVault.
It was from the natives , I mean not plugin_natives() the other part of natives idk how it is called in english lol..

what's the problem with them???
When I quoted them - the server stopped crashes?
KaLoIaN is offline
KaLoIaN
Senior Member
Join Date: Feb 2013
Old 05-15-2016 , 15:16   Re: This plugin crashes my server
Reply With Quote #5

The problem is with this native:

/*
public native_get_user_level(id)
{
return g_iLevel[id]
}
*/

All others are not quoted and server is working, when I unquote this one server stops working.
KaLoIaN is offline
SpeeDeeR
Veteran Member
Join Date: Mar 2010
Location: Bulgaria
Old 05-15-2016 , 15:47   Re: This plugin crashes my server
Reply With Quote #6

Use style=0, and look up how the native callback is defined.
https://forums.alliedmods.net/showthread.php?t=41251
SpeeDeeR is offline
Whitez
Member
Join Date: Apr 2016
Location: London, UK
Old 05-15-2016 , 17:04   Re: This plugin crashes my server
Reply With Quote #7

Look up into other similar plugins to see how natives are properly done
By the way, you forgot to register_library in plugin_natives
Whitez is offline
KaLoIaN
Senior Member
Join Date: Feb 2013
Old 05-19-2016 , 09:44   Re: This plugin crashes my server
Reply With Quote #8

Removed

PHP Code:
#include <LevelSystem> 
and added

PHP Code:
    register_library("LevelSystem"
and not worked.

Then 2nd try:

Changed the native to:

PHP Code:
register_native("zp_get_user_level""native_get_user_level"
not worked lol

3rd try:

Changed the native to:

PHP Code:
register_native("zp_get_user_level""native_get_user_level"0
again not worked.

Looked at another plugins and the natives are registered 100% the same way as mine (you can take a look of ZP 4.3 plugin for example it's the same [I've took the example out of there])


The library (LevelSystem):

PHP Code:
native zp_get_user_level(id)
native zp_set_user_level(idamount)

native zp_get_user_exp(id)
native zp_set_user_exp(idamount)

native zp_get_user_reset(id)
native zp_set_user_reset(idamount)

native zp_get_user_boost(id)
native zp_set_user_boost(idamount)

native zp_get_user_escapes(id)
native zp_set_user_escapes(idamount
Any help will be appreciated.


P.S.
The suspicous thing is the server.cfg file is executed twice. How I got that?
I wrote:

PHP Code:
echo Server.CFG Executed
at server.cfg and when start server at console it writes this twice and then the server has crashed.

Last edited by KaLoIaN; 05-19-2016 at 10:18.
KaLoIaN is offline
Black Rose
Veteran Member
Join Date: Feb 2011
Location: Stockholm, Sweden
Old 05-19-2016 , 11:43   Re: This plugin crashes my server (natives help!)
Reply With Quote #9

Code:
public native_get_user_level(id)   {     return g_iLevel[id] } public native_set_user_level(id, amount)   {     g_iLevel[id] = amount }
To make this style 0 you do this:
Code:
public native_get_user_level(PluginID, NumParams) {     return g_iLevel[get_param(1)] } public native_set_user_level(PluginID, NumParams) {     g_iLevel[get_param(1)] = get_param(2) }
__________________

Last edited by Black Rose; 05-19-2016 at 11:44.
Black Rose is offline
KaLoIaN
Senior Member
Join Date: Feb 2013
Old 05-20-2016 , 08:36   Re: This plugin crashes my server (natives help!)
Reply With Quote #10

Quote:
Originally Posted by Black Rose View Post
Code:
public native_get_user_level(id)   {     return g_iLevel[id] } public native_set_user_level(id, amount)   {     g_iLevel[id] = amount }
To make this style 0 you do this:
Code:
public native_get_user_level(PluginID, NumParams) {     return g_iLevel[get_param(1)] } public native_set_user_level(PluginID, NumParams) {     g_iLevel[get_param(1)] = get_param(2) }
Again it crashes...
KaLoIaN 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 12:45.


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