Hello, and wondered how fast your character moves?
Now you can check it out, receiving a precise result!
The script checks walking speed by SQM moves per second!
Advantages:
* Not using storage values / sql database!
* Easy instalation
* Easy command : )
Commands:
* !speed start
* !speed stop
How do use?
* msg at public channel: !speed start
- go walk, do not around or return return back!
* msg at public channel: !speed stop
- To you has been sent text with result!
How do install? - EASY!
1. go to data/lib/ folder and open in editor file "data.lua"
2. add in first line:
3. go to folder data/talkactions/ and open in editor talkactions.xml
4. under: "<talkactions>" add:
5. now go to folder data/talkactions/scripts/ and create file: "speedtest.lua" and past into file this code:
Now you can use script and results:
Now you can check it out, receiving a precise result!
The script checks walking speed by SQM moves per second!
Advantages:
* Not using storage values / sql database!
* Easy instalation
* Easy command : )
Commands:
* !speed start
* !speed stop
How do use?
* msg at public channel: !speed start
- go walk, do not around or return return back!
* msg at public channel: !speed stop
- To you has been sent text with result!
How do install? - EASY!
1. go to data/lib/ folder and open in editor file "data.lua"
2. add in first line:
PHP:
speedTests = {}
4. under: "<talkactions>" add:
PHP:
<talkaction log="yes" access="0" words="!speed" event="script" value="speedtest.lua"/>
PHP:
function onSay(cid, words, param, channel)
speedTests[getPlayerGUID(cid)] = {}
local player_data = speedTests
local position = getPlayerPosition(cid)
local sqm = 0
local getTime = 0
if param == "start" then
if player_data.starter ~= 1 then
player_data.starter = 1
player_data.timer = os.time()
player_data.position = {x=position.x, y=position.y}
doPlayerSendTextMessage(cid, 19, "Test started please walk!")
else
doPlayerSendCancel(cid, "You have arleady started test.")
end
elseif param == "stop" then
if player_data.starter == 1 then
if player_data.position.x > position.x then
sqm = sqm+(player_data.position.x-position.x)
else
sqm = sqm+(position.x-player_data.position.x)
end
if player_data.position.y > position.y then
sqm = sqm+(player_data.position.y-position.y)
else
sqm = sqm+(position.y-player_data.position.y)
end
local getTime = os.time()-player_data.timer
doPlayerSendTextMessage(cid, 19, "You can walk "..math.abs(sqm/getTime).." SQM/sec.")
player_data.starter = 0
else
doPlayerSendCancel(cid, "You haven't any test started.")
end
end
return TRUE
end
Now you can use script and results: