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

Wysłany: 2016-06-16, 19:48


kubak14







Wiek: 24
Na forum: 5205 dni
Posty: 119
Nick w MP: Heavy

Piwa: 149

Respekt: 45,8

Ostrzeżeń: 20%
Witajcie mam problem poniewa? gdy gracz wychodzi to sie nie wykonuje trigger do servera? wszystko dzia?a poprawnie (mam na my?li #postacie lista[1] > 0)

C

function onQuitGame()
    if #postacieLista[1] > 0 then
        table.insert(postacieLista[1], {imiePnazwiskoPwiekPplecPpochodzeniePgetElementModel(localPlayer), getPlayerMoney(localPlayer), "Brak", (getElementData(localPlayer"gracz:punkty") or 0)})
        triggerServerEvent "changeCharacters"localPlayerlocalPlayertoJSON(postacieLista))
    elseif #postacieLista[1] == 0 then
        table.insert(postacieLista, {{imiePnazwiskoPwiekPplecPpochodzeniePgetElementModel(localPlayer), getPlayerMoney(localPlayer), "Brak", (getElementData(localPlayer"gracz:punkty") or 0)}})
        triggerServerEvent "changeCharacters"localPlayerlocalPlayertoJSON(postacieLista))
    end
end

addEvent"onQuitGame"true )
addEventHandler"onQuitGame"localPlayeronQuitGame )


S

function quitPlayer ( )
    triggerClientEvent source"onQuitGame"source )
    outputDebugString("Exit "..getPlayerName(source))
end
addEventHandler "onPlayerQuit"getRootElement(), quitPlayer )


Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-06-16, 19:58


Atroth







Wiek: 23
Na forum: 3677 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4808

Respekt: 540
Respekt: 540

Brak tabeli do table.insert (chyba tak to si? nazywa :D )

Podpis

Użytkownik - 10-05-2016
Support Team - 17.06.2017
Moderator - 25.11.2017
Mod-Team - 02.07.2018

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-06-16, 20:11


kubak14







Wiek: 24
Na forum: 5205 dni
Posty: 119
Nick w MP: Heavy

Piwa: 149

Respekt: 45,8

Ostrzeżeń: 20%
Mam tabele... Przecie? nei dam calego kodu bez przesady

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-06-16, 20:32


Atroth







Wiek: 23
Na forum: 3677 dni
Posty: 1089
Nick w MP: Atroth

Piwa: 4808

Respekt: 540
Respekt: 540

A spr?buj tak:


addEvent"onQuitGame"true )
addEventHandler"onQuitGame"localPlayeronQuitGame 
   if #postacieLista[1] > 0 then
        table.insert(postacieLista[1], {imiePnazwiskoPwiekPplecPpochodzeniePgetElementModel(localPlayer), getPlayerMoney(localPlayer), "Brak", (getElementData(localPlayer"gracz:punkty") or 0)})
        triggerServerEvent "changeCharacters"localPlayerlocalPlayertoJSON(postacieLista))
    elseif #postacieLista[1] == 0 then
        table.insert(postacieLista, {{imiePnazwiskoPwiekPplecPpochodzeniePgetElementModel(localPlayer), getPlayerMoney(localPlayer), "Brak", (getElementData(localPlayer"gracz:punkty") or 0)}})
        triggerServerEvent "changeCharacters"localPlayerlocalPlayertoJSON(postacieLista))
    end
end
)


@Edit

U siebie te? cz?sto mia?em takie problemy i to zazwyczaj pomaga?o.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2016-06-16, 20:40


kubak14







Wiek: 24
Na forum: 5205 dni
Posty: 119
Nick w MP: Heavy

Piwa: 149

Respekt: 45,8

Ostrzeżeń: 20%
Co to mialo by zmienic a po 2 i tak nie dzia?a...

Postaw piwo autorowi tego posta
 

 
Tagi: trigger?
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






Skocz do:  
Wyświetl posty z ostatnich:   
GTAONLINE.PL » JĘZYKI PROGRAMOWANIA » LUA » Trigger? 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