Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.

Wysłany: 2016-04-27, 13:01


Odważny

Początki LUA :P






Wiek: 25
Na forum: 3739 dni
Posty: 140
Nick w MP: ReseT_

Piwa: 166

Respekt: 50

witam.
mam db3 z logowaniem w wyborem spawnu, wszystko git lecz wyskakuje taki db:
Kod:


[2016-04-26 18:39] ERROR: Client (tester) triggered serverside event core:spawnPlayer, but event is not added serverside


kod:

local sx,sy=guiGetScreenSize()
local data={ showed=nilbutton={}, info=nilmisc=nil, }

function isMouseIn(psx,psy,pssx,pssy,abx,aby)
    if not isCursorShowing() then return end
    cx,cy=getCursorPosition()
    cx,cy=cx*sx,cy*sy
    if cx >= psx and cx <= psx+pssx and cy >= psy and cy <= psy+pssy then
        return true,cx,cy
    else
        return false
    end
end

function renderZoneBox()
    dxDrawRectangle(sx*0/1024sy*201/768sx*1024/1024sy*308/768tocolor(000188), false)
    if data.info then dxDrawText(data.infosx*252/1024sy*232/768sx*800/1024sy*255/768tocolor(23700255), 1.00"default""center""center"falseend
    --dxDrawLine(sx*0/1024sy*199/768sx*1022/1024sy*200/768tocolor(31111193255), 5false)
    --dxDrawLine(sx*0/1024sy*509/768sx*1022/1024sy*510/768tocolor(31111193255), 5false)
    dxDrawText("FORUM: W BUDOWIE"sx*0/1024sy*157/768sx*1024/1024sy*237/768white2.00"pricedown""center""center"false)
    
    if not isMouseIn(sx*98/1024sy*294/768sx*225/1024sy*92/768then dxDrawRectangle(sx*98/1024sy*294/768sx*225/1024sy*92/768tocolor(192192192193), false)
    else dxDrawRectangle(sx*98/1024sy*294/768sx*225/1024sy*92/768tocolor(15000193), falseend
    if not isMouseIn(sx*415/1024sy*294/768sx*225/1024sy*92/768then dxDrawRectangle(sx*415/1024sy*294/768sx*225/1024sy*92/768tocolor(192192192193), false)
    else dxDrawRectangle(sx*415/1024sy*294/768sx*225/1024sy*92/768tocolor(15000193), falseend
    if not isMouseIn(sx*710/1024sy*294/768sx*225/1024sy*92/768then dxDrawRectangle(sx*710/1024sy*294/768sx*225/1024sy*92/768tocolor(192192192193), false)
    else dxDrawRectangle(sx*710/1024sy*294/768sx*225/1024sy*92/768tocolor(15000193), falseend

    dxDrawText("Palomino Creek"sx*98/1024sy*293/768sx*323/1024sy*386/768white1.00"default""center""center"false)
    dxDrawText("Przechowywalnia"sx*416/1024sy*293/768sx*641/1024sy*386/768white1.00"default""center""center"false)
    dxDrawText("Montgomery"sx*712/1024sy*293/768sx*937/1024sy*386/768white1.00"default""center""center"false)
end

addEventHandler("onClientClick"root, function(btn,state)
    if btn=="left" and state=="down" then
        if isMouseIn(sx*98/1024sy*294/768sx*225/1024sy*92/768) and data.showed then
            setElementData(localPlayer,"player:spawn",{2405.72,-89.38,27.32})
            closeZones()
        end
        if isMouseIn(sx*415/1024sy*294/768sx*225/1024sy*92/768) and data.showed then
            setElementData(localPlayer,"player:spawn",{2228.37,-116.88,26.49})
            closeZones()
        end
        if isMouseIn(sx*710/1024sy*294/768sx*225/1024sy*92/768) and data.showed then
            setElementData(localPlayer,"player:spawn",{1202.56,157.92,20.45})
               closeZones()
        end
    end
end)

function closeZones()
    showChat(true)
    showCursor(false)
    fadeCamera(false)
    setElementAlpha(localPlayer,255)
    stopSound(data.misc)
    showPlayerHudComponent("all",true)
    showPlayerHudComponent("radar",true)
    showPlayerHudComponent("crosshair",true)
    data.showed=false

    -- Usuwamy elementy
    triggerServerEvent("core:spawnPlayer"localPlayer)
    removeEventHandler("onClientRender"rootrenderZoneBox)
end

function showZones(misc)
    data.misc=misc
    data.showed=true
    showPlayerHudComponent("all",false)
    guiSetInputMode("no_binds_when_editing")
    addEventHandler("onClientRender"rootrenderZoneBoxend


Podpis
, pomogłem Ci? Wynagrodź mnie :piwo: :P
Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-04-27, 13:08


AteX







Wiek: 26
Na forum: 4015 dni
Posty: 927
Nick w MP: #AteX

Piwa: 8360

Respekt: 775,3
Respekt: 775,3Respekt: 775,3

Ten kod b??du nie posiada. Nie masz po stronie serwera event'u o nazwie core:spawnPlayer (a przynajmniej go nie wykrywa), kt?ry jest triggerowany po zalogowaniu.

Podpis
MultiTheftAuto++ dla MTA 1.5.7 już dostępne.
Postaw piwo autorowi tego posta
 

 
Tagi: logowanie :: prl
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA Ten temat jest zablokowany bez możliwości zmiany postów lub pisania odpowiedzi

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
Dodaj temat do Ulubionych
Wersja do druku