[HELP] alive vs. dead (is_user_alive)
I am not a good programmer, so please don't judge me :)
Ok I wrote that code and I wanted to make it like: when player writes /check in chat: that line starts working: (if player alive) PHP Code:
PHP Code:
PHP Code:
|
Re: [HELP] alive vs. dead (is_user_alive)
PHP Code:
1. You do not need "engine" so no need to include it. 2. In this case its not "register_event" but rather "register_clcmd", since the "say /check" is a command that user is issuing and not an event. (An event would be like "DeathMsg" a.k.a. when someone dies) NOTE: you can also use "register_concmd" but in this case its easier to use "register_clcmd" 3. In the arguments of "CheckerAlive", you are NOT obliged to put "id", you can name it whatever you want, in this case you want to name it "user" so the word "user" is good by it self. 4. When using if/else structure means that if the condition stated is not met do everything inside "else", but if the condition is met then do everything inside "if" (when i say inside i mean the body). In this case you are saying that IF user is alive do PHP Code:
PHP Code:
PHP Code:
So, PHP Code:
PHP Code:
|
Re: [HELP] alive vs. dead (is_user_alive)
Quote:
|
Re: [HELP] alive vs. dead (is_user_alive)
I have already gave you the working plugin. No need to write it again O.o
|
Re: [HELP] alive vs. dead (is_user_alive)
Quote:
What about this one? PHP Code:
I am confused.. |
Re: [HELP] alive vs. dead (is_user_alive)
Alright first if all there is no use checking if the player is alive or not, because when u used this:
PHP Code:
Second, these WILL NOT work: PHP Code:
so change all "player" to "user". I am pretty sure you copied and pasted this code from somewhere and its not a good habit. Third you do not need the return, remove it. |
| All times are GMT -4. The time now is 20:32. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.