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

Solved if(!is_user_alive(id))


Post New Thread Reply   
 
Thread Tools Display Modes
fysiks
Veteran Member
Join Date: Sep 2007
Location: Flatland, USA
Old 05-25-2018 , 23:37   Re: if(!is_user_alive(id))
Reply With Quote #11

Quote:
Originally Posted by iceeedr View Post
You do not need to check if the player is connected if is checking if he is alive.

Correct me if I'm wrong, PLEASE KKKK
That is only true if you are checking if the player is alive. The logic doesn't work if you are checking if the player is NOT alive.

If the player is not connected then is_user_alive() will return false. But, you don't know if the player is simply dead or if the player is not connected. If the player is not connected then you shouldn't be calling any functions on that player. So, if you only use !is_user_alive() then it's possible that you are trying to execute commands on a player that isn't even in the server.
__________________

Last edited by fysiks; 05-25-2018 at 23:41.
fysiks is offline
Old 05-25-2018, 23:54
shadow728988
This message has been deleted by shadow728988. Reason: replying again
shadow728988
Member
Join Date: Sep 2017
Old 05-25-2018 , 23:58   Re: if(!is_user_alive(id))
Reply With Quote #12

Quote:
Originally Posted by iceeedr View Post
Explain your idea better, I could not understand ...
so the plugin displays a hud whenever a player dies which might get annoying after some rounds.
So can there be a cmd (/hoff) that turns off the hud for that particular player.
shadow728988 is offline
shadow728988
Member
Join Date: Sep 2017
Old 05-25-2018 , 23:59   Re: if(!is_user_alive(id))
Reply With Quote #13

i tried all the logics that i can think of but couldnt succeed
shadow728988 is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 05-26-2018 , 00:13   Re: if(!is_user_alive(id))
Reply With Quote #14

Quote:
Originally Posted by shadow728988 View Post
i tried all the logics that i can think of but couldnt succeed
Try harder.
Hint: use an array like CommadEnabled[33] and then do CommandEnabled[id]
__________________
HamletEagle is offline
iceeedr
Veteran Member
Join Date: Apr 2017
Location: Brazil
Old 05-26-2018 , 00:53   Re: if(!is_user_alive(id))
Reply With Quote #15

You're absolutely right, forgive me for my mistake.
iceeedr is offline
Send a message via Skype™ to iceeedr
CrazY.
Veteran Member
Join Date: May 2015
Location: SP, Brazil
Old 05-26-2018 , 09:23   Re: if(!is_user_alive(id))
Reply With Quote #16

Quote:
Originally Posted by HamletEagle View Post
Hint: use an array like CommadEnabled[33] and then do CommandEnabled[id]
What the... @OP, just try something like this:

Spoiler


or also:

Spoiler
__________________









Last edited by CrazY.; 05-26-2018 at 09:24.
CrazY. is offline
shadow728988
Member
Join Date: Sep 2017
Old 05-26-2018 , 23:38   Re: if(!is_user_alive(id))
Reply With Quote #17

Code:
public taskShowHud(iTaskId)
{
    if (is_user_connected(ID_SHOWHUD) && !is_user_alive(ID_SHOWHUD))
    {
        set_dhudmessage(178, 21, 236, -1.0, 0.20, 0, 1.0, 5.0, 0.1, 0.2);
        show_dhudmessage(ID_SHOWHUD, "NEW IPS HERE");
    }
}
expression has no effect..i dont know why everything seems fine
shadow728988 is offline
shadow728988
Member
Join Date: Sep 2017
Old 05-26-2018 , 23:59   Re: if(!is_user_alive(id))
Reply With Quote #18

nevermind remove_task(id) worked for me thank you for all the help
shadow728988 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 19:45.


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