Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local quest_players = {}
- function quest_list(plr)
- if qid == 1 then
- table.insert(quest_players,{quest=qid,player=plr})
- addEventHandler("onPlayerCommand", root, quest1)
- end
- end
- addEvent("onPlayerRequestIBContents", true)
- addEventHandler("onPlayerRequestIBContents", root, function(nr)
- dane=exports["psz-mysql"]:pobierzWyniki(string.format("SELECT id,tresc FROM psz_quests WHERE id=%d LIMIT 1", nr))
- if (dane) then
- local q = string.format("INSERT INTO psz_players_quests SET player_id=%d, quest_id=%d, data_wziecia=NOW()", uid, dane.id)
- exports['psz-mysql']:zapytanie(q)
- triggerClientEvent(source, "onIBContentsRcvd", resourceRoot, dane)
- else end
- end)
- addEvent("removeFailData", true)
- addEventHandler("removeFailData", root, function(el)
- removeElementData(el, "failedToImportQuest")
- end)
- -- questy
- function quest1(cmd)
- if cmd == "walisz" then
- for i=1,#quest_players do
- if quest_players[i]['player'] == source then
- outputChatBox("gut gut", getRootElement(), 255,0,0)
- table.remove(quest_players,i)
- removeEventHandler("onPlayerCommand", root, quest1)
- end
- end
- end
- end
- t
- addEvent("applyQuest", true)
- addEventHandler("applyQuest", root, quest_list)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement