Raised This Month: $ Target: $400
 0% 

Hud message help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Legendp
New Member
Join Date: May 2014
Old 05-28-2014 , 08:30   Hud message help
Reply With Quote #1

delete

Last edited by Legendp; 05-30-2014 at 17:56.
Legendp is offline
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 05-28-2014 , 09:07   Re: Hud message help
Reply With Quote #2

Quote:
Originally Posted by Legendp View Post
PHP Code:
#include <amxmodx> 
#include <hamsandwich> 
#include <engine> 

#define VERSION "1.0" 

new Float:MinsMaxs[2][3][3

new 
iTotalZones 

public plugin_init() { 
    
register_plugin("NoKillZones",VERSION,"Firippu"
     
    new 
file[40],configsdir[24
    
get_localinfo("amxx_configsdir",configsdir,23
    
format(file,39,"%s/NoKillZones.ini",configsdir
     
    new 
fh fopen(file,"rt"
    if(!
fh) { 
        return 
PLUGIN_CONTINUE 
    

     
    new 
szMap[32
    
get_mapname(szMap,31
     
    new 
i,szMapName[32],szTotalZones[3
    while(!
feof(fh)) { 
        static 
szBuffer[49
         
        
fgets(fh,szBuffer,charsmax(szBuffer)) 
         
        if(!
equali(szMap,szMapName)) { 
            
parse(szBuffer,szMapName,charsmax(szMap)) 
             
            if(
equali(szMap,szMapName)) { 
                
szMap szMapName 
            

        } else if(
str_to_num(szTotalZones) == 0) { 
            
parse(szBuffer,szTotalZones,charsmax(szTotalZones)) 
             
            
iTotalZones str_to_num(szTotalZones
        } else if(
iTotalZones>i) { 
            static 
szMins0[8],szMins1[8],szMins2[8],szMaxs0[8],szMaxs1[8],szMaxs2[8
             
            
parse(szBuffer,szMins0,charsmax(szMins0),szMins1,charsmax(szMins1),szMins2,charsmax(szMins2),szMaxs0,charsmax(szMaxs0),szMaxs1,charsmax(szMaxs1),szMaxs2,charsmax(szMaxs2)) 
             
            
MinsMaxs[0][i][0] = str_to_float(szMins0); MinsMaxs[0][i][1] = str_to_float(szMins1); MinsMaxs[0][i][2] = str_to_float(szMins2
            
MinsMaxs[1][i][0] = str_to_float(szMaxs0); MinsMaxs[1][i][1] = str_to_float(szMaxs1); MinsMaxs[1][i][2] = str_to_float(szMaxs2
             
            
i++ 
        } 
    } 
     
    
fclose(fh
     
    if(
iTotalZones != 0) { 
        
RegisterHam(Ham_TakeDamage,"player","fwdTakeDmg"
    } 
     
    return 
PLUGIN_CONTINUE 


public 
fwdTakeDmg(iVictim,iInflictor,iAttacker) { 
    static 
Float:vVictimOrigin[3],Float:vAttackerOrigin[3
     
    
entity_get_vector(iVictim,EV_VEC_origin,vVictimOrigin
    
entity_get_vector(iAttacker,EV_VEC_origin,vAttackerOrigin
     
    for(new 
i=0i<iTotalZonesi++) { 
        if(
CheckZone(i,iVictim,iAttacker,vVictimOrigin,vAttackerOrigin) != 0) { 
            
entity_set_vector(iVictim,EV_VEC_punchangle,Float:{0.0,0.0,0.0}) 
             
            return 
HAM_SUPERCEDE 
        

    } 
     
    return 
HAM_IGNORED 


public 
CheckZone(iZone,iVictim,iAttacker,Float:vVictimOrigin[3],Float:vAttackerOrigin[3]) { 
    if(
vVictimOrigin[0]>MinsMaxs[0][iZone][0] && vVictimOrigin[0]<MinsMaxs[1][iZone][0
    && 
vVictimOrigin[1]>MinsMaxs[0][iZone][1] && vVictimOrigin[1]<MinsMaxs[1][iZone][1
    && 
vVictimOrigin[2]>MinsMaxs[0][iZone][2] && vVictimOrigin[2]<MinsMaxs[1][iZone][2
    || 
vAttackerOrigin[0]>MinsMaxs[0][iZone][0] && vAttackerOrigin[0]<MinsMaxs[1][iZone][0
    && 
vAttackerOrigin[1]>MinsMaxs[0][iZone][1] && vAttackerOrigin[1]<MinsMaxs[1][iZone][1
    && 
vAttackerOrigin[2]>MinsMaxs[0][iZone][2] && vAttackerOrigin[2]<MinsMaxs[1][iZone][2]) { 
        
engclient_print(iAttacker,engprint_center,"You can not do damage here"
        
engclient_print(iVictim,engprint_center,"You are protected here"
         
        return 

    

     
    return 


Hi;
I want to change the on-screen messages hud message (I'm sorry for bad english)
These:
engclient_print(iAttacker,engprint_center,"You can not do damage here")
engclient_print(iVictim,engprint_center,"You are protected here")


okay? change the message between the " " and you're done?
what exactly do you want?
aron9forever is offline
Old 05-28-2014, 09:20
Legendp
This message has been deleted by Legendp.
aron9forever
Veteran Member
Join Date: Feb 2013
Location: Rromania
Old 05-28-2014 , 09:33   Re: Hud message help
Reply With Quote #3

Quote:
Originally Posted by Legendp View Post
PHP Code:
engclient_print(iAttacker,engprint_center,"You can not do damage here"
        
engclient_print(iVictim,engprint_center,"You are protected here"
I want to do Hud message. Red or another color
easiest method is this

set_hudmessage(RED#, GREEN#, BLUE#, x#, y#);
show_hudmessage(id, "I am a hud message");

but I would advise you to use hudsync so channels don't overlap

you can easily create code using amxx studio with instant preview so you don't have to mess around with coordinates and colors
aron9forever is offline
Old 05-28-2014, 09:47
Legendp
This message has been deleted by Legendp.
Old 05-29-2014, 16:46
Legendp
This message has been deleted by YamiKaitou. Reason: wait 14 days before you bump
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 09:37.


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