Why does this plugin makes the server crash?
Hello. The following plugin makes it possible for bots to be forced to buy items from the humans' Extra Items menu:
PHP Code:
Code:
// Items name (note: add exact item name)If you are going to help me, don't forget to explain to me what code(s) exactly you edited, so i can learn for myself. Thanks. |
Re: Why does this plugin makes the server crash?
Because there are some potential loopholes in your loops causing it to be stuck in an infinite loop.
And whats with your get_random_bot logerthem ? Same for get_alive_bots both of them are invalid! |
Re: Why does this plugin makes the server crash?
Skip the other game modes too + what natsheh said above.
Code:
Code:
Not tested. |
Re: Why does this plugin makes the server crash?
Quote:
What? |
Re: Why does this plugin makes the server crash?
Quote:
|
Re: Why does this plugin makes the server crash?
Don't use that plugin, it's complete garbage and I know, I'm the author. Use this one, will work on any game mode.
Code:
#include <amxmodx> |
Re: Why does this plugin makes the server crash?
Here a better + fixed function to get a random bot with no replication!!
I saw alot of coders struggle to create such function there you go, try understanding... PHP Code:
This how to use inside the following function... PHP Code:
|
Re: Why does this plugin makes the server crash?
Your code is not right either, it is not even working.
Code:
0. random bot id -> 9 |
Re: Why does this plugin makes the server crash?
Show your test code..
Also i hope you noticed i am using break in the loop if no bots were found! Also i don't see it as a problem calling get_players 30 times if you wish to call it less add two new parameters to the function iPlayers and iNum or create both of them globally but you know i just made it easy to use. And TBH its not recommended to be used in a loop. You can use a repeated task to give each bot a new extra item. Like the following... PHP Code:
For the OP use the code from crazy's in post #6 |
Re: Why does this plugin makes the server crash?
Thank you for all your answers intended to help me.
Okay, CrazY., I will use the second plugin you gave me. I will test it, and I will reply if it's working properly. By the way, are you aware that the same bot can't buy extra items more than once during one round? For example, if a bot buys the Plasma Gun, then the bot gets infected and then humanized by an admin or buys an antidote, then the same bot will not be able to buy Plasma Gun, again, or any other item mentioned in this code: Code:
// Items name (note: add exact item name)The bots I use have the "buy an antidote" function built-in, so I haven't added the Antidote in "// Items name" section of your plugin. Is the problem coming from the fact the antidote usage is built-in in the .dll file that controls the bots? Also, will the new plugin give extra items to humans and zombies, or only to humans? Will the plugin give extra items during any game mode, or only during normal infection mode? I ask this question, because I don't see any checks intended to return the plugin's function if X game mode is detected. For example, the second plugin doesn't contain code like this: Code:
public zp_round_started(gamemode, id) |
| All times are GMT -4. The time now is 11:30. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.