Wysłany: 2013-04-01, 22:24
qazxsw
Wiek: 31 Na forum: 4864 dni Posty: 18
Nick w MP: qazxsw
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)
Wysłany: 2013-04-01, 22:42
Riot
3X
Wiek: 29 Na forum: 5729 dni Posty: 1123
Nick w MP: Riot/3X
Piwa : 286
Te "/" to co to ma by? ?e si? wyra?e...? Bo...Nie ogarniam.
Wysłany: 2013-04-01, 23:14
Brzysiek
Skrypter pralek
Wiek: 27 Na forum: 5198 dni Posty: 488
Nick w MP: Brzysiek
Piwa : 1034
Serio? >: D
We? napisz co? swojego, wtedy kto? Ci pomo?e..
Wysłany: 2013-04-03, 13:50
Piorun
Wiek: 32 Na forum: 6712 dni Posty: 1837
Nick w MP: Piorun
Piwa : 516
Ziomek11 , to by? kod zakodowany, a to jest odkodowany je?eli si? nie myl?.
Wysłany: 2013-04-03, 18:59
PanGrzybulek
Wiek: 28 Na forum: 4823 dni Posty: 47
Nick w MP: Mentosik
Piwa : 3
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.
Tagi: anty :: relog
Anonymous
Na forum: 245 dni
Posty: 1
Anonymous Koniecznie zajrzyj na: