How can i make a command that checks the speed, and if the speed is over 220 then he autowarn the user. I thought that i can use !speed to calculate the speed, but i dont know i i can check if the speed is over 220.
Can someone help me?
Alias:
Quotealias vcmp.speed {
var %x = $vcmp.location($1,x),%y = $vcmp.location($1,y),%z = $vcmp.location($1,z),%a = $calc(%x - $2),%b = $calc(%y - $3),%c = $calc(%z - $4),%d = $round($sqrt($calc(%a * %a + %b * %b + %c * %c)),2)
vcmp.say $vcmp.name($1) - Speed: $round($calc(%d / 0.27777778),2) Kilometers Per Hour
if $round($calc(%d / 0.27777778),2) is higher then 200 {
vcmp.warn .....
}
}
Quote
alias vcmp.speed {
var %x = $vcmp.location($1,x),%y = $vcmp.location($1,y),%z = $vcmp.location($1,z),%a = $calc(%x - $2),%b = $calc(%y - $3),%c = $calc(%z - $4),%d = $round($sqrt($calc(%a * %a + %b * %b + %c * %c)),2)
vcmp.say $vcmp.name($1) - Speed: $round($calc(%d / 0.27777778),2) Kilometers Per Hour
if ($round($calc(%d / 0.27777778),2) > 200) {
vcmp.warn .....
}
}
That should work...
ok thank you, but when i have this code:
Quotealias vcmp.speed {
var %name = $vcmp.name($1)
var %x = $vcmp.location($1,x),%y = $vcmp.location($1,y),%z = $vcmp.location($1,z),%a = $calc(%x - $2),%b = $calc(%y - $3),%c = $calc(%z - $4),%d = $round($sqrt($calc(%a * %a + %b * %b + %c * %c)),2)
vcmp.say $vcmp.name($1) - Speed: $round($calc(%d / 0.27777778),2) Kilometers Per Hour
if $round($calc(%d / 0.27777778),2) > 200 {
vcmp.warn %name Server To high speed
}
it says (when im driving to fast):
Unknow - New Warns: 1/3 , Reason: to hight speed , By Admin: thijn
Why can't he know the name?
but when "unknow" have 3 warnings, i was kicked??
so he know that its me that's speeding but he dont show it ??? ???
dont think you need %name should be:
alias vcmp.speed {
var %x = $vcmp.location($1,x),%y = $vcmp.location($1,y),%z = $vcmp.location($1,z),%a = $calc(%x - $2),%b = $calc(%y - $3),%c = $calc(%z - $4),%d = $round($sqrt($calc(%a * %a + %b * %b + %c * %c)),2)
vcmp.say $vcmp.name($1) - Speed: $round($calc(%d / 0.27777778),2) Kilometers Per Hour
if ($round($calc(%d / 0.27777778),2) > 200) {
vcmp.warn $1 Server To high speed
}
}
Note: UNTESTED!
TESTED, it works
Thanks