Jump to content

Pirulax

Discord Moderators
  • Posts

    403
  • Joined

  • Last visited

Everything posted by Pirulax

  1. Okey, i am very tired, so here is the edited code ---- Client local y, x = guitGetScreenSize() local lowY = 800 local lowX = 600 if x == lowX and y == lowY then triggerServerEvent("kickPlayerForLowRes", localPlayer, getLocalPlayer()) end ---- Server addEvent("kickPlayerForLowRes", true) addEventHandler("kickPlayerForLowRes", getRootElement(), function(thePlayer) kickPlayer(thePlayer, "Your screen resolution is too low!") end)
  2. And this: createColSphere And this event: onColShapeHit And if you wish to mark the position of crateColSphere: createMarker Good Luck
  3. So, you solved the problem? Btw here is my code local x, y = guitGetScreenSize() local lowY = 800 local lowX = 600 if x == lowX and y == lowY then kickPlayer(thePlayer, "Your screen resolution is too low!") end :
  4. Maybe?I just asked a question, its not that important where i need it. But, if you really want to know: Not for an EG mod based server
  5. So, i wrote a little script(okey, its mutch bigger, but, this is the part what i cant solve..), so basically if the player not turned off the message receive function, then he will receive this message: function displayMessage(player) outputChatBox("====================" .. rovid .. "====================", player, 121, 121, 121, true) outputChatBox("#D24D57Szia kedves játékos!", player, 121, 121, 121, true) outputChatBox("Ha téged meghivtak erre a szerverre, akkor kérlek ird be a következő parancsot a ", player, 121, 121, 121, true) outputChatBox("Chat-be: #D24D57/invite <Meghivókód>#7a7a7a, ha a kódot sikeresen beaktiváltad, akkor ", player, 121, 121, 121, true) outputChatBox("#D24D57500 000 dollárt#7a7a7a, és #D24D5730 000PP-t#7a7a7a kapsz ajádnékba!Ha valaki felhasználja a te invite kódodat akkor kapsz #D24D5750 000 dollárt#7a7a7a, és #D24D575000 PP-t #7a7a7aminden emberért aki a te kódodat aktiválja be!", player, 121, 121, 121, true) outputChatBox("Ha pedig nem hivtak meg, és kódod sincs, akkor ha szeretnéd, a #D24D57/toginvite #7a7a7aparanccsal tudod kikapcsolni ennek a szövegnek a kiirását!", player, 121, 121, 121, true) outputChatBox("Több infóért ird be,hogy #D24D57/invite help", player, 121, 121, 121, true) outputChatBox("=================================================================", player, 121, 121, 121, true) end and this is the script what checks that the player have turned on, or off the function: addEvent("toDisplayMessage", true) function toDisplayMessage(player1) local getPoll = dbPoll(dbQuery(con, "SELECT * FROM accounts WHERE id = ?", getElementData(player1, "acc:id")), -1) if #getPoll > 0 then for _, row in ipairs(getPoll) do if (row["sendMessage"] == 1) then displayMessage(player1) end end --else --displayMessage(player1) end end addEventHandler("toDisplayMessage", getRootElement(), toDisplayMessage) And this is the timer what sends the message every 15 minutes to the players who have turned on the recieve message function: addEventHandler("onResourceStart", root, function() setTimer(function() for k, player in ipairs(getElementsByType("player")) do toDisplayMessage(player) end end,1000*60*15, 1) end) And my problem is the following: It sends the message sometimes 10 or more times to one player, i dont have any idea to solve it.
  6. Hello guys!How can i use the variables bannedBy, and accountID outside of this code block? local bannedBy local accountID for _, row in ipairs(query) local bannedBy = row["bannedBy"] local accountID = row["accountID"] end
  7. Pirulax

    Little mysql

    so: result = dbPoll(dbQuery(con, "SELECT * FROM groupattach WHERE characterID = ? AND groupID = ?", getElementData(targetPlayer, "char:id"), fraction), -1) if #result == 0 then ---do something end
  8. Pirulax

    Little mysql

    Hello guys!I know its a little bit stupid question, but i cant get this code to work.. if dbExec(con, "SELECT * FROM groupattach WHERE characterID = ? AND groupID = ?", getElementData(targetPlayer, "char:id"), fraction) == nil then --do something end connection is working, the query is working, but the IF statment not.. i think because it is a table, and it cant be nil?
×
×
  • Create New...