Szerző Téma: Modok átalakítása  (Megtekintve 606 alkalommal)

Modok átalakítása
« Dátum: 2017. április 08. - 14:06:15 »
0 Show voters
Nemrég nekikezdtem egy modnak, amit átakarok HL-hez alakítani,de az alábbi errort írja:
 
[13:53:44] ERROR: Client (John_Labelmaker) triggered serverside event getTicketsServer, but event is not added serverside
[13:53:44] ERROR: Client (John_Labelmaker) triggered serverside event getWantedCarsServer, but event is not added serverside
[13:53:44] ERROR: Client (John_Labelmaker) triggered serverside event getWantedPersonsServer, but event is not added serverside
[13:53:55] ERROR: Client (John_Labelmaker) triggered serverside event mdcLoginServer, but event is not added serverside
 
A következő részek csak a logra vonatkozó script részek
 
Kliens oldal:
 

function loginMdcClient (frakcio)
    local vehicle = getPedOccupiedVehicle(localPlayer)
    mdcLogin = false
    mdcPanel = true
    playSound(\"login.mp3\")
    addEventHandler(\"onClientRender\", getRootElement(), drawMdcPanel)
    setElementData(vehicle, \"mdc:group\", \"PD\")
    triggerServerEvent(\"sendMessageToPoliceG\", root, \"#ffffff\" .. getPlayerName(localPlayer):gsub(\"_\", \" \") .. \" #ca5454(\" .. getVehiclePlateText(vehicle) .. \") #ffffffbejelentkezett az #598ED7MDCbe#ffffff.\")
    setElementData(vehicle, \"mdc:loggedin\", true)
    removeEventHandler(\"onClientRender\", getRootElement(), drawLoginPanel)
    if isElement(username) then
        destroyElement(username)
    end
    if isElement(usernameedit) then
        destroyElement(usernameedt)
    end
    if isElement(password) then
         destroyElement(password)
    end
    if isElement(passwordedit) then
        destroyElement(passwordedit)
    end
end
addEvent(\"loginMdcClient\", true)
addEventHandler(\"loginMdcClient\", getRootElement(), loginMdcClient)
function validateMdcLogin()
    if not isTimer(theTimer) then
        theTimer = setTimer(function() end, 10000, 1)
        if guiGetText(usernameedit) ~= \"\" and guiGetText(passwordedit) ~= \"\" then
            triggerServerEvent(\"mdcLoginServer\", localPlayer, guiGetText(usernameedit), guiGetText(passwordedit))
        else
            outputChatBox(\"fail\")
        end
    end
end

 
 
 
 
 
 
 
 
 
 
 
 
 
Szerver oldal:
 
 
 

function mdcLoginServer(username, password)
local source = client
dbQuery(
   function (queryHandler)
      local result, numAffectedRows, errorMsg = dbPoll(queryHandler, 0)
      --local faction = dbQuery(queryHandler, \"SELECT frakcio FROM mdcaccounts where username = ? AND password = ?\", username, password)
      local frakcio = mysql:query_fetch_assoc(\"SELECT frakcio FROM mdcaccounts WHERE username = \'\" .. username .. \"\' AND password = \'\" .. password .. \"\'\")
      if numAffectedRows > 0 then
         for _, row in ipairs(result) do
                frakcio = row[\"frakcio\"]
             end
             triggerClientEvent(source, \"loginMdcClient\", source, frakcio)
      else
         outputChatBox(\"Hibás Jelszó/Felhasználónév\", 255, 255, 255, thePlayer)
      end
   end,
   connection,
   \"SELECT * FROM mdcaccounts WHERE username = ? AND password = ?\", username, password
)
end
addEvent(\"mdcLoginServer\", true)
addEventHandler(\"mdcLoginServer\", getRootElement(), mdcLoginServer)
addEvent(\"acceptPlayerLogin\", true)
addEventHandler(\"acceptPlayerLogin\", getRootElement(), function(player)
triggerClientEvent(player, \"loginMdcClient\", player)
end)
function getTicketsServer(playerSource)
local tickets = {}
tickets = {}
local QueryEredmeny = dbPoll ( dbQuery( connection, \"SELECT * FROM mdctickets\"), -1 )
if (QueryEredmeny) then
   for k, v in ipairs(QueryEredmeny) do
      tickets[#tickets + 1] = {v[\"targetname\"], v[\"price\"], v[\"jailtime\"], v[\"reason\"], v[\"id\"]}
   end
   triggerClientEvent(root, \"getTicketsClient\", root, tickets)
end
end
addEvent(\"getTicketsServer\", true)
addEventHandler(\"getTicketsServer\", getRootElement(), getTicketsServer)
function getWantedCarsServer(playerSource)
local wantedcars = {}
wantedcars = {}
local QueryEredmeny = dbPoll ( dbQuery( connection, \"SELECT * FROM mdcwantedcars\"), -1 )
if (QueryEredmeny) then
   for k, v in ipairs(QueryEredmeny) do
      wantedcars[#wantedcars + 1] = {v[\"modelname\"], v[\"numberplate\"], v[\"reason\"], v[\"id\"]}
   end
   triggerClientEvent(root, \"getWantedCarsClient\", root, wantedcars)
end
end
addEvent(\"getWantedCarsServer\", true)
addEventHandler(\"getWantedCarsServer\", getRootElement(), getWantedCarsServer)
function getWantedPersonsServer(playerSource)
local wantedpersons = {}
wantedpersons = {}
local QueryEredmeny = dbPoll ( dbQuery( connection, \"SELECT * FROM mdcwantedpersons\"), -1 )
if (QueryEredmeny) then
   for k, v in ipairs(QueryEredmeny) do
      wantedpersons[#wantedpersons + 1] = {v[\"charactername\"], v[\"reason\"], v[\"id\"], v[\"leiras\"]}
   end
   triggerClientEvent(root, \"getWantedPersonsClient\", root, wantedpersons)
end
end
addEvent(\"getWantedPersonsServer\", true)
addEventHandler(\"getWantedPersonsServer\", getRootElement(), getWantedPersonsServer)

 
 

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal