View Single Post
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 12-09-2020 , 22:10   Re: how to change this (add item into a menu)
Reply With Quote #35

Quote:
Originally Posted by fysiks View Post
Well, I can't see what would be causing that. Maybe try disabling all plugins that are not required for this plugin to run and see what happens. If it still happens, you'll need to add debugging code to the plugin to find out what code is being executed when the crash occurs. I use server_print() when I have direct access to the console so that I can see the output even after it crashes. You should be able to find out how far you get into the code before a crash so that you can rule out any code that was successful. It is also very helpful to include the values of various variables in the print message to understand what values are actually being used.

You can also comment out function calls as a way to locate the failure. For example, you can comment out _give_Jetpack(id) in cmd_BuySurfJetpack() and then buy a jetpack and see if it still happens.

P.S. the PLUGIN_* constants are specifically for functions registered with a register_* function (if there are other proper use cases, I can't remember them off the top of my head). So, you shouldn't use these in your native functions. If you are not intending to use the value being returned by the native, then you should return with no value specified. If you want to return a specific value for plugins to use, you can do that too but it shouldn't be the PLUGIN_* constants.
Maybe #pragma dynamic?
__________________


Quote:
Originally Posted by fysiks View Post
Please stop trying to help. You appear to just be posting random stuff. Wait until you actually understand more about AMX Mod X and how the game works.
https://iceeedr.com.br/
iceeedr is offline
Send a message via Skype™ to iceeedr