Zaloguj się by uzyskać pełen dostęp. Nie masz jeszcze konta? Założ je już teraz w kilka sekund.
GTAONLINE.PL
Tematy otagowane jako: reaguje
1. triggerClientEvent nie reaguje po stronie clienta
Po stronie servera wszystko jest cacy ale client milczy. Prosz? o pomoc ;(

Server:

function checkVehicles(vehicle )
    
theVehicle = getElementModel( vehicle )
    if 
theVehicle == 482 then
        triggerClientEvent
( source, "startMisji", source)
    
end
end
addEventHandler
( "onPlayerVehicleEnter", getRootElement(), checkVehicles )


Client:

addEvent
( "startMisji", true )
addEventHandler( "startMisji", root, misja)
function 
misja( )
    
local punkt = losuj()
    
outputChatBox( "Cel zostal zaznaczony na mapie ruszaj!", 255, 255, 255, true )
    
punktDostawcy = createBlip( punktySmieci[punkt][1], punktySmieci[punkt][2], punktySmieci[punkt][3], 41, 0, 0, 0, 255)
    
punktDostawcyMarker = createMarker( punktySmieci[punkt][1], punktySmieci[punkt][2], punktySmieci[punkt][3], "cylinder", 4.0, 255, 0, 0 )
    
end
end
2. Button nie reaguje na zamknięcie
Witam, przychodz? mo?e i ze zbyt prostym problemem, ale podczas nauki LUA nie mog? zamkn?? gui, a przycisk nie reaguje. GUI zrobione jest w dxdraw.


addEvent
("okno",true)
addEventHandler("okno", root, function(value)
if 
not value then return end
tekst 
= value
showCursor
(true)
addEventHandler("onClientRender", root, ostrzezenie)
        function 
warnClose()
            if 
isMouseIn(screenW * 0.5555, screenH * 0.5875, screenW * 0.1008, screenH * 0.0653) then -- miejsce buttona
            
if value then
                removeEventHandler
("onClientRender", root, ostrzezenie)
                
end
            end
        end
       end
)


isMouseIn jakby kto? potrzebowa?, ale jestem pewny, ?e to dzia?a:

function isMouseIn ( x, y, width, height )
    if ( 
not isCursorShowing( ) ) then
        
return false
    end
    local sx
, sy = guiGetScreenSize ( )
    
local cx, cy = getCursorPosition ( )
    
local cx, cy = ( cx * sx ), ( cy * sy )
    if ( 
cx >= x and cx <= x + width ) and ( cy >= y and cy <= y + height ) then
        
return true
    
else
        return 
false
    end
end


Za pomoc stawiam :piwo:
3. Panel Logowania nie reaguje
Witam Mam problem mianowicie z panelem logowania nie reaguje on na nic wyczy?ci?em baze danych.Lecz Wyskakuje mi napis Konta nie ma w bazie danych nie mam pojecia co zrobi? prosz? o pomoc . Stawiam Piwko :)
4. Marker nie reaguje
Witam, mam problem mianowicie po wej?ciu w marker 'stan' nic sie nie dzieje.
[lua]
local praca = createMarker(2183,-2253,13.5,"cylinder",2,255,255,255,255,getRootElement())

local stanowiska = {
{2175.5634765625, -2267.458984375, 12.3-3,"cylinder",6,66, 134, 244,255},
{2167.947265625, -2274.8017578125, 12.3-3,"cylinder",6,66, 134, 244, 255}
}

local mieszkania = {
{2232.404296875, -1785.978515625, 12.3,"corona",2,66, 244, 194,255,1},
{2275.154296875, -1785.63671875, 12.3,"corona",2,66, 244, 194,255,2},
{2307.8271484375, -1785.740234375, 12.3,"corona",2,66, 244, 194,255,3},
{2345.576171875, -1785.611328125, 12.3,"corona",2,66, 244, 194,255,4},
{2379.6171875, -1785.8642578125, 12.3,"corona",2,66, 244, 194,255,5},
{2394.9619140625, -1796.0048828125, 12.3,"corona",2,66, 244, 194,255,6},
{2359.861328125, -1795.7890625, 12.3,"corona",2,66, 244, 194,255,7},
{2322.791015625, -1796.2197265625, 12.3,"corona",2,66, 244, 194,255,8},
{2290.1328125, -1795.951171875, 12.3,"corona",2,66, 244, 194,255,9},
{2247.0712890625, -1795.8701171875, 12.3,"corona",2,66, 244, 194,255,10},
}

addEventHandler("onPlayerMarkerHit",praca,function()
setElementData(localPlayer,"pracaKur",true)
end)



for i,v in pairs(stanowiska) do
local stan=createMarker(v[1], v[2], v[3],v[4],v[5],v[6],v[7],v[8],v[9],getRootElement())

addEven...
5. Kod nie reaguje na warunek.
Witam. Mam taki kawa?ek kodu po stronie serwera. Jak on dzia?a: klikamy GUI(client) i wtedy wywo?uje dan? funkcj? z servera jednak nie reaguje mi na warunek loginu danego gracza i mo?e by? to r?wnie? u?ywane przez osoby o innym loginie.


Kod:


function greeting7Handler ()
local localPlayerName = getAccountName(getPlayerAccount(client))
if localPlayerName == "P8A70088L6" or "Samel" then
addPedClothes ( source, "capzip", "cap", 16 )
outputChatBox(" #FFFFFF[#00FF00Select-skin#FFFFFF]:#F70606 tutaj!", thePlayer, 27, 89, 224, true)
else
outputChatBox(" #FFFFFF[#00FF00Select-skin#FFFFFF]:#F70606 nie masz, thePlayer, 27, 89, 224, true)
end
end
addEvent( "onGreeting7", true )
addEventHandler( "onGreeting7", getRootElement(), greeting7Handler )




//edit : dzia?a to poprawnie je?li zamiast OR b?d? stawia? kolejne linijki ELSEIF i na ka?dej osobny login - czy nie ma operatora(?) OR czy ?le go u?ywam?
6. bindKey nie reaguje
Witam, potrzebuj? jak najszybszej pomocy z bindKey kt?ry odpowiada..

kod

local pracageo
=createMarker(2500.60, -1669.45, 13.35-1,"cylinder", 1.1, 150, 120, 255,125)

addEventHandler("onClientMarkerHit", pracageo, function(el, md)
    if 
not md or getElementType(el) ~= "player" then return end
    
if el ~= localPlayer then return end
    outputChatBox
("DZIALA MARKER ",54, 203, 51)
end)

bindKey("e", "down", function()
    if 
not isElementWithinMarker(localPlayer, pracageo) then return end
    
if not getElementData(localPlayer, "startJob") then
        setElementData
(localPlayer, "startJob", true)
        
outputChatBox("DZIALA BIND",54, 203, 51)
end
 end
)
7. Marker który reaguje tylko na gracza
Co musz? doda? do tego skryptu po ni?ej ?e gdy gracz wejdzie w marker samochodem to nic si? nie dzieje.


doordoherty2 
= createObject ( 3089, 1160.759, -1326.447, 14.053, 0, 0, 180 )

marker_door_doherty1 = createMarker(1159.238, -1326.472, 12.724, "cylinder", 2.4, 255, 255, 255, 0)

function 
moveGate(hitplayer, matchingDimension)
        
moveObject( doordoherty1,2000, 1156.273, -1326.443, 14.053)
        
moveObject( doordoherty2,2000, 1162.258, -1326.447, 14.053)
end