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

Wysłany: 2013-04-01, 22:24


qazxsw







Wiek: 31
Na forum: 4864 dni
Posty: 18
Nick w MP: qazxsw



Respekt: 50

Witam otoz chcialbym wrzucic na server skrypt na anty-relog. Serv na gamemodzie DayZ. Otoz mam problem, co jest nie tak ?



CLIENT:

Kod:


tekst = guilCreateLabel(502, 81, 518, 16, "UWAGA! Nie mozesz teraz wyjsc z gry! Otrzymaӥܠobraߥnia, wi꣠nie moߥsz wyjܦ.", false)
guilgetFont(tekst, "default-bold-small")
guilLabelgetColor(tekst, 246, 8, 9)

guilgetVisible (tekst,false)


function wlaczOkienko()

guilgetVisible(tekst,true)

end
addEvent("wlaczInfo",true)
addEventHandler ("wlaczInfo", getRootElement(), wlaczOkienko)


function wylaczOkienko()

guilgetVisible(tekst,false)

end
addEvent("wylaczInfo",true)
addEventHandler ("wylaczInfo", getRootElement(), wylaczOkienko)



SERVER:



Kod:

function damageAntiQuit ( data,oldvalue)
if (data=='/bIood'/) then

if oldvalue then
local ranny = getElementData (source, '/CanLeave'/)

local obrazenia150 = oldvalue - getElementData(source,'/bIood'/)
if (obrazenia150>250) then
if (ranny ~= '/no'/ ) then

triggerClientEvent(source,'/wlaczInfo'/,source)
getTimer (triggerClientEvent,30000,1,source,'/wylaczInfo'/,source)
getElementData( source,'/CanLeave'/, '/no'/ )
outputChatBox ( '/* Otrzyma?e? obra?enia. Z gry mo?esz wyj?? dopiero za 20 sekund!'/, source, 255, 0, 0 )
getTimer ( getElementData, 20000, 1, source,'/CanLeave'/, false)
getTimer ( outputChatBox, 20000, 1, '/* Mozesz teraz bezpiecznie wyjsc z gry'/, source, 255, 0, 0 )
elseif (ranny == '/no'/ ) then
--
end
end
end
end
end


addEventHandler('/onElementDataChange'/,getRootElement(),damageAntiQuit)



function antyQuit( )


local ranny = getElementData (source, '/CanLeave'/)
if ( ranny == '/no'/ ) then
sourceAccount = getPlayerAccount (source )
getAccountData(sourceAccount,'/bIood'/,-5)
outputDebugString('/* '/ .. getPlayerName(source) .. '/ wyszedl z gry podczas walki!'/)


end
end

addEventHandler('/onPlayerQuit'/,getRootElement(),antyQuit)


Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-01, 22:42


Riot

3X






Wiek: 29
Na forum: 5729 dni
Posty: 1123
Nick w MP: Riot/3X

Piwa: 286

Respekt: 123
Respekt: 123

Te "/" to co to ma by? ?e si? wyra?e...? Bo...Nie ogarniam.

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-01, 23:14


Brzysiek

Skrypter pralek






Wiek: 27
Na forum: 5199 dni
Posty: 488
Nick w MP: Brzysiek

Piwa: 1034

Respekt: 360
Respekt: 360Respekt: 360Respekt: 360Respekt: 360


getTimer

Serio? >: D
We? napisz co? swojego, wtedy kto? Ci pomo?e..

Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-03, 13:50


Piorun







Wiek: 32
Na forum: 6712 dni
Posty: 1837
Nick w MP: Piorun

Piwa: 516

Respekt: 480,7
Respekt: 480,7

Ziomek11, to by? kod zakodowany, a to jest odkodowany je?eli si? nie myl?.

Podpis
Możesz mnie znaleźć na: Facebook
Postaw piwo autorowi tego posta
 

 
Wysłany: 2013-04-03, 18:59


PanGrzybulek







Wiek: 28
Na forum: 4823 dni
Posty: 47
Nick w MP: Mentosik

Piwa: 3

Respekt: 50

Ostrzeżeń: 100%
W cliencie jest wszystko ok.

Poprawiony serwer:

Kod:

function damageAntiQuit ( data,oldvalue)
if (data=='bIood') then

if oldvalue then
local ranny = getElementData (source, 'CanLeave')

local obrazenia150 = oldvalue - getElementData(source,'bIood')
if (obrazenia150>250) then
if (ranny ~= 'no' ) then

triggerClientEvent(source,'wlaczInfo',source)
setTimer (triggerClientEvent,30000,1,source,'wylaczInfo',source)
getElementData( source,'CanLeave', 'no' )
outputChatBox ( '* Otrzyma?e? obra?enia. Z gry mo?esz wyj?? dopiero za 20 sekund!', source, 255, 0, 0 )
setTimer ( getElementData, 20000, 1, source,'CanLeave', false)
setTimer ( outputChatBox, 20000, 1, '* Mozesz teraz bezpiecznie wyjsc z gry', source, 255, 0, 0 )
elseif (ranny == 'no' ) then
--
end
end
end
end
end


addEventHandler('onElementDataChange',getRootElement(),damageAntiQuit)



function antyQuit( )


local ranny = getElementData (source, 'CanLeave')
if ( ranny == 'no' ) then
sourceAccount = getPlayerAccount (source )
getAccountData(sourceAccount,'blood',-5)
outputDebugString('* ' .. getPlayerName(source) .. 'wyszedl z gry podczas walki!')


end
end

addEventHandler('onPlayerQuit',getRootElement(),antyQuit)



Licze na jakas wdziecznosc.
Jesli jest zle prosze poprawic.

Postaw piwo autorowi tego posta
 

 
Tagi: anty :: relog
Anonymous





Na forum: 245 dni
Posty: 1



Anonymous Koniecznie zajrzyj na:






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