Jump to content

NeXuS™

Retired Staff
  • Posts

    1,134
  • Joined

  • Last visited

  • Days Won

    37

Everything posted by NeXuS™

  1. Is it getting called? function randomWeather() setTimer ( function() setWeather(table.random(weather)) end, 1000, 0 ) end randomWeather()
  2. weather = {1, 8, 9, 19} function table.random ( theTable ) return theTable[math.random ( #theTable )] end function randomWeather() setTimer ( function() setWeather(table.random(weather)) end, 600000, 0 ) end Btw. Next time use <> tags.
  3. @harryh, try using the in-built functions of MTA. That module is old already, and the in-built functions are much better. local dbConnection = dbConnect(...) local nrQuery = dbQuery(dbConnection, ...) local rQuery = dbPoll(nrQuery, -1) for i, k in ipairs(rQuery) do *do something with the query* end
  4. Buddy, we won't make you everything. Show us a bit of something, that shows you are trying to reach what you want.
  5. I genuinely don't know what you want.
  6. The script which I sent you takes the forbidden weapons from you if you switch to them.
  7. I don't understand at all what you are trying to say... Destroy the gun? What the hack?
  8. function illegalWeaponFound ( player, weapon ) toggleControl ( "fire", false ) toggleControl ( "action", false ) triggerServerEvent ( "onIllegalWeapon", getLocalPlayer(), weapon, getPlayerName(source)) end addEvent ( "onIllegalWeapon", true ) addEventHandler ( "onIllegalWeapon", getRootElement(), function ( weaponID, pName ) outputChatBox ( "#FF0000The Player #FFFFFF" ..pName.. " #FF0000Has Been Kicked Because He use #00FF00" ..getWeaponNameFromID(weaponID).. "#FF0000", getRootElement(), 255, 0, 0, true ) takeWeapon(source, weaponID) setTimer ( kickPlayer , 1000 , 1 , source , "You Use An Forbidden Weapon!") end ) I suppose you want this.
  9. Would you put your code between <> tags?
  10. Server side addEventHandler("onPlayerJoin", getRootElement(), function() setElementData(source, "halhatatlan", true) end) addEventHandler("onResourceStart", getResourceRootElement(), function() for i, k in ipairs(getElementsByType("player")) do setElementData(k, "halhatatlan", true) end end) Client side function halhatatlansag() if getElementData(source, "halhatatlan") then cancelEvent() end end addEventHandler("onClientPlayerDamage", localPlayer, halhatatlansag) addCommandHandler("godmode", function() setElementData(localPlayer, "halhatatlan", not getElementData(localPlayer, "halhatatlan")) outputChatBox("#FF0000[INFO]#FFFFFF Halhatalanság " .. (getElementData(localPlayer, "halhatatlan") and "bekapcsolva" or "kikapcsolva") .. ".", 0, 0, 0, true) end) Works just totally fine for me.
  11. Buddy, you don't understand my post above at all. He thought he wrote if getElementData(...) == true then with if getElementData(..., ..., true) then So if he wanted to write if getElementData(...) == false then he would just write if getElementData(..., ..., false) then So before he thought that this is the way he would do it, I corrected his code, so he doesn't think that he is checking the elementdata with that true as the last argument.
  12. So why would he just write in true, and not leave it blank? If you would know this person, you would know what he was thinking when he wrote that "true" in there.
  13. @LoPollo, he doesn't need to register inherit at all in this script, could leave it blank. Working on finding the problem right now, so I can post a full code here, with explanation.
  14. addEventHandler("onPickupUse",getRootElement(),function(thePlayer) triggerClientEvent(thePlayer, "playPickup", source, playPickup) destroyElement(source) end)
  15. Replace line nr 2. with if getElementData(source, "halhatatlan") then
  16. Can you paste you server sided script too? (This is an event, and it's being called by the server sided script.)
  17. Your problem in your code was a huge mistake. if jatekos and not indok and getElementData(admin, "gm", true) then local jatekos = getPlayerFromName(jatekos) kickPlayer (jatekos, admin, "Ismeretlen indok.") if indok and getElementData(admin, "gm", true) then kickPlayer (jatekos, admin, indok) end end First it checks, if you wrote anything in the "jatekos" arg. If yes, it goes by, and check if there is no "indok" set before, if there is nothing set to indok, it goes by. After it, checks for admin priviliges (I suppose), if you have, again, it goes by. After it's in the true part, it checks for the palyer by just name, and tries to kick him. (Which could lead to an error, if there is no one up on the server with that name. After the player got kicked, it checks for the "indok" arg, which CANNOT BE SET, because you checked at your first line if the "indok" arg doesn't exist. Which leads to that the if statements true part won't be triggered because it will be if false and true then -> if false then (false and true equals false, for the AND operator, you need two TRUE args to be passed to return TRUE.) And btw, if the script actually got somehow into that part (but it'll never), the player would be already kicked, and there is no way to kick a player who is not online.
  18. addEvent("playPickup",true) addEventHandler("playPickup",root, function() playSound("drops/pickuped.wav") end) function MarkerHit ( hitPlayer, matchingDimension ) if hitPlayer == localPlayer then playSound("drops/pickuphit.wav") end end addEventHandler ( "onClientMarkerHit", getRootElement(), MarkerHit )
  19. Which line doesn't kick? Line nr. 10 or 12? Nvm, give me a minute, gonna fix it. function kirugas(admin, parancs, jatekos, indok) if not getElementData(admin, "gm", true) then outputChatBox ("#A1D490[King of the Kill]#FFFFFF Nincs jogod a parancs használatához.", admin, 255, 255, 255, true) end if not jatekos and getElementData(admin, "gm", true) then outputChatBox ("#A1D490[King of the Kill] #FFFFFFHibás szintaxis. Helyes: #A1D490/"..parancs.." #86B5DB[játékosnév] [opcionális indok]", admin, 255, 255, 255, true) end local jatekos = getPlayerFromName(jatekos) if jatekos and not indok and getElementData(admin, "gm", true) then kickPlayer (jatekos, admin, "Ismeretlen indok.") elseif indok and jatekos and getElementData(admin, "gm", true) then kickPlayer (jatekos, admin, indok) end end addCommandHandler ("kirugas", kirugas) This one should work.
  20. Try debugging it. (Use outputChatBox with the skinID, so you can see what's happening.)
  21. Edited the post buddy, just check it.
  22. local restMinutes = 0 function shutdownCmd(player,cmd,minutes,...) local reason = table.concat({ ... }, " ") local minutes = tonumber(minutes) restMinutes = minutes if #reason > 0 then outputChatBox("The server is going down in about "..minutes.." minutes.",root) outputChatBox(reason,root) setTimer(function() restMinutes = restMinutes - 1 outputChatBox("The server is shutting down in " .. restMinutes .. " minutes.",root,255,255,255,true) end, 60000, minutes) setTimer(shutdown, 60000*minutes, 1, reason) end end addCommandHandler("servershutdown",shutdownCmd)
  23. setTimer(function() outputChatBox("Down",root,255,255,255,true) end,tonumber(minutes)*60000,minutes)
  24. NeXuS™

    Complie

    You can edit your post after it's read by one of us and fixed bud. Maybe think before commenting. @Tails
×
×
  • Create New...