AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting Help (https://forums.alliedmods.net/forumdisplay.php?f=11)
-   -   Hit to map (https://forums.alliedmods.net/showthread.php?t=244149)

xPossible 07-14-2014 10:01

Hit to map
 
How check when player do hit to part of map with damage or without damage?

My code, but it doesnt work.... Help, somebody...

Code:

#include <amxmodx>
#include <amxmisc>
#include <fakemeta>

#define PLUGIN        "Hit to map"
#define VERSION        "0.1"
#define AUTHOR        "xPossible"

public plugin_init()
{
        register_plugin(PLUGIN, VERSION, AUTHOR);
       
        register_forward(FM_TraceLine, "traceline_forward");
}

public traceline_forward(Float:start[3], Float:end[3], conditions, id, trace)
{
        if (!is_user_alive(id))
                return FMRES_IGNORED;

        if (!(pev(id, pev_button) & (IN_ATTACK | IN_ATTACK2)))
                return FMRES_IGNORED;
       
        new hit = get_tr2(trace, TR_pHit);
       
        if (hit == 0)
                client_print(id, print_chat, "Your victim is MAP! You hit a map!");

        return FMRES_IGNORED;
}



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

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