
WiBox
Members-
Posts
234 -
Joined
-
Last visited
Everything posted by WiBox
-
Timer10 = setTimer( function () time0 = 1 for _,plrs in ipairs(getElementsByType("player")) do if ( getElementDimension (plrs) == 0 ) then if ( not addCommandHandler("usemedkit", usethemedkit) ) then addCommandHandler("usemedkit", usethemedkit) addCommandHandler("acceptmedkit", healOthers) addEventHandler("meds.giveMedKit", root, giveMedKit) addEventHandler("meds.useMedKitOnOther", root, usemedkitanother) end if ( addCommandHandler("usemedkit", usethemedkit) ) then killTimer(Timer10) end if ( getElementDimension (plrs) == 336 ) then if ( addCommandHandler("usemedkit", usethemedkit) ) then killTimer(Timer10) end if ( not addCommandHandler("usemedkit", usethemedkit) ) then resetTimer(Timer10) end if ( addCommandHandler("usemedkit", usethemedkit) ) then killTimer(Timer10) end timer0 = timer0 - 1 if ( timer0 < 0 ) then killTimer(Timer10) end end end end end, 1000, 0) I made that script but my problem is it's saying in console: addEventHandler ['meds.useMedKit with this function is already handled], I tried like 6 times fix it so it stop spamming in the console but it isn't working.. Can someone help please? I just need a way to stop the spams in my console.. I tried killTimer but didn't work, I appreciate who help and thanks.
-
Hello, I was thinking if I can specify a command! example, if player used command /say it will send a message to him{example I don't want to use onPlayerChat, I want to specify if a player used a command}.. Is there a way? and thanks~
-
function showZoneOutput() guiSetText(zoneCreator.edit[1], string.format('%.3f', x)) guiSetText(zoneCreator.edit[2], string.format('%.3f', y)) guiSetText(zoneCreator.edit[3], string.format('%.3f', w)) guiSetText(zoneCreator.edit[4], string.format('%.3f', d)) end Those are the format of the x, y, sx, sy. I want to add those into the table zone.. those are in client side, and I want to add them into the server side in the table zones = {} is there a way so I do that?
-
Hello... I made a panel which add zone on the coordination I write in it, but I just need to ask! Is there a way the zone I create his information get auto-writted in this zones = { ... } ? zones = { --{id,name,owner,ctrl,price,objects,radio,x,y,sx,sy} -- {id = 1, name = "Test zone", owner = "TsT", ctrl = "", price = 10000, objects = 0, radio = "", x = 1577, y = 1723, sx = 60, sy = 140} }
-
zones = { --{id,name,owner,ctrl,price,objects,radio,x,y,sx,sy} -- {id = 1, name = "Test zone", owner = "TsT", ctrl = "", price = 10000, objects = 0, radio = "", x = 1577, y = 1723, sx = 60, sy = 140} } blips = {} zoneSQL = query( "SELECT * FROM zones" ) objectsZones = {} function onStart() for ind,val in ipairs(zoneSQL) do zones[ind] = val zones[ind].z = createColRectangle(val.x,val.y,val.sx,val.sy) setTimer(function () triggerClientEvent(root,"zones.addZonesLines",root,val.x,val.y,val.sx,val.sy,0,255,0) end,2000,1) setElementData(zones[ind].cz,"ind",ind) setElementData(zones[ind].cz,"val",val) addEventHandler ( "onColShapeHit", zones[ind].z, zoneHit ) addEventHandler ( "onColShapeLeave", zones[ind].z, zoneLeave ) local players = getElementsByType ( "player" ) for theKey,thePlayer in ipairs(players) do setElementData(thePlayer, "zones.editingEntity", false) end end end addEventHandler("onResourceStart", resourceRoot, onStart) That a small part of a script, on line 19 { addEventHandler ( "onColShapeHit", zones[ind].z, zoneHit ) } in the function zoneHit is about setElementData(plr,"zone"... my only problem is that the element isn't getting set on zone, I was thinking if the problem is from zones[ind].z, because, zone[ind].z use x, y, sx, sy from ( zone = { ) and I added the zone using a panel but when I add it, it say "you are not in a zone" because the function of "you are not in a zone", add a object in the function I'm speaking of, I use ( getElementData(plr,"zone"), as I said in zoneHit I used in it setElementData("plr,"zone".... , so at line 19 { addEventHandler ( "onColShapeHit", zones[ind].z, zoneHit ) } as I said use zones[ind].z and it use createCol... with val(zoneSQL which return to zones[zones = { ]) x and y and sx and sy, that's why I wanted to ask when I add the zone with a panel I created should I do a way so it get added in [ zones = { ]. or if there another reason it say you are not in a zone I appreciate who help and give some hints... ty.
-
Oh I found a idea, if I execute F11 command and I hide the radar It will work right?!
-
second https://imgur.com/a/asnP7tZ this radar, also from F11 ( full map )
-
I'm making it for events, the events dimension is 336, that why I want so the blips only disappear at the dimension 336
-
Hide for everyone, that why I used getElementsByType("player")
-
I didn't create it, it's already created on the mini-map, that blip ID 0, I want to remove it from mini-map and back it with same command that's all
-
I'm still a beginner at scripting, so if there a way you can at least fix or give me a way to make that script, I really would appreciate that.
-
function rPBFTM(player) if ( isObjectInACLGroup ("user."..getAccountName(getPlayerAccount(player)), aclGetGroup ( "Admin" ) ) then for _,players in ipairs(getElementsByType("player")) do if ( getElementDimension (players) == 336 ) then for _,blip in ipairs (getElementsByType("blip")) do icon = getBlipIcon(blip) if ( icon == 0 ) then if ( getBlipVisibleDistance (blip) ~= 0) then outputChatBox("3", player, 255, 0, 255) setBlipVisibleDistance(blip, 0.1) else if (getBlipVisibleDistance(blip) == 0.1) then outputChatBox("4", player, 255, 255, 255) setBlipVisibleDistance(blip, 500) end end end end end end end end addCommandHandler("empb", rPBFTM) addEventHandler("onPlayerWasted", getRootElement(), function () for _,blip in ipairs (getElementsByType("blip")) do for _,players in ipairs(getElementsByType("player")) do if ( getElementDimension (players) == 336 ) then icon = getBlipIcon(blip) if ( icon == 0 ) then if ( getBlipVisibleDistance(blip) == 0 ) then setBlipVisibleDistance(blip, 500) end end end end end end ) addCommandHandler("emp", function (player) blip = getElementsByType("blip") d = getBlipVisibleDistance(blip) icon = getBlipIcon(blip) if ( icon == 0 ) then outputChatBox("visible distance is "..d,player, 255, 0, 255) end end) Hello, I need help in this script.. I wanted to remove players blip from the mini-map but it's not working.. Well not all of it, when I use ( /empb ) it remove the blip from the mini-map but when I reuse ( /empb ) it doesn't back the blip, I used ( /debugscript 3 ) but it just gaved me that " disableBlip.lua:57 bad argument #1 to ipairs (table expected, got boolean) ".. now for the "onPlayerWasted" working without any problems, but about (/emp) it didn't send a message, if someone can tell me what I did wrong, I'm using type="server" on meta.xml, and thanks.
-
Hey I want a code that allowed me to disable blips from the mini-map, I searched at https://wiki.multitheftauto.com but I couldn't find the way I want to remove a specific blip, I want at the dimension 2 that using a command I remove the players blips from mini-map. I appreciate that if someone can tell me the commands needed for I make that thing and thanks.
-
Is it possible that we enhance the weapon damage? What I mean change the weapon damage? If there is a way I appreciate who give an example or a clue.
-
I use it on Server Side
-
https://wiki.multitheftauto.com/ there you will find all function and starts they will explain each thing for what you use it. You can make it without a GUI panel, but as you like you can make it, go to this link and search for all function server side and client side there you will find your answers.
-
function WarpWithParachute(player, x, y, z) giveWeapon (player, 46) setElementPosition(player, x, y, z) end addCommandHandler("warp", WarpWithParachute) -- you can change x y z to the number which you want, but the only problem is you can't use Parachute when you get warped they don't let you open it.. I don't know how to fix that ¯\_(ツ)_/¯
-
function requestAdmin(playerName) outputChatBox("Your request for a staff member has been accepted. One of our staff members will be with you soon.",playerName, 225,255,255) local account = getAccountName ( getPlayerAccount ( playerName ) ) local Staff = isObjectInACLGroup ("user.".. account, aclGetGroup ("Admin")) if (Staff) then outputChatBox("You been requested by "..getPlayerName(playerName),playerName, 255, 255, 255) end end addCommandHandler("adminreq", requestAdmin) Here you go ~ i test it
-
function requestAdmin(playerName) exports.SANGcommands:sendMessage("Your request for a staff member has been accepted. One of our staff members will be with you soon", 225,255,255) local x, y, z = getElementPosition (playerName) local account = getAccountName ( getPlayerAccount ( playerName ) ) if isObjectInACLGroup ("user.".. account, aclGetGroup ("Admin", "SuperModerator", "Moderator")) and type == 0 then setElementPosition( playerName, x, y, z ) end end addCommandHandler("adminreq", requestAdmin) Try this it should warp the Staff to the player which used the command, idk if it will work didn't test it
-
function requestAdmin(playerName) exports.SANGcommands:sendMessage("Your request for a staff member has been accepted. One of our staff members will be with you soon", 225,255,255) local account = getAccountName ( getPlayerAccount ( playerName ) ) if isObjectInACLGroup ("user.".. account, aclGetGroup ("Admin", "SuperModerator", "Moderator")) and type == 0 then outputChatBox("You are required by ".. getPlayerFromName(playerName .. playerName) end end addCommandHandler("adminreq", requestAdmin) try this now or wait before use this one write in console": debugscript 3 it will show all errors
-
function requestAdmin() for _,playerName in ipairs ( getElementsByType("player") ) do exports.SANGcommands:sendMessage("Your request for a staff member has been accepted. One of our staff members will be with you soon", 225,255,255) local account = getPlayerAccount (playerName) if isObjectInACLGroup ("user." .. getAccountName(string(account)), aclGetGroup ("Admin", "SuperModerator", "Moderator")) and type == 0 then outputChatBox("You are required by ".. getPlayerFromName(playerName .. playerName) end end end addCommandHandler("adminreq", requestAdmin) - try this