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

crash after callfunc_end


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 06-29-2023 , 04:56   crash after callfunc_end
Reply With Quote #1

I am trying call the register_item function from Plugin A in Plugin B
  • The server just crash without any log or error dialog after callfunc_end(),
  • It did print out "Test" on server console before crashing => So it did reach the function but crash upon calling callfunc_end()
  • It need it to be in plugin_natives because I want to register it before plugin_precache, preventing the plugin from precaching resources of that plugin

PHP Code:
public register_item(const Name[])
{
    
server_print(Name);

PHP Code:
public plugin_natives()
{
    
callfunc_begin("register_item""PluginB.amxx")
    
callfunc_push_str("Test")
    
callfunc_end()

edit: This is the exception shown in mini-dump after the server crash
__________________
My plugin:

Last edited by Celena Luna; 06-29-2023 at 06:08.
Celena Luna is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 06-30-2023 , 00:54   Re: crash after callfunc_end
Reply With Quote #2

* I guess the error is because plugin B is loaded after plugin A

* you can just remove the precache plugin you want to disable

* It may also be that you are doing it in plugin_natives, I think it only works once inside the server, plugin_init, natives and precache are started before.

callfunc_begin**

"This only sets up the function call and covers the pre-requisites.
Push parameters using the callfunc_push_* set of functions. The call
will be executed only upon using callfunc_end()"

callfunc_push_str**

"This will defy the "const" specifier if copyback is true, which is
only kept for special backwards compatibility."

Last edited by MrPickles; 06-30-2023 at 01:00.
MrPickles is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 06-30-2023 , 04:52   Re: crash after callfunc_end
Reply With Quote #3

Quote:
Originally Posted by MrPickles View Post
* I guess the error is because plugin B is loaded after plugin A
I make sure for it to load in specific order
PluginMain.amxx => PluginRegistered.amxx => PluginEnd.amxx

Quote:
Originally Posted by MrPickles View Post
* you can just remove the precache plugin you want to disable
The whole point is to pause it before the resource is precache when condition are met

Quote:
Originally Posted by MrPickles View Post
* It may also be that you are doing it in plugin_natives, I think it only works once inside the server, plugin_init, natives and precache are started before.
I need to register all the basic infomation like name and cost, then save them in an dynamic array and do the selection function to select which item will stay and which will be disabled.
So it need to be done before plugins_precache and only plugin_native is the only one before it.
__________________
My plugin:
Celena Luna is offline
MrPickles
Senior Member
Join Date: Aug 2022
Location: Colombia
Old 07-01-2023 , 20:12   Re: crash after callfunc_end
Reply With Quote #4

Quote:
Originally Posted by Celena Luna View Post
The whole point is to pause it before the resource is precache when condition are met
I don't understand, don't you have the source code to be able to remove the plugin_precache?
MrPickles is offline
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 07-05-2023 , 14:19   Re: crash after callfunc_end
Reply With Quote #5

I would have used pfn_keyvalue instead of native. It has it's own nuances but it comes before precache.
DJEarthQuake is offline
Celena Luna
Veteran Member
Join Date: Aug 2013
Location: Nagazora
Old 07-05-2023 , 21:37   Re: crash after callfunc_end
Reply With Quote #6

Quote:
Originally Posted by MrPickles View Post
I don't understand, don't you have the source code to be able to remove the plugin_precache?
No, I want it to dynamicly replace item each map even if I added 100 of them. It is kind of greedy but it is possible

Quote:
Originally Posted by DJEarthQuake View Post
I would have used pfn_keyvalue instead of native. It has it's own nuances but it comes before precache.
I wil try with it. Thank you
__________________
My plugin:
Celena Luna is offline
Natsheh
Veteran Member
Join Date: Sep 2012
Old 07-06-2023 , 06:54   Re: crash after callfunc_end
Reply With Quote #7

It seems you're trying to access a memory address not located in the game memory allocations.

TIP: check for index out of bounds errors.
__________________
@Jailbreak Main Mod v2.7.0 100%
@User Tag Prefix 100% done !
@Mystery Box 100% done !
@VIP System 100% done !


Last edited by Natsheh; 07-06-2023 at 06:54.
Natsheh is offline
Send a message via MSN to Natsheh Send a message via Skype™ to Natsheh
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 16:49.


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