function ls(player, cmd)
setElementPosition(player, 2500.5952, -1669.4454, 13.3532, rotz)
outputChatBox("Witamy w Los Santos.", player, 255, 255, 0)
end
addCommandHandler("ls", ls)
function lv(player, cmd)
setElementPosition(player, 2140.8190, 986.2273, 10.8203, rotz)
outputChatBox("Witamy w Las Venturas.", player, 255, 255, 0)
end
addCommandHandler("lv", lv)
function sf(player, cmd)
setElementPosition(player, -2041.2288, 136.2675, 28.8359, rotz)
outputChatBox("Witamy w San Fierro.", player, 255, 255, 0)
end
addCommandHandler("sf", sf)
Poczytaj na wiki o trigerrach i eventach.
Jakie? pierwsze dzia?ania daj, bo w?tpie ?eby kto? odwali? za ciebie robot? ;]
Pomo?emy ale wyra? ch?ci pracy.
[ Dodano: 2014-01-22, 23:13 ]
Dok?adnie mi chodzi o:
Wiadomo?? na chacie si? wy?wietla, ale nie przemieszcza gracza. Pr?bowa?em co? z tym zrobi?, ale mi to nie wychodzi:
- strona klienta:
function tpls ( commandName )
triggerServerEvent ( "texttpls", localPlayer, "Witamy w Los Santos!" )
triggerClientEvent ( "ontpls", localPlayer, x, y, z )
end
addCommandHandler ( "ls", tpls )
- strona serwera:
function greetingtextls ( message )
outputChatBox ( message, client )
end
addEvent( "texttpls", true )
addEventHandler( "texttpls", root, greetingtextls )
function greetingontpls ( x, y, z )
local x = 2500.5952
local y = -1669.4454
local z = 13.3532
end
addEvent( "ontpls", true )
addEventHandler( "ontpls", root, greetingontpls )
Wypisuje dalej tekst, ale nie teleportuje. Na pocz?tek chcia?em zrobi? tylko jeden teleport, a jak b?dzie ok. to na podstawie niego zrobie z reszt?. P??niej zrobi?em co? takiego:
- Pe?ny kod klient:
local lsposX, lsposY, lsposZ = 2500.5952, -1669.4454, 13.3532
function tpls ( commandName )
triggerServerEvent ( "texttpls", getLocalPlayer(), "Witamy w Los Santos!" )
triggerServerEvent ( "ontpls", getLocalPlayer(), lsposX, lsposY, lsposZ )
end
addCommandHandler ( "ls", tpls )
function greetingtextls ( message, player )
outputChatBox ( message, player )
end
addEvent( "texttpls", true )
addEventHandler( "texttpls", root, greetingtextls )
function greetingontpls ( posX, posY, posZ, player )
setElementPosition ( player, posX, posY, posZ )
end
addEvent( "ontpls", true )
addEventHandler( "ontpls", root, greetingontpls )
Client:
local player = getLocalPlayer()
local lsposX = 2500.5952
local lsposY = -1669.4454
local lsposZ = 13.3532
function tpls ( commandName )
triggerServerEvent ( "texttpls", getRootElement(), "Witamy w Los Santos!", player )
triggerServerEvent ( "ontpls", getRootElement(), lsposX, lsposY, lsposZ, player )
end
addCommandHandler ( "ls", tpls )
Nie możesz pisać nowych tematów Nie możesz odpowiadać w tematach Nie możesz zmieniać swoich postów Nie możesz usuwać swoich postów Nie możesz głosować w ankietach