distance between 2 players
how can i code that when a terrorist comes into the kniferange of a counterterrorist he gets slapped and when he leaves from his kniferange he stops being slapped.
and in what function could i use that best becous it should constantly check this. kniferange being an amount in units set up through a cvar |
Re: distance between 2 players
Try it ;)
PHP Code:
|
Re: distance between 2 players
Quote:
You know that the condition is called after every loop iteration, so you are calling that function as many times as the number of entities it returns. Very inefficient. Call it once before the loop and store the return in a variable. Then use the variable in the condition. |
Re: distance between 2 players
Hm ur right, stupid..
Anyway, updated. |
Re: distance between 2 players
Nice thx it works but i think it might have some issues, look this is what happend when (i think) he got slapped to much. also I was on terrorist team and a bot was on ct team and the bot got slapped. is that only with bots? if it is then there is no problem :)
Tested it on my local dedicated server (windows). I'm not sure but this might be solved if we change the uberslap to normal slap not sure though [IMG]http://img571.**************/img571/6942/slapradius.png[/IMG] also can you make it so that along with the slap a bit turns high when a player is inside the range and low again if he leaves the range. merci voor de hulp ;) greets. |
Re: distance between 2 players
Firewall shouldn't have anything todo with it, I think.
PHP Code:
I didn't rlly get what u needed, if u want. Just type in in 'Dutch' for me :p |
Re: distance between 2 players
ok nice thx.
I'l explain in dutch then ;) waarvoor ik die code uiteindelijk wil gebruiken is voor een anti freekill systeem voor jailbreak. als een terrorist in de buurt komt van een cipier(ct) dan moet een bit hoog worden dat die terrorist aan het rebellen is zodanig dat als de cipier hem dood hij niet gestraft word voor freekilling snapje? Ik weet wel niet hoe je de bit terug laag moet maken als de ter uit de range van de ct komt. alsje wil kan ik mijn hele jb plugin doorsturen als dat zou helpen. Ik moet je nieuwe code nog testen maar ik denk dat het al aardig goed zal lukken. zal vanavond nog testen, moet straks ergens naartoe. Ik hoop dat dat een beetje goed uitgelegd is :), anders moet je het maar vragen he. alvast bedankt! greets. |
Re: distance between 2 players
So you want, that when a Prisoner comes close to a Guard, he goes in the sky a lille?
When he goes back away from Guard, he goes back to the ground? |
Re: distance between 2 players
no not really the slap is a lil extra that im not sure yet if i will use it,
but if a terrorists comes close to the guard a bit have to be set and when the terrorist moves away, out of range of the ct the bit has to turn low again. then when a guard has killed a terrorists I am gonna check first if that terrorist was close to that ct by checking the bit. for example lets name that bit g_bRebelRange. If that bit was high the moment the terrorists got killed by the ct then the ct did not freekill him, but if the bit for that terrorist was low and other conditions that check if he rebeled where low too then the ct has +1 freekill, this is the function that I will add this statement to: PHP Code:
|
Re: distance between 2 players
Isn't it better then to check distance from killer & victim
and if distance between T & CT is lower then 100 it isn't freekill? |
| All times are GMT -4. The time now is 00:30. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.