Raised This Month: $ Target: $400
 0% 

Plugin not compile [ZPS]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
ORdli
Member
Join Date: Nov 2021
Old 01-23-2024 , 20:13   Re: Plugin not compile [ZPS]
Reply With Quote #16

Quote:
Originally Posted by Bacardi View Post
I made this. And tested.

PHP Code:
#include <sdktools>


// settings for m_takedamage
#define    DAMAGE_NO                0
#define DAMAGE_EVENTS_ONLY        1        // Call damage functions, but don't modify health
#define    DAMAGE_YES                2
#define    DAMAGE_AIM                3



public void OnPluginStart()
{


    
HookEventEx("player_connect"player_connect);

    for(
int i 1<= MaxClientsi++)
    {
        if(
IsClientInGame(i))
            
CreateTimer(0.8player_timerGetClientUserId(i), TIMER_REPEAT);
    }
}

public 
void player_connect(Event event, const char[] namebool dontBroadcast)
{
    
CreateTimer(0.8player_timerevent.GetInt("userid"0), TIMER_REPEAT);
}

public 
Action player_timer(Handle timerany userid)
{
    static 
bool hint[MAXPLAYERS+1];

    if(
userid == 0)
        return 
Plugin_Stop;


    
int client GetClientOfUserId(userid);

    if(
client == 0)
        return 
Plugin_Stop;

    if(!
IsClientInGame(client) || IsFakeClient(client))
    {
        
hint[client] = false;
        return 
Plugin_Continue;
    }


    
float eyepos[3], eyeangle[3], startpos[3], endpos[3];

    
GetClientEyePosition(clienteyepos);
    
GetClientEyeAngles(clienteyeangle);

    
GetAngleVectors(eyeanglestartposNULL_VECTORNULL_VECTOR);
    
ScaleVector(startpos10.0);
    
AddVectors(startposeyeposstartpos);

    
GetAngleVectors(eyeangleendposNULL_VECTORNULL_VECTOR);
    
ScaleVector(endpos160.0);
    
AddVectors(endposeyeposendpos);


    
TR_TraceHullFilter(startposendpos, {-4.0,-4.0,-4.0}, {4.0,4.0,4.0}, MASK_SHOT_HULLTraceFilterclient);
    
int entity TR_GetEntityIndex();

    if(
entity MaxClients)
    {
        if(
hint[client])
        {
            
hint[client] = false;
            
PrintCenterText(client" ");
        }

        return 
Plugin_Continue;
    }

    
char clsname[MAX_NAME_LENGTH];
    
GetEntityClassname(entityclsnamesizeof(clsname));

    
//PrintToServer("clsname %s %i %i", clsname, GetEntProp(entity, Prop_Data, "m_takedamage"), entity);

    
if(!HasEntProp(entityProp_Data"m_takedamage")
    || 
GetEntProp(entityProp_Data"m_takedamage") <= DAMAGE_NO
    
|| !HasEntProp(entityProp_Data"m_iHealth")
    || 
GetEntProp(entityProp_Data"m_iHealth") <= 0)
    {

        if(
hint[client])
        {
            
hint[client] = false;
            
PrintCenterText(client" ");
        }

        return 
Plugin_Continue;
    }

    
hint[client] = true;


    
PrintCenterText(client "HEALTH\n %d" GetEntProp(entityProp_Data"m_iHealth"));

    return 
Plugin_Continue;
}

public 
bool TraceFilter(int entityint contentsMaskany data)
{
    return (
entity != data);


Worked! Thanks!
ORdli is offline
 


Thread Tools
Display Modes

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 05:02.


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