- Dołączył
- Maj 18, 2010
- Posty
- 449
- Liczba reakcji
- 16
Witam,
nie wiem czy by?o cos podobnego ale warto doda? [4fun]
wiec, skrypt polaga na tym ze poprzez komande mozesz sterowac graczem
np:
koniec info, czas wzi??? sie do roboty 
w talkactions.xml dodajemy:
tworzymy data/talkactions/scripts/zdalne_sterowanie.lua
Mi?ej zabawy
nie wiem czy by?o cos podobnego ale warto doda? [4fun]
wiec, skrypt polaga na tym ze poprzez komande mozesz sterowac graczem

np:
Kod:
/move Collocorpus,up down left left right down up

w talkactions.xml dodajemy:
PHP:
<talkaction log="yes" access="5" words="/move" script="move.lua"/>
tworzymy data/talkactions/scripts/zdalne_sterowanie.lua
PHP:
local keys = {
["up"] = NORTH,
["down"] = SOUTH,
["left"] = WEST,
["right"] = EAST,
["up-left"] = NORTHWEST,
["up-right"] = NORTHEAST,
["down-left"] = SOUTHWEST,
["down-right"] = SOUTHEAST
}
local function moveCreature(cid, direction)
doMoveCreature(cid, direction)
return TRUE
end
function onSay(cid, words, param)
if(param == "") then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")
return TRUE
end
local t = string.explode(param, ",")
if(t[2] == nil) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Not enough parameters.")
return TRUE
end
local pid = getPlayerByNameWildcard(tostring(t[1]))
if(pid == 0 or (isPlayerGhost(pid) == TRUE and getPlayerAccess(pid) > getPlayerAccess(cid))) then
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Player " .. param .. " not found.")
return TRUE
end
local x = string.explode(tostring(t[2]), " ")
local speed = math.max(1600 - getCreatureSpeed(cid), 100)
for i = 1, table.maxn(x) do
addEvent(moveCreature, ((i - 1) * speed), pid, keys[ x[i] ])
end
return TRUE
end
Mi?ej zabawy
