Rat32 Posted April 14, 2015 Share Posted April 14, 2015 Hi. I apologize in advance for my bad English. Well, I have no clue why it does not work, serverEvent indicates nil, even if it is probably good. I'm sending you the current status of the script. Everything works except that at the end of the timer does not release a player from his cell. Regards. CLIENT: addEvent("wypuszczony", true) addEvent("zamkneles", true) addEvent("zostaleszamkniety", true) addEvent("zlygracz", true) addEvent("puchatimer", true) function info1() exports["notifications"]:showBox("info","Zostałeś zamknięty na okres 10 minut. Po wyjściu z serwera i po ponownym wejściu kara znowu zostanie zresetowana na 10 minut, bez względu na to ile odziedziałeś wcześniej.") end addEventHandler("zostaleszamkniety", getRootElement(), info1) function info2() exports["notifications"]:showBox("info","Zostałeś wypuszczony. Postaj się nie trafić tutaj ponownie.") end addEventHandler("wypuszczony", getRootElement(), info2) function info3() exports["notifications"]:showBox("info","Zamknęłeś wybranego gracza w areszcie.") end addEventHandler("zamkneles", getRootElement(), info3) function info4() exports["notifications"]:showBox("error","Niepoprawna nazwa użytkownika.") end addEventHandler("zlygracz", getRootElement(), info4) function puchatimers(who) setTimer(function(who) triggerServerEvent("accountdata", resourceRoot) end, 5000, 1) end addEventHandler("puchatimer", getRootElement(), puchatimers) SERVER: addEvent("accountdata", true) function zapuszkuj(player, cmd, who) who = getPlayerFromName(who) if (who) then playeraccount = getPlayerAccount ( who ) setAccountData(playeraccount, "areszt", 1) setElementPosition(who, -1948.09949, 274.29776, 35.47393) triggerClientEvent(who, "puchatimer", resourceRoot) triggerClientEvent(player, "zamkneles", resourceRoot) triggerClientEvent(who, "zostaleszamkniety", resourceRoot) else triggerClientEvent(player, "zlygracz", resourceRoot) end end addCommandHandler("aresztuj", zapuszkuj) function antitrick() end function ustawdate(who) playeraccount = getPlayerAccount ( who ) setAccountData(playeraccount, "areszt", 0) setElementPostion(who, -1951.99268, 276.64502, 35.46875) end addEventHandler("accountdata", getRootElement(), ustawdate) Link to comment
Addlibs Posted April 14, 2015 Share Posted April 14, 2015 Client, Line 30: setTimer(function(who) triggerServerEvent("accountdata", resourceRoot) end, 5000, 1) Change to: setTimer(function(player) triggerServerEvent("accountdata", resourceRoot, player) end, 5000, 1, who) Link to comment
Addlibs Posted April 15, 2015 Share Posted April 15, 2015 Try changing it change to: --Line 10: triggerClientEvent(who, "puchatimer", who) --Line 30: setTimer(function(player) triggerServerEvent("accountdata", resourceRoot, player) end, 5000, 1, source) Link to comment
ALw7sH Posted April 15, 2015 Share Posted April 15, 2015 (edited) if you trigger with resourceRoot so the event handler should be resourceRoot too addEvent("wypuszczony", true) addEvent("zamkneles", true) addEvent("zostaleszamkniety", true) addEvent("zlygracz", true) addEvent("puchatimer", true) function info1() exports["notifications"]:showBox("info","Zostałeś zamknięty na okres 10 minut. Po wyjściu z serwera i po ponownym wejściu kara znowu zostanie zresetowana na 10 minut, bez względu na to ile odziedziałeś wcześniej.") end addEventHandler("zostaleszamkniety", getRootElement(), info1) function info2() exports["notifications"]:showBox("info","Zostałeś wypuszczony. Postaj się nie trafić tutaj ponownie.") end addEventHandler("wypuszczony", getRootElement(), info2) function info3() exports["notifications"]:showBox("info","Zamknęłeś wybranego gracza w areszcie.") end addEventHandler("zamkneles", getRootElement(), info3) function info4() exports["notifications"]:showBox("error","Niepoprawna nazwa użytkownika.") end addEventHandler("zlygracz", getRootElement(), info4) function puchatimers(who) setTimer(function(who) triggerServerEvent("accountdata", resourceRoot) end, 5000, 1,who) end addEventHandler("puchatimer", resourceRoot, puchatimers) addEvent("accountdata", true) function zapuszkuj(player, cmd, who) who = getPlayerFromName(who) if (who) then playeraccount = getPlayerAccount ( who ) setAccountData(playeraccount, "areszt", 1) setElementPosition(who, -1948.09949, 274.29776, 35.47393) triggerClientEvent(who, "puchatimer", resourceRoot,who) triggerClientEvent(player, "zamkneles", resourceRoot) triggerClientEvent(who, "zostaleszamkniety", resourceRoot) else triggerClientEvent(player, "zlygracz", resourceRoot) end end addCommandHandler("aresztuj", zapuszkuj) function antitrick() end function ustawdate(who) playeraccount = getPlayerAccount ( who ) setAccountData(playeraccount, "areszt", 0) setElementPostion(who, -1951.99268, 276.64502, 35.46875) end addEventHandler("accountdata", resourceRoot, ustawdate) Edited April 15, 2015 by Guest Link to comment
ALw7sH Posted April 15, 2015 Share Posted April 15, 2015 Copy codes on my reply again Link to comment
Addlibs Posted April 17, 2015 Share Posted April 17, 2015 Share the code you have right now, and any /debugscript 3 errors that come up Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now