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

[QUESTION]What is the difference betwen these functions


Post New Thread Reply   
 
Thread Tools Display Modes
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-03-2015 , 16:02   Re: [QUESTION]What is the difference betwen these functions
Reply With Quote #11

You can also use the MAX_PLAYERS constant which is defined for you in 1.8.3, if you are using 1.8.2 or earlier, you'll need to define it yourself
PHP Code:
#define MAX_PLAYERS 32 
__________________

Last edited by Bugsy; 08-03-2015 at 16:02.
Bugsy is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 08-03-2015 , 19:12   Re: [QUESTION]What is the difference betwen these functions
Reply With Quote #12

i have several plugins in which i get run time errors, for example a custom night vision which has something like this

Code:
fw_HamKilled(victim, etc, etc )
{
set_player_lighting(victim)
}
and i use some entities as pets or npc on the server, and i get run time errors and crashes in one case
and i think it might be because the server is trying to set the lighting to the entities...
so how could that example in this case?
Depresie is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-03-2015 , 19:28   Re: [QUESTION]What is the difference betwen these functions
Reply With Quote #13

Ham forwards are registered to a specific entity type so you do not need to check if it's a player since it will only fire for players if that's how you created it. If there are other entities that come through the callback, as with Ham_TakeDamage (ie. inflictor, attacker), then you need to check if they are players.

RegisterHam( Ham_Killed , "player" , "HamKilled" )
__________________

Last edited by Bugsy; 08-03-2015 at 19:29.
Bugsy is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 08-05-2015 , 06:42   Re: [QUESTION]What is the difference betwen these functions
Reply With Quote #14

if this is a thread for questions that don't deserve their own threads
do task IDs from two different plugins conflict?
eg, plugin #1 creates a task with id 7777
plugin #2 checks if task exists then removes it

will it delete the task from the first plugin?
if so, is it possible to avoid this?
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-05-2015 , 07:29   Re: [QUESTION]What is the difference betwen these functions
Reply With Quote #15

Look at the natives parameters, you have your answer there.
__________________
HamletEagle is offline
Bugsy
AMX Mod X Moderator
Join Date: Feb 2005
Location: NJ, USA
Old 08-05-2015 , 08:32   Re: [QUESTION]What is the difference betwen these functions
Reply With Quote #16

Why don't you test this yourself?
__________________
Bugsy is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 08-05-2015 , 10:14   Re: [QUESTION]What is the difference betwen these functions
Reply With Quote #17

probably because he doesn't have a server or a test server now in his pc..
also, it would of been easier for all of us if the answer would of been just yes or no..
you guys must understand that answering these kind of questions would not only help the one who is asking, but the other newbies around the forum...

i think we should have a sticky topic with these kind of questions, so newbies can search or ask this kind of stuff to avoid countless threads

@aron

i think the answer is no... since usualy you have to create a native for plugins to communicate with each other..

Last edited by Depresie; 08-05-2015 at 10:15.
Depresie is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 08-05-2015 , 11:04   Re: [QUESTION]What is the difference betwen these functions
Reply With Quote #18

My answer was exactly what you need. But, if you are too lazy to check the wiki/open an include file how do you expect to learn ? Someone can't give you all the answers everytime.

And yes, such page exists...it's the function list.

http://www.amxmodx.org/api/amxmodx/task_exists
http://www.amxmodx.org/api/amxmodx/remove_task

Quote:
outside: Will remove tasks set by other plugins if nonzero
You guys must understand that documentation is available for a purpose and you should check it, because it helps.
__________________

Last edited by HamletEagle; 08-05-2015 at 11:10.
HamletEagle is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 08-05-2015 , 11:20   Re: [QUESTION]What is the difference betwen these functions
Reply With Quote #19

So is there any way to stop other plugin's from stopping my task?
I see no params at set_task to make it unstoppable(kek)


Also ham, consider the amount of work it took you to write all these long replies and compare it to how much it would have taken you to just simply answer "no, unless specified". I might have taken the hint and looked at the docs, but not everyone is a bookworm.
Also notice I wrote some specific keywords in my question, because I could have simply asked "can a plugin remove a task set by another plugin?". I wrote "task" "id" "conflict" because that's what somebody would search on google, and that's how they'd land on this site.

After all, you're not obligated to reply to these threads or posts so don't complain if people post something you personally think is useless. Either someone else will reply or the thread will just get washed away
__________________
Meanwhile, in 2050:
Quote:
Originally Posted by aron9forever
useless small optimizations
Quote:
Originally Posted by Black Rose View Post
On a map that is 512x512x128 units you end up with 3,355,443,200,000 different "positions". To store each one of those positions individually in the variable "user_or" you need 12 terabytes of memory.
aron9forever is offline
Depresie
Veteran Member
Join Date: Nov 2013
Old 08-07-2015 , 16:00   Re: [QUESTION]What is the difference betwen these functions
Reply With Quote #20

@Hamlet
Sometimes the documentation doesn't explain things very well, or some of us doesn't have the knowledge to fully understand it so dont be mean Deagle )

Last edited by Depresie; 08-07-2015 at 16:00.
Depresie 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 06:35.


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