Üzenetek megjelenítése

Ez a szekció lehetővé teszi a felhasználó által írt összes hozzászólás megtekintését. Vedd figyelembe, hogy csak azokba a fórumokba írt hozzászólásokat látod, amelyekhez hozzáférésed van.


Témák - ScrepyX

Oldalak: 1 [2]
16
Segítségkérés / Triggerelés.
« Dátum: 2016. November 04. - 11:36:23 »
Sziasztok. Valaki el tudja magyarázni az
Addevent
AddEventHandler
és a TriggerServerEvent működését?
Próbáltam átszerkeszteni a zeró mta-t de nem tudok triggerelni.
 
function toggleLock(source, key, keystate)
local veh = getPedOccupiedVehicle(source)
local inVehicle = getElementData(source, \"realinvehicle\")
if (veh) and (inVehicle==1) then
triggerEvent(\"lockUnlockInsideVehicle\", source, veh)
elseif not veh then
if getElementDimension(source) >= 19000 then
   local vehicle = exports.pool:getElement(\"vehicle\", getElementDimension(source) - 20000)
   if vehicle and exports[\'vehicle-interiors\']:isNearExit(source, vehicle) then
      local model = getElementModel(vehicle)
      local owner = getElementData(vehicle, \"owner\")
      local dbid = getElementData(vehicle, \"dbid\")
      if (owner ~= -2) then
         if ( getElementData(vehicle, \"Impounded\") or 0 ) == 0 then
            local locked = isVehicleLocked(vehicle)
            if (locked) then
               setVehicleLocked(vehicle, false)
               exports.global:sendLocalMeAction(source, \"kinyitja a járművet.\")
            else
               setVehicleLocked(vehicle, true)
               exports.global:sendLocalMeAction(source, \"bezárja a járművet.\")
            end
         else
            outputChatBox(\"(( Lefoglalt kocsit nem tudsz bezárni. ))\", source, 255, 195, 14)
         end
      else
         outputChatBox(\"(( Civil kocsit nem tudsz bezárni. ))\", source, 255, 195, 14)
      end
      return
   end
end
if not triggerEvent(\"lockUnlockHouse\", source) then
   local x, y, z = getElementPosition(source)
   local nearbyVehicles = exports.global:getNearbyElements(source, \"vehicle\", 30)
   if #nearbyVehicles < 1 then return end
   local found = nil
   local shortest = 31
   for i, veh in ipairs(nearbyVehicles) do
      local dbid = tonumber(getElementData(veh, \"dbid\"))
      local distanceToVehicle = getDistanceBetweenPoints3D(x, y, z, getElementPosition(veh))
      if shortest > distanceToVehicle and ( getElementData(source, \"adminduty\") == 1 or exports.global:hasItem(source, 3, dbid) or (getElementData(source, \"faction\") > 0 and getElementData(source, \"faction\") == getElementData(veh, \"faction\")) ) then
         shortest = distanceToVehicle
         found = veh
      end
   end
   if found then
      triggerEvent(\"lockUnlockOutsideVehicle\", source, found)
   end
end
end
end
addEvent(\"amikornyitzar\", false)
addEventHandler(\"amikornyitzar\", getRootElement(), toggleLock)

 

function hang()
triggerServerEvent(\"amikornyitzar\", getRootElement(), source, key, keystate)
outputChatBox(\"lefutott\")
end

17
Segítségkérés / Hogyan lehetne ezt megcsinálni?
« Dátum: 2016. Október 24. - 20:52:00 »
Sziasztok.
Azon gondolkodtam hogy csinálok egy scriptet, ami tippeket ad, amit késöbb publikálhatnék, ezzel én is fejlődnék, stb...
Viszont!!!
A script egyszerre akár 3 sort is kiírhat, ugyanis iffel van megírva... mi lenne a helyes megoldás?
 
function idozites(source)
setTimer(
function()
   local egy = \"#ffffffMunkákat a városházán tudsz vállalni.\"
   local ketto = \"#ffffffHa lerobbant a járműved, hívj egy vontatóst!\"
   local harom = \"#ffffffTeamSpeak 3 szerverünk IP címe:\"
   local negy = \"#ffffffA dashboardot a #3399ffHOME #ffffffgomb lenyomásával érheted el.\"
   local ot = \"#ffffffHa kifogy az üzemanyag a járművetből, a benzinkúton #3399FFbenzines kannát#ffffff kell venned.\"
   local hat = \"#ffffffA város biztonsága érdekében a #3399FFrendőrség#ffffff, és a #3399FFmentőszolgálat #FFFFFF.\"
      if math.random(1, 6) == 1 then
         outputChatBox(\"\".. egy ..\"\", getRootElement(), 0,0,0, true)
      end
      if math.random(1, 6) == 2 then
         outputChatBox(\"\".. ketto ..\"\", getRootElement(), 0,0,0, true)
      end
      if math.random(1, 6) == 3 then
         outputChatBox(\"\".. harom ..\"\", getRootElement(), 0,0,0, true)
      end
      if math.random(1, 6) == 4 then
         outputChatBox(\"\".. negy ..\"\", getRootElement(), 0,0,0, true)
      end
      if math.random(1, 6) == 5 then
         outputChatBox(\"\".. ot ..\"\", getRootElement(), 0,0,0, true)
      end
      if math.random(1, 6) == 6 then
         outputChatBox(\"\".. hat ..\"\", getRootElement(), 0,0,0, true)
      end
end, 5000, 0)
end
addEventHandler(\"onResourceStart\", getRootElement(), idozites)

18
Segítségkérés / Adminskin
« Dátum: 2016. Október 22. - 12:55:50 »
Sziasztok! Kezdő scripter vagyok, és azon gondolkodtam hogy egy privát szerveren megnézem, hogy hogyan lehetne admin-skint adni, a /adminduty parancsra.
Az adminskint megadja, de amikor kilépnék, a 0-s skin adja. Hogyan lehet változókat használni, setPlayerSkinnél?
 
function adminDuty(thePlayer, commandName)
if exports.global:isPlayerAdmin(thePlayer) then
local adminduty = getElementData(thePlayer, \"adminduty\")
local username = getPlayerName(thePlayer)
local adminrang = exports.global:getPlayerAdminTitle(thePlayer)
local playerName = getPlayerName(thePlayer)
local pmid = getElementData(thePlayer, \"playerid\")
local skinadmin = getPlayerSkin(thePlayer)
if (adminduty==0) then
   exports[\'anticheat-system\']:changeProtectedElementDataEx(thePlayer, \"adminduty\", 1)
   exports.global:sendMessageToAdmins(\"\" .. username .. \" szolgálatba lépett.\")
   exports.infobox:showBox(getRootElement(), \"info\", playerName.. \" adminszolgálatba lépett!\\n/pm \"..pmid..\" parancsal írhatsz neki!\")
   outputChatBox(\"#3399FF\".. playerName .. \"#FFFFFF adminszolgálatba lépett!#3399FF /pm #3399FF\"..pmid..\"#FFFFFF parancsal írsz neki!\", getRootElement(), 255, 255, 255,true)
   setPlayerSkin(thePlayer, 299)
elseif (adminduty==1) then
   exports[\'anticheat-system\']:changeProtectedElementDataEx(thePlayer, \"adminduty\", 0)
   exports.infobox:showBox(getRootElement(), \"info\", playerName.. \" kilépett adminszolgálatból!\")
   outputChatBox(\"#3399FF \".. playerName .. \"#FFFFFF kilépett az adminszolgálatból!\", getRootElement(), 255, 255, 255,true)
   setPlayerSkin(thePlayer, \".. skinadmin ..\")
   outputChatBox(\"lefut\")
end
mysql:query_free(\"UPDATE accounts SET adminduty=\" .. mysql:escape_string(getElementData(thePlayer, \"adminduty\")) .. \" WHERE id = \" .. mysql:escape_string(getElementData(thePlayer, \"gameaccountid\")) )
exports.global:updateNametagColor(thePlayer)
end
end
addCommandHandler(\"adminduty\", adminDuty, false, false)
addCommandHandler(\"aduty\", adminDuty, false, false)
addCommandHandler(\"aszoli\", adminDuty, false, false)

 
mi a probléma?
zeroedit...

19
Sziasztok. Kezdő LUA scripter vagyok, és meg szeretném kérdezni, hogy hogyan kell a kliens oldali function-ból, betölteni egy szerver oldali function-t.
Példa:
kliens oldal:
 
function gui1()
   screenWidth, screenHeight = guiGetScreenSize()
   windowWidth, windowHeight = 300, 400
   x = (screenWidth/2) - (windowWidth/2)
   y = (screenHeight/2) - (windowHeight/2)
   
   gui = guiCreateStaticImage(x, y, 300, 400, \"gui.png\", false)
   showCursor(true)
   szerel = guiCreateLabel(35, 320, 120, 60, \"\", false, gui)
   bezar = guiCreateLabel(177, 320, 120, 60, \"\" , false, gui)
   addEventHandler(\"onClientGUIClick\", szerel, oprava, false)
   addEventHandler(\"onClientGUIClick\", bezar, gombteszt2, false)
end
addCommandHandler(\"szerel\", gui1)
function gombteszt2()
   showCursor(false)
   guiSetVisible(gui, false)
   
end

 
szerver oldal:
 
function oprava (player, command)
local auto = getPedOccupiedVehicle(player)
fixVehicle(auto)
end

 
Remélem érthetően fogalmaztam, várom a válaszokat.

20
Sziasztok. Kezdő LUA scripter vagyok, és meg szeretném kérdezni, hogy hogyan kell a kliens oldali function-ból, betölteni egy szerver oldali function-t.
Példa:
kliens oldal:
function gui1()
screenWidth, screenHeight = guiGetScreenSize()
windowWidth, windowHeight = 300, 400
x = (screenWidth/2) - (windowWidth/2)
y = (screenHeight/2) - (windowHeight/2)
gui = guiCreateStaticImage(x, y, 300, 400, \"gui.png\", false)
showCursor(true)
szerel = guiCreateLabel(35, 320, 120, 60, \"\", false, gui)
bezar = guiCreateLabel(177, 320, 120, 60, \"\" , false, gui)
addEventHandler(\"onClientGUIClick\", szerel, oprava, false)
addEventHandler(\"onClientGUIClick\", bezar, gombteszt2, false)
end
addCommandHandler(\"szerel\", gui1)
function gombteszt2()
showCursor(false)
guiSetVisible(gui, false)
end
szerver oldal:
 function oprava (player, command)
local auto = getPedOccupiedVehicle(player)
fixVehicle(auto)
end
Remélem érthetően fogalmaztam, várom a válaszokat.

Oldalak: 1 [2]
SimplePortal 2.3.7 © 2008-2024, SimplePortal