AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Suggestions / Requests (https://forums.alliedmods.net/forumdisplay.php?f=12)
-   -   Solved Plugin that gives a hp (https://forums.alliedmods.net/showthread.php?t=342763)

F.B.ID3M0N 05-12-2023 00:42

Plugin that gives a hp
 
Hi i nead plugin/code that gives a player 5 hp after 5 sec and i nead to add it to my vip plugin

lexzor 05-12-2023 08:33

Re: Plugin that gives a hp
 
PHP Code:

#include <amxmodx>
#include <fun>

#define FLAG_VIP "t"

#if !defined client_disconnected
    #define client_disconnected client_disconnect
#endif

const TASK_HP 1523

public plugin_putinserver(id)
{
    if(
get_user_flags(id) & read_flags(FLAG_VIP) && !is_user_hltv(id) && !is_user_bot(id))
    {
        
set_task(5.0"addHealth"id TASK_HP, .flags="b")   
    }
}

public 
client_disconnected(id)
{
    if(
task_exists(id TASK_HP))
    {
        
remove_task(id TASK_HP)
    }
}

public 
addHealth(id)
{
    
id -= TASK_HP

    
if(is_user_alive(id))
    {
        
set_user_health(idget_user_health(id) + 5)
    }


you can delete this line if you have a version of amxx higher than 182

PHP Code:

#if !defined client_disconnected
    #define client_disconnected client_disconnect
#endif 


F.B.ID3M0N 05-12-2023 11:32

Re: Plugin that gives a hp
 
It say Undefined symbol "task_Exists"

lexzor 05-12-2023 12:17

Re: Plugin that gives a hp
 
try now

F.B.ID3M0N 05-12-2023 13:38

Re: Plugin that gives a hp
 
i acidently caped E now work thanks(sry for bad english)


All times are GMT -4. The time now is 05:17.

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