Raised This Month: $32 Target: $400
 8% 

HudMessage Showing Speed helpp


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Ognjen7
Junior Member
Join Date: Nov 2015
Old 04-23-2016 , 13:03   HudMessage Showing Speed helpp
Reply With Quote #1

I was watching on some servers that in hud status they have this:

[Speed: 0] - if u running speed will be increased more
[Speed: 100 - 200] ....

I was looking at forum but i cant find how to add that on my hud status ...

PLS HELP
Ognjen7 is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 04-23-2016 , 13:23   Re: HudMessage Showing Speed helpp
Reply With Quote #2

PHP Code:
    static itarget
    
static Float:velocity[3]
    static 
Float:speedFloat:speedh
    
    
for(i=1i<=maxplayersi++)
    {
        if(!
is_user_connected(i)) continue
        if(!
plrSpeed[i]) continue
        
        
target pev(ipev_iuser1) == pev(ipev_iuser2) : i
        pev
(targetpev_velocityvelocity)

        
speed vector_length(velocity)
        
speedh floatsqroot(floatpower(velocity[0], 2.0) + floatpower(velocity[1], 2.0))
        
        
set_hudmessage(rgb, -1.00.700.0FREQ0.010.0)
        
ShowSyncHudMsg(iSyncHud"~SPEED~^n%3.2f"speedspeedh)
    } 
__________________
Artifact is offline
Ognjen7
Junior Member
Join Date: Nov 2015
Old 04-23-2016 , 14:11   Re: HudMessage Showing Speed helpp
Reply With Quote #3

Like in this hud ? How to put

Code:
public PokaziInformacije(id) 
{
	id -= ZADATAK_POKAZI_INFORMACIJE;
	
	set_task(0.1, "PokaziInformacije", id+ZADATAK_POKAZI_INFORMACIJE);
		
	if(!is_user_alive(id))
	{
		new target = entity_get_int(id, EV_INT_iuser2)
		
		if(target == 0)
		{
			return PLUGIN_CONTINUE
		}
	
		set_hudmessage(200, 250, 0, 0.6, -1.0, 0, 0.0, 0.3, 0.0, 0.0, 2);
		ShowSyncHudMsg(id, SyncHudObj, "-=[Class : %s]=-^n-=[EXP : %i / %i]=-^n-=[Level : %i]=-^n-=[Perk : %s]=-^n-=[Srebra : %i]=-^n-=[Money : %d $]=-^n-=[Speed : %f]=-^n-=UnReal - COD=-", naziv_klase[klasa_igraca[target]], iskustvo_igraca[target], iskustvo_levelu[level_igraca[target]], level_igraca[target], naziv_predmeta[informacije_predmet_igraca[target][0]], shop_poeni[id], cs_get_user_money(target));
		
		return PLUGIN_CONTINUE;
	}
	set_hudmessage(200, 250, 0, 0.02, 0.23, 0, 0.0, 0.3, 0.0, 0.0);
	ShowSyncHudMsg(id, SyncHudObj, "-=[Class : %s]=-^n-=[EXP : %i / %i]=-^n-=[Level : %i]=-^n-=[Perk : %s]=-^n-=[Srebra : %i]=-^n-=[Money : %d $]=-^n-=[Speed : %f]=-^n-=UnReal - COD=-", naziv_klase[klasa_igraca[id]], iskustvo_igraca[id], iskustvo_levelu[level_igraca[id]], level_igraca[id], naziv_predmeta[informacije_predmet_igraca[id][0]], shop_poeni[id], cs_get_user_money(id));
	return PLUGIN_CONTINUE;
}

Last edited by Ognjen7; 04-23-2016 at 14:12.
Ognjen7 is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 04-24-2016 , 01:28   Re: HudMessage Showing Speed helpp
Reply With Quote #4

You already got in code I post.
BTW it's code for Bob1's "Show Speed" plugin
PHP Code:
ShowSyncHudMsg(iSyncHud"~SPEED~^n%3.2f"speedspeedh
__________________
Artifact is offline
Ognjen7
Junior Member
Join Date: Nov 2015
Old 04-24-2016 , 01:53   Re: HudMessage Showing Speed helpp
Reply With Quote #5

I have 2 errors in compile:

Code:
for(i=1; i<=maxplayers; i++)
if(!plrSpeed[i]) continue
All code looks like this:

Code:
public PokaziInformacije(id) 
{
	static i, target
	static Float:velocity[3]
	static Float:speed, Float:speedh
	
	for(i=1; i<=maxplayers; i++)
	{
		if(!is_user_connected(i)) continue
		if(!plrSpeed[i]) continue
        
		target = pev(i, pev_iuser1) == 4 ? pev(i, pev_iuser2) : i
		pev(target, pev_velocity, velocity)

		speed = vector_length(velocity)
		speedh = floatsqroot(floatpower(velocity[0], 2.0) + floatpower(velocity[1], 2.0))
	
		id -= ZADATAK_POKAZI_INFORMACIJE;
	
		set_task(0.1, "PokaziInformacije", id+ZADATAK_POKAZI_INFORMACIJE);
		
		if(!is_user_alive(id))
		{
			new target = entity_get_int(id, EV_INT_iuser2)
		
		if(target == 0)
		{
			return PLUGIN_CONTINUE
		}
	
		set_hudmessage(200, 250, 0, 0.6, -1.0, 0, 0.0, 0.3, 0.0, 0.0, 2);
		ShowSyncHudMsg(id, SyncHudObj, "-=[Class : %s]=-^n-=[EXP : %i / %i]=-^n-=[Level : %i]=-^n-=[Perk : %s]=-^n-=[Srebra : %i]=-^n-=[Money : %d $]=-^n-=[Speed : %f]=-^n-=UnReal - COD=-", naziv_klase[klasa_igraca[target]], iskustvo_igraca[target], iskustvo_levelu[level_igraca[target]], level_igraca[target], naziv_predmeta[informacije_predmet_igraca[target][0]], shop_poeni[id], cs_get_user_money(target));
		
		return PLUGIN_CONTINUE;
	}
	set_hudmessage(200, 250, 0, 0.02, 0.23, 0, 0.0, 0.3, 0.0, 0.0);
	ShowSyncHudMsg(id, SyncHudObj, "-=[Class : %s]=-^n-=[EXP : %i / %i]=-^n-=[Level : %i]=-^n-=[HP : %i]=-^n-=[Perk : %s]=-^n-=[Srebra : %i]=-^n-=[Money : %d $]=-^n-=[Speed : %f]=-^n-=UnReal - COD=-", naziv_klase[klasa_igraca[id]], iskustvo_igraca[id], iskustvo_levelu[level_igraca[id]], level_igraca[id], naziv_predmeta[informacije_predmet_igraca[id][0]], shop_poeni[id], cs_get_user_money(id), get_user_health(id));
	return PLUGIN_CONTINUE;
}
Ognjen7 is offline
Artifact
Veteran Member
Join Date: Jul 2010
Old 04-24-2016 , 03:06   Re: HudMessage Showing Speed helpp
Reply With Quote #6

Under includes
PHP Code:
new bool:plrSpeed[33
and in plugin init
PHP Code:
new maxplayers get_maxplayers() 
__________________

Last edited by Artifact; 04-24-2016 at 03:06.
Artifact is offline
Reply


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 23:59.


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