Raised This Month: $ Target: $400
 0% 

[solved]add a distance to client


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Dr.G
Senior Member
Join Date: Nov 2008
Old 03-26-2009 , 09:48   [solved]add a distance to client
Reply With Quote #1

how should the array or what its called, g_noscope_counter_dist[33] look for being correct or working hehe, to hold Distance.


Code:
new g_noscope_counter_dist[33]
 
public plugin_init() 
{
 register_plugin(PLUGIN, VERSION, AUTHOR)
 
 RegisterHam(Ham_Killed, "player", "func_Ham_Killed")
}
 
 
public func_Ham_Killed(id, iAttacker, shouldgib)
{
 new Float: vOrigin[3], Float: aOrigin[3], Float: Distance
 
 pev(id, pev_origin, vOrigin )
 pev(iAttacker, pev_origin, aOrigin )
 
 Distance = fm_get_distance(vOrigin, aOrigin)
 
 if(g_noscope_counter_dist[iAttacker] < Distance)
 {
  g_noscope_counter_dist[iAttacker] = Distance
  client_print(iAttacker, print_chat, "[%s] Your best unscoped kill was done over %.1f meters", g_noscope_counter_dist[id])
 } 
}
 
 
Float:fm_get_distance( Float: Origin1[3], Float: Origin2[3])
{
 new Float: fdistance = get_distance_f(Origin1, Origin2)
 return (fdistance*0.0254)
}

thanks in advance
__________________

Last edited by Dr.G; 03-26-2009 at 13:04.
Dr.G is offline
Dores
Veteran Member
Join Date: Jun 2008
Location: You really don't wanna k
Old 03-26-2009 , 10:38   Re: add a distance to client
Reply With Quote #2

There's a mistake here:

PHP Code:
client_print(iAttackerprint_chat"[%s] Your best unscoped kill was done over %.1f meters"g_noscope_counter_dist[id])

--->

client_print(iAttackerprint_chat"[%s] Your best unscoped kill was done over %.1f meters"g_noscope_counter_dist[iAttacker]) 
__________________
O o
/Ż________________________
| IMMA FIRIN' MAH LAZOR!!!
\_ŻŻŻ
Dores is offline
Dr.G
Senior Member
Join Date: Nov 2008
Old 03-26-2009 , 10:43   Re: add a distance to client
Reply With Quote #3

lol well thats not the problem, the problem is to change g_noscope_counter_dist[33] to something greater. the compiler tell me that this g_noscope_counter_dist[iAttacker] = Distance have a tag mistake
__________________
Dr.G is offline
Dr.G
Senior Member
Join Date: Nov 2008
Old 03-26-2009 , 13:04   Re: add a distance to client
Reply With Quote #4

solved! like this

PHP Code:
new Float:g_noscope_counter_dist[33
lmao
__________________
Dr.G is offline
Emp`
AMX Mod X Plugin Approver
Join Date: Aug 2005
Location: Decapod 10
Old 03-26-2009 , 13:04   Re: [solved]add a distance to client
Reply With Quote #5

Code:
g_noscope_counter_dist[iAttacker] = floatround(Distance)
edit: ya.. you can declare it as a float too...
Emp` is offline
Send a message via AIM to Emp` Send a message via MSN to Emp` Send a message via Yahoo to Emp` Send a message via Skype™ to Emp`
Dr.G
Senior Member
Join Date: Nov 2008
Old 03-26-2009 , 13:24   Re: [solved]add a distance to client
Reply With Quote #6

haha yea thanks anyway Emp'... damn this was stupid
__________________
Dr.G is offline
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:00.


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