Szerző Téma: triggerServerEvent  (Megtekintve 1660 alkalommal)

triggerServerEvent
« Dátum: 2016. augusztus 22. - 13:39:42 »
0 Show voters
Sziasztok! Nem nagyon értem a triggerServer/ClientEvent-et és ezért probálkoztam egy ilyen scriptel:
Client:
 

local screenW, screenH = guiGetScreenSize()
addEventHandler(\"onClientRender\", root,
    function()
showCursor(true)
        dxDrawRectangle(screenW * 0.3786, screenH * 0.3102, screenW * 0.2552, screenH * 0.5528, tocolor(0, 0, 0, 170), false)
        dxDrawLine((screenW * 0.4719) - 1, (screenH * 0.3343) - 1, (screenW * 0.4719) - 1, screenH * 0.3731, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5448, (screenH * 0.3343) - 1, (screenW * 0.4719) - 1, (screenH * 0.3343) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.4719) - 1, screenH * 0.3731, screenW * 0.5448, screenH * 0.3731, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5448, screenH * 0.3731, screenW * 0.5448, (screenH * 0.3343) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.4719, screenH * 0.3343, screenW * 0.0729, screenH * 0.0389, tocolor(34, 45, 152, 255), false)
        dxDrawText(\"Blue Gaming System CoD - CsapatVálasztó\", (screenW * 0.3776) - 1, (screenH * 0.3093) - 1, (screenW * 0.6339) - 1, (screenH * 0.3250) - 1, tocolor(0, 0, 0, 255), 0.80, \"pricedown\", \"center\", \"top\", true, true, false, true, false)
        dxDrawText(\"Blue Gaming System CoD - CsapatVálasztó\", (screenW * 0.3776) + 1, (screenH * 0.3093) - 1, (screenW * 0.6339) + 1, (screenH * 0.3250) - 1, tocolor(0, 0, 0, 255), 0.80, \"pricedown\", \"center\", \"top\", true, true, false, true, false)
        dxDrawText(\"Blue Gaming System CoD - CsapatVálasztó\", (screenW * 0.3776) - 1, (screenH * 0.3093) + 1, (screenW * 0.6339) - 1, (screenH * 0.3250) + 1, tocolor(0, 0, 0, 255), 0.80, \"pricedown\", \"center\", \"top\", true, true, false, true, false)
        dxDrawText(\"Blue Gaming System CoD - CsapatVálasztó\", (screenW * 0.3776) + 1, (screenH * 0.3093) + 1, (screenW * 0.6339) + 1, (screenH * 0.3250) + 1, tocolor(0, 0, 0, 255), 0.80, \"pricedown\", \"center\", \"top\", true, true, false, true, false)
        dxDrawText(\"Blue Gaming System CoD - CsapatVálasztó\", screenW * 0.3776, screenH * 0.3093, screenW * 0.6339, screenH * 0.3250, tocolor(255, 255, 255, 255), 0.80, \"pricedown\", \"center\", \"top\", true, true, false, true, false)
        dxDrawLine((screenW * 0.4719) - 1, (screenH * 0.3880) - 1, (screenW * 0.4719) - 1, screenH * 0.4269, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5448, (screenH * 0.3880) - 1, (screenW * 0.4719) - 1, (screenH * 0.3880) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.4719) - 1, screenH * 0.4269, screenW * 0.5448, screenH * 0.4269, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5448, screenH * 0.4269, screenW * 0.5448, (screenH * 0.3880) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.4719, screenH * 0.3880, screenW * 0.0729, screenH * 0.0389, tocolor(34, 45, 152, 255), false)
        dxDrawLine((screenW * 0.4719) - 1, (screenH * 0.4435) - 1, (screenW * 0.4719) - 1, screenH * 0.4824, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5448, (screenH * 0.4435) - 1, (screenW * 0.4719) - 1, (screenH * 0.4435) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.4719) - 1, screenH * 0.4824, screenW * 0.5448, screenH * 0.4824, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5448, screenH * 0.4824, screenW * 0.5448, (screenH * 0.4435) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.4719, screenH * 0.4435, screenW * 0.0729, screenH * 0.0389, tocolor(34, 45, 152, 255), false)
        dxDrawText(\"Australia\", screenW * 0.4719, screenH * 0.3361, screenW * 0.5448, screenH * 0.3731, tocolor(255, 255, 255, 255), 1.00, \"pricedown\", \"center\", \"center\", false, false, true, false, false)
        dxDrawText(\"Russia\", screenW * 0.4719, screenH * 0.3898, screenW * 0.5448, screenH * 0.4269, tocolor(255, 255, 255, 255), 1.00, \"pricedown\", \"center\", \"center\", false, false, true, false, false)
        dxDrawText(\"Üres Slot\", screenW * 0.4719, screenH * 0.4454, screenW * 0.5448, screenH * 0.4824, tocolor(255, 255, 255, 255), 1.00, \"pricedown\", \"center\", \"center\", false, false, true, false, false)
    end
)
-------------------------------------------------------Australia-------------------------------------------------------
function dobozbaVan(dX, dY, dSZ, dM, eX, eY)
            if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then
                return true
            else
                return false
            end
        end
           
           
           
            addEventHandler(\"onClientClick\", getRootElement(), function(gomb, allapot, absX, absY)
            if allapot == \"down\" and gomb == \"left\" then
                if dobozbaVan(screenW * 0.2599, screenH * 0.3685, screenW * 0.3005, screenH * 0.3917, absX, absY)  then
            triggerServerEvent ( \"australia\", resourceRoot)   
                           
                end
            end
        end
        )
-------------------------------------------------------Russia-------------------------------------------------------
 
 function dobozbaVan2(dX, dY, dSZ, dM, eX, eY)
            if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then
                return true
            else
                return false
            end
        end
           
           
           
            addEventHandler(\"onClientClick\", getRootElement(), function(gomb, allapot, absX, absY)
            if allapot == \"down\" and gomb == \"left\" then
                if dobozbaVan2(screenW * 0.2599, screenH * 0.3685, screenW * 0.3005, screenH * 0.3917, absX, absY)  then
               triggerServerEvent ( \"russia\", resourceRoot)
                           
                end
            end
        end
        )
 

-------------------------------------------------------Ures Slot-------------------------------------------------------
 
function dobozbaVan3(dX, dY, dSZ, dM, eX, eY)
            if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then
                return true
            else
                return false
            end
        end
           
           
           
            addEventHandler(\"onClientClick\", getRootElement(), function(gomb, allapot, absX, absY)
            if allapot == \"down\" and gomb == \"left\" then
                if dobozbaVan3(screenW * 0.2599, screenH * 0.3685, screenW * 0.3005, screenH * 0.3917, absX, absY)  then
               triggerServerEvent ( \"ures\", resourceRoot)
                           
                end
            end
        end
        )
-------------------------------------------------------Semmmmmmmi xD YOLO-------------------------------------------------------

 
Server:
 

autralia = createTeam ( \"Australia\" )
russia = createTeam ( \"Russia\" )
 
function autralia ()
showCursor (false)
setPlayerTeam ( source, autralia )
fadeCamera(source, true)
            setCameraTarget(source, source)
            outputChatBox (\"#00007F[bL] #FFFFFFA(z) Australia csapatot választottad!\", source, 255,255,255, true)
            spawnPlayer(source, 110.14752, 1684.02576, 17.64063)
end
addEvent(\"australia\", true)
addEventHandler(\"australia\", australia)
function russia ()
showCursor (false)
setPlayerTeam ( source, russia )
fadeCamera(source, true)
            setCameraTarget(source, source)
            outputChatBox (\"#00007F[bL] #FFFFFFA(z) Australia csapatot választottad!\", source, 255,255,255, true)
            spawnPlayer(source, 914.36639, -996.83667, 38.13548)
end
addEvent(\"russia\", true)
addEventHandler(\"russia\", russia)
function ures ()
outputChatBox(\"#00007F[bL] #FFFFFFAz Üres Slot szerinted csak viccből van kiírva?...... #akkorisrányomsz....\", source)
end
addEvent(\"ures\", true)
addEventHandler(\"ures\", ures)

 
A válaszokat előre is köszönöm!

triggerServerEvent
« Válasz #1 Dátum: 2016. augusztus 22. - 13:51:13 »
0 Show voters
Idézetet írta: thegergo02 date=1471865982\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"62778\" data-ipsquote-contentclass=\"forums_Topic
Sziasztok! Nem nagyon értem a triggerServer/ClientEvent-et és ezért probálkoztam egy ilyen scriptel:
Client:
 

local screenW, screenH = guiGetScreenSize()
addEventHandler(\"onClientRender\", root,
    function()
showCursor(true)
        dxDrawRectangle(screenW * 0.3786, screenH * 0.3102, screenW * 0.2552, screenH * 0.5528, tocolor(0, 0, 0, 170), false)
        dxDrawLine((screenW * 0.4719) - 1, (screenH * 0.3343) - 1, (screenW * 0.4719) - 1, screenH * 0.3731, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5448, (screenH * 0.3343) - 1, (screenW * 0.4719) - 1, (screenH * 0.3343) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.4719) - 1, screenH * 0.3731, screenW * 0.5448, screenH * 0.3731, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5448, screenH * 0.3731, screenW * 0.5448, (screenH * 0.3343) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.4719, screenH * 0.3343, screenW * 0.0729, screenH * 0.0389, tocolor(34, 45, 152, 255), false)
        dxDrawText(\"Blue Gaming System CoD - CsapatVálasztó\", (screenW * 0.3776) - 1, (screenH * 0.3093) - 1, (screenW * 0.6339) - 1, (screenH * 0.3250) - 1, tocolor(0, 0, 0, 255), 0.80, \"pricedown\", \"center\", \"top\", true, true, false, true, false)
        dxDrawText(\"Blue Gaming System CoD - CsapatVálasztó\", (screenW * 0.3776) + 1, (screenH * 0.3093) - 1, (screenW * 0.6339) + 1, (screenH * 0.3250) - 1, tocolor(0, 0, 0, 255), 0.80, \"pricedown\", \"center\", \"top\", true, true, false, true, false)
        dxDrawText(\"Blue Gaming System CoD - CsapatVálasztó\", (screenW * 0.3776) - 1, (screenH * 0.3093) + 1, (screenW * 0.6339) - 1, (screenH * 0.3250) + 1, tocolor(0, 0, 0, 255), 0.80, \"pricedown\", \"center\", \"top\", true, true, false, true, false)
        dxDrawText(\"Blue Gaming System CoD - CsapatVálasztó\", (screenW * 0.3776) + 1, (screenH * 0.3093) + 1, (screenW * 0.6339) + 1, (screenH * 0.3250) + 1, tocolor(0, 0, 0, 255), 0.80, \"pricedown\", \"center\", \"top\", true, true, false, true, false)
        dxDrawText(\"Blue Gaming System CoD - CsapatVálasztó\", screenW * 0.3776, screenH * 0.3093, screenW * 0.6339, screenH * 0.3250, tocolor(255, 255, 255, 255), 0.80, \"pricedown\", \"center\", \"top\", true, true, false, true, false)
        dxDrawLine((screenW * 0.4719) - 1, (screenH * 0.3880) - 1, (screenW * 0.4719) - 1, screenH * 0.4269, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5448, (screenH * 0.3880) - 1, (screenW * 0.4719) - 1, (screenH * 0.3880) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.4719) - 1, screenH * 0.4269, screenW * 0.5448, screenH * 0.4269, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5448, screenH * 0.4269, screenW * 0.5448, (screenH * 0.3880) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.4719, screenH * 0.3880, screenW * 0.0729, screenH * 0.0389, tocolor(34, 45, 152, 255), false)
        dxDrawLine((screenW * 0.4719) - 1, (screenH * 0.4435) - 1, (screenW * 0.4719) - 1, screenH * 0.4824, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5448, (screenH * 0.4435) - 1, (screenW * 0.4719) - 1, (screenH * 0.4435) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.4719) - 1, screenH * 0.4824, screenW * 0.5448, screenH * 0.4824, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5448, screenH * 0.4824, screenW * 0.5448, (screenH * 0.4435) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.4719, screenH * 0.4435, screenW * 0.0729, screenH * 0.0389, tocolor(34, 45, 152, 255), false)
        dxDrawText(\"Australia\", screenW * 0.4719, screenH * 0.3361, screenW * 0.5448, screenH * 0.3731, tocolor(255, 255, 255, 255), 1.00, \"pricedown\", \"center\", \"center\", false, false, true, false, false)
        dxDrawText(\"Russia\", screenW * 0.4719, screenH * 0.3898, screenW * 0.5448, screenH * 0.4269, tocolor(255, 255, 255, 255), 1.00, \"pricedown\", \"center\", \"center\", false, false, true, false, false)
        dxDrawText(\"Üres Slot\", screenW * 0.4719, screenH * 0.4454, screenW * 0.5448, screenH * 0.4824, tocolor(255, 255, 255, 255), 1.00, \"pricedown\", \"center\", \"center\", false, false, true, false, false)
    end
)
-------------------------------------------------------Australia-------------------------------------------------------
function dobozbaVan(dX, dY, dSZ, dM, eX, eY)
            if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then
                return true
            else
                return false
            end
        end
           
           
           
            addEventHandler(\"onClientClick\", getRootElement(), function(gomb, allapot, absX, absY)
            if allapot == \"down\" and gomb == \"left\" then
                if dobozbaVan(screenW * 0.2599, screenH * 0.3685, screenW * 0.3005, screenH * 0.3917, absX, absY)  then
            triggerServerEvent ( \"australia\", resourceRoot)   
                           
                end
            end
        end
        )
-------------------------------------------------------Russia-------------------------------------------------------
 
 function dobozbaVan2(dX, dY, dSZ, dM, eX, eY)
            if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then
                return true
            else
                return false
            end
        end
           
           
           
            addEventHandler(\"onClientClick\", getRootElement(), function(gomb, allapot, absX, absY)
            if allapot == \"down\" and gomb == \"left\" then
                if dobozbaVan2(screenW * 0.2599, screenH * 0.3685, screenW * 0.3005, screenH * 0.3917, absX, absY)  then
               triggerServerEvent ( \"russia\", resourceRoot)
                           
                end
            end
        end
        )
 

-------------------------------------------------------Ures Slot-------------------------------------------------------
 
function dobozbaVan3(dX, dY, dSZ, dM, eX, eY)
            if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then
                return true
            else
                return false
            end
        end
           
           
           
            addEventHandler(\"onClientClick\", getRootElement(), function(gomb, allapot, absX, absY)
            if allapot == \"down\" and gomb == \"left\" then
                if dobozbaVan3(screenW * 0.2599, screenH * 0.3685, screenW * 0.3005, screenH * 0.3917, absX, absY)  then
               triggerServerEvent ( \"ures\", resourceRoot)
                           
                end
            end
        end
        )
-------------------------------------------------------Semmmmmmmi xD YOLO-------------------------------------------------------

 
Server:
 

autralia = createTeam ( \"Australia\" )
russia = createTeam ( \"Russia\" )
 
function autralia ()
showCursor (false)
setPlayerTeam ( source, autralia )
fadeCamera(source, true)
            setCameraTarget(source, source)
            outputChatBox (\"#00007F[bL] #FFFFFFA(z) Australia csapatot választottad!\", source, 255,255,255, true)
            spawnPlayer(source, 110.14752, 1684.02576, 17.64063)
end
addEvent(\"australia\", true)
addEventHandler(\"australia\", australia)
function russia ()
showCursor (false)
setPlayerTeam ( source, russia )
fadeCamera(source, true)
            setCameraTarget(source, source)
            outputChatBox (\"#00007F[bL] #FFFFFFA(z) Australia csapatot választottad!\", source, 255,255,255, true)
            spawnPlayer(source, 914.36639, -996.83667, 38.13548)
end
addEvent(\"russia\", true)
addEventHandler(\"russia\", russia)
function ures ()
outputChatBox(\"#00007F[bL] #FFFFFFAz Üres Slot szerinted csak viccből van kiírva?...... #akkorisrányomsz....\", source)
end
addEvent(\"ures\", true)
addEventHandler(\"ures\", ures)

 
A válaszokat előre is köszönöm!
 
Mi a kérdés? Leírom neked a triggerek működését röviden.
 

-- Szerver oldal
function theTriggerFunction()
outputChatBox(\"valami kiválasztva\")
end
addEvent(\"ifSelected\", true) -- hozzáadjuk az eventet
addEventHandler(\"ifSelected\",getRootElement(), theTriggerFunction) -- kell hozzá egy handler is
 
-- Kliens oldal
function onClick()
if -- hova kattint -- then
triggerServerEvent(\"ifSelected\",localPlayer,localPlayer > kívánt hozzáadott változók) -- triggereljük, ezáltal megtörténik a szerveroldalon megadott funkcióban lévő cselekvés.
end
end
addEventHandler(\"onClientClick\", getRootElement(), onClick)

triggerServerEvent
« Válasz #2 Dátum: 2016. augusztus 22. - 13:53:40 »
0 Show voters
Oké, köszönöm, megprobálom ez alapján!

triggerServerEvent
« Válasz #3 Dátum: 2016. augusztus 22. - 13:54:38 »
0 Show voters
Én nem értek a luához, de az első gondolatom ez lenne:
 
function autralia ()
addEvent(\"australia\", true)
addEventHandler(\"australia\", australia)

 
Magyarul elírtad az event nevét. ;)
Ha más a hiba, akkor tovább nem tudok segíteni  :shurg:

triggerServerEvent
« Válasz #4 Dátum: 2016. augusztus 22. - 14:47:32 »
0 Show voters
Bad Argument got Resource !!
(setPlayerTeam, spawnPlayer)

triggerServerEvent
« Válasz #5 Dátum: 2016. augusztus 22. - 15:13:14 »
0 Show voters
Idézetet írta: thegergo02 date=1471870052\" data-ipsquote-contentapp=\"forums\" data-ipsquote-contenttype=\"forums\" data-ipsquote-contentid=\"62778\" data-ipsquote-contentclass=\"forums_Topic
Bad Argument got Resource !!
(setPlayerTeam, spawnPlayer)
 
Pontos debugot küldj

triggerServerEvent
« Válasz #6 Dátum: 2016. augusztus 22. - 15:53:57 »
0 Show voters
Mostmár nem ír semmit, de szintúgy nem müködik :(

Dupla hozzászólás automatikusan összefûzve. ( 2016. augusztus 22. - 15:55:00 )

client:
 

local screenW, screenH = guiGetScreenSize()
addEventHandler(\"onClientRender\", root,
    function()
showCursor(true)
        dxDrawRectangle(screenW * 0.3786, screenH * 0.3102, screenW * 0.2552, screenH * 0.5528, tocolor(0, 0, 0, 170), false)
        dxDrawLine((screenW * 0.4719) - 1, (screenH * 0.3343) - 1, (screenW * 0.4719) - 1, screenH * 0.3731, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5448, (screenH * 0.3343) - 1, (screenW * 0.4719) - 1, (screenH * 0.3343) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.4719) - 1, screenH * 0.3731, screenW * 0.5448, screenH * 0.3731, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5448, screenH * 0.3731, screenW * 0.5448, (screenH * 0.3343) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.4719, screenH * 0.3343, screenW * 0.0729, screenH * 0.0389, tocolor(34, 45, 152, 255), false)
        dxDrawText(\"Blue Gaming System CoD - CsapatVálasztó\", (screenW * 0.3776) - 1, (screenH * 0.3093) - 1, (screenW * 0.6339) - 1, (screenH * 0.3250) - 1, tocolor(0, 0, 0, 255), 0.80, \"pricedown\", \"center\", \"top\", true, true, false, true, false)
        dxDrawText(\"Blue Gaming System CoD - CsapatVálasztó\", (screenW * 0.3776) + 1, (screenH * 0.3093) - 1, (screenW * 0.6339) + 1, (screenH * 0.3250) - 1, tocolor(0, 0, 0, 255), 0.80, \"pricedown\", \"center\", \"top\", true, true, false, true, false)
        dxDrawText(\"Blue Gaming System CoD - CsapatVálasztó\", (screenW * 0.3776) - 1, (screenH * 0.3093) + 1, (screenW * 0.6339) - 1, (screenH * 0.3250) + 1, tocolor(0, 0, 0, 255), 0.80, \"pricedown\", \"center\", \"top\", true, true, false, true, false)
        dxDrawText(\"Blue Gaming System CoD - CsapatVálasztó\", (screenW * 0.3776) + 1, (screenH * 0.3093) + 1, (screenW * 0.6339) + 1, (screenH * 0.3250) + 1, tocolor(0, 0, 0, 255), 0.80, \"pricedown\", \"center\", \"top\", true, true, false, true, false)
        dxDrawText(\"Blue Gaming System CoD - CsapatVálasztó\", screenW * 0.3776, screenH * 0.3093, screenW * 0.6339, screenH * 0.3250, tocolor(255, 255, 255, 255), 0.80, \"pricedown\", \"center\", \"top\", true, true, false, true, false)
        dxDrawLine((screenW * 0.4719) - 1, (screenH * 0.3880) - 1, (screenW * 0.4719) - 1, screenH * 0.4269, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5448, (screenH * 0.3880) - 1, (screenW * 0.4719) - 1, (screenH * 0.3880) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.4719) - 1, screenH * 0.4269, screenW * 0.5448, screenH * 0.4269, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5448, screenH * 0.4269, screenW * 0.5448, (screenH * 0.3880) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.4719, screenH * 0.3880, screenW * 0.0729, screenH * 0.0389, tocolor(34, 45, 152, 255), false)
        dxDrawLine((screenW * 0.4719) - 1, (screenH * 0.4435) - 1, (screenW * 0.4719) - 1, screenH * 0.4824, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5448, (screenH * 0.4435) - 1, (screenW * 0.4719) - 1, (screenH * 0.4435) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine((screenW * 0.4719) - 1, screenH * 0.4824, screenW * 0.5448, screenH * 0.4824, tocolor(0, 0, 0, 255), 1, false)
        dxDrawLine(screenW * 0.5448, screenH * 0.4824, screenW * 0.5448, (screenH * 0.4435) - 1, tocolor(0, 0, 0, 255), 1, false)
        dxDrawRectangle(screenW * 0.4719, screenH * 0.4435, screenW * 0.0729, screenH * 0.0389, tocolor(34, 45, 152, 255), false)
        dxDrawText(\"Australia\", screenW * 0.4719, screenH * 0.3361, screenW * 0.5448, screenH * 0.3731, tocolor(255, 255, 255, 255), 1.00, \"pricedown\", \"center\", \"center\", false, false, true, false, false)
        dxDrawText(\"Russia\", screenW * 0.4719, screenH * 0.3898, screenW * 0.5448, screenH * 0.4269, tocolor(255, 255, 255, 255), 1.00, \"pricedown\", \"center\", \"center\", false, false, true, false, false)
        dxDrawText(\"Üres Slot\", screenW * 0.4719, screenH * 0.4454, screenW * 0.5448, screenH * 0.4824, tocolor(255, 255, 255, 255), 1.00, \"pricedown\", \"center\", \"center\", false, false, true, false, false)
    end
)
-------------------------------------------------------Australia-------------------------------------------------------
function dobozbaVan(dX, dY, dSZ, dM, eX, eY)
            if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then
                return true
            else
                return false
            end
        end
           
           
           
            addEventHandler(\"onClientClick\", getRootElement(), function(gomb, allapot, absX, absY)
            if allapot == \"down\" and gomb == \"left\" then
                if dobozbaVan(screenW * 0.2599, screenH * 0.3685, screenW * 0.3005, screenH * 0.3917, absX, absY)  then
            triggerServerEvent ( \"australia\", resourceRoot)   
                           
                end
            end
        end
        )
-------------------------------------------------------Russia-------------------------------------------------------
 
 function dobozbaVan2(dX, dY, dSZ, dM, eX, eY)
            if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then
                return true
            else
                return false
            end
        end
           
           
           
            addEventHandler(\"onClientClick\", getRootElement(), function(gomb, allapot, absX, absY)
            if allapot == \"down\" and gomb == \"left\" then
                if dobozbaVan2(screenW * 0.2599, screenH * 0.3685, screenW * 0.3005, screenH * 0.3917, absX, absY)  then
               triggerServerEvent ( \"russia\", resourceRoot)
                           
                end
            end
        end
        )
 

-------------------------------------------------------Ures Slot-------------------------------------------------------
 
function dobozbaVan3(dX, dY, dSZ, dM, eX, eY)
            if(eX >= dX and eX <= dX+dSZ and eY >= dY and eY <= dY+dM) then
                return true
            else
                return false
            end
        end
           
           
           
            addEventHandler(\"onClientClick\", getRootElement(), function(gomb, allapot, absX, absY)
            if allapot == \"down\" and gomb == \"left\" then
                if dobozbaVan3(screenW * 0.2599, screenH * 0.3685, screenW * 0.3005, screenH * 0.3917, absX, absY)  then
               triggerServerEvent ( \"ures\", resourceRoot)
                           
                end
            end
        end
        )
-------------------------------------------------------Semmmmmmmi xD YOLO-------------------------------------------------------

 
server:
 

australia = createTeam ( \"Australia\" )
russia = createTeam ( \"Russia\" )
 
function australia ()
showCursor (source,false)
setPlayerTeam ( source, australia )
fadeCamera(source, true)
            setCameraTarget(source, source)
            outputChatBox (\"#00007F[bL] #FFFFFFA(z) Australia csapatot választottad!\", source, 255,255,255, true)
            spawnPlayer(source, 110.14752, 1684.02576, 17.64063)
end
addEvent(\"australia\", true)
addEventHandler(\"australia\",getRootElement(), australia)
function russia ()
showCursor (source,false)
setPlayerTeam ( source, russia )
fadeCamera(source, true)
            setCameraTarget(source, source)
            outputChatBox (\"#00007F[bL] #FFFFFFA(z) Australia csapatot választottad!\", source, 255,255,255, true)
            spawnPlayer(source, 914.36639, -996.83667, 38.13548)
end
addEvent(\"russia\", true)
addEventHandler(\"russia\",getRootElement(), russia)
function ures ()
outputChatBox(\"#00007F[bL] #FFFFFFAz Üres Slot szerinted csak viccből van kiírva?...... #akkorisrányomsz....\", source)
end
addEvent(\"ures\", true)
addEventHandler(\"ures\",getRootElement(), ures)

triggerServerEvent
« Válasz #7 Dátum: 2016. augusztus 22. - 16:27:45 »
0 Show voters
Írd újra, és minden megírt funkció után nézd meg hogy működik e.

triggerServerEvent
« Válasz #8 Dátum: 2016. augusztus 22. - 21:49:08 »
0 Show voters
Oké, holnap megcsinálom.

 

SimplePortal 2.3.7 © 2008-2024, SimplePortal