User Guide Contributor
  • Content Count

  • Joined

  • Last visited

  • Days Won


AfuSensi last won the day on July 18 2019

AfuSensi had the most liked content!

Community Reputation

12 Decent

1 Follower

About AfuSensi

  • Rank
    User Guide Contributor
  • Birthday August 11


  • Gang
    Mr. Green Gaming
  • Location
    The Netherlands
  • Occupation
    Internet Gangster
  • Interests
    MTA, Programming, Music Production

Recent Profile Visitors

502 profile views
  1. Truth - MTA Wiki Discord Bot Since i was in need for a wiki discord bot on a discord server, I decided to make one. I have also created a dashboard to manage the bot's setting on your guild. This bot is open source so feel free to submit PR's or issues. There is a new wiki coming soon(?), so i am planning to convert this bot to use the new version once it releases if there's no official wiki bot available at that time. I hope this bot can be of use to you. Features Wiki article fetching like on MTA's official discord Wiki article searching Function/Event examples Customizable bot output set via dashboard (hide syntax, hide description etc) Links
  2. AfuSensi

    Help script

    Try this: function rewardTimer(player) local player = source or player setTimer ( rewardOnRun, 10000, 1,player ) givePlayerMoney ( player, 3000 ) end addEventHandler ( "onPlayerSpawn", getRootElement(), rewardTimer ) function rewardOnRun(player) givePlayerMoney ( player, 3000 ) setTimer ( rewardTimer, 10000, 1,player ) end You did not give any argument to the rewardOnRun() function. This would make it work, although i am not sure what you are trying to do with the code.
  3. AfuSensi

    req doublesided ... oubleSided
  4. AfuSensi

    Set delay

    (not tested) I used timers this time, but same can be applied with getTickCount() --------------------------- -- Repair vehicle --------------------------- local repairDelayTime = 30000 -- delay time in ms local repairTimer = false function repairVehicle() if isTimer(repairTimer) then local timeleft = math.ceil( getTimerDetails(repairTimer)/1000 ) -- Get seconds left from timer if timeleft then local secondString = " second" if timeleft > 1 then secondString = " seconds" end outputChatBox("Repair failed! Repair is possible again in "..tostring(timeleft)..secondString) return false end end local vehicle = getPedOccupiedVehicle(g_Me) if vehicle then server.fixVehicle(vehicle) repairDelayTime = setTimer(function() repairTimer = false end,repairDelayTime,1) end end addCommandHandler('repair', repairVehicle) addCommandHandler('rp', repairVehicle)
  5. Are you sure textFrom is returning the proper text? I tested this in runcode: crun outputChatBox( split("Dollars - USD"," - ")[1] ) outputChatBox( split("Dollars - USD"," - ")[2] ) And it works properly, so i really think it's textForm (guiComboBoxGetItemText) causing the issue.
  6. AfuSensi

    Set delay

    You can do it with getTickCount() Example: local repairDelay = 30000 -- 30 seconds delay (in ms) local delayTick = false function repairFunction() -- Check when the last repair was if getTickCount() - delayTick < repairDelay then return end -- If it's less then repairDelay ms ago then abort -- repair code --set tick when repair happened delayTick = getTickCount() end Not tested, but you get the point.
  7. local myMessage = exports.msg:message setTimer(myMessage,23000,1,"Let's try this way",source,255,255,0) That should work.
  8. I solved this by loading the image in html with mtalocal:// <img src="mtalocal://dancething.gif">
  9. I am unable to put any images in my local html via the browser. If i load the image directly ( via loadBrowserURL(browser,"image.gif") ) it works correctly, but if i load a html page containing an image, it does not show. HTML: <html> <body > a <img src="dancething.gif"> a </body> </html> If i load this, it does show the text, but not the images. This is in my meta: <meta> <info description="test" type="misc" version="1.0" /> <file src="dancething.gif"/> <script src="test_c.lua" type="client" /> <file src="html.html" /> </meta> This is what shows ingame: So my question is, is anyone able to show images in their local html ?
  10. Then the event will only trigger if it get's triggered by the resource(resourceRoot) or his children, instead of everything (root).
  11. AfuSensi

    [REL] Soundform

    Impressive! Very nice.
  12. I know them both already..... As i said, i need to check for starting resources in general, not a speciefied resource... Do you understand? Lemme make an example if a resource is starting then Not a specefied resource... because , i need to do an action, when every resource starts.... Thats why he showed you the event, they trigger when a resource is about to start / starting. I've put the code for both a server script and a client script, the only difference is the name of the event ("onResourceStart" and "onClientResourceStart") This is how it's done: -- SERVER variation function checkStartedRes(res) -- Code here outputChatBox("Started resource: " .. getResourceName(res)) end addEventHandler("onResourceStart",root,checkStartedRes) -- CLIENT variation function checkStartedRes(res) -- Code here outputChatBox("Started resource: " .. getResourceName(res)) end addEventHandler("onClientResourceStart",root,checkStartedRes) Use onResourcePreStart if you want it to trigger before a resource is starting.
  13. Why arent you checking if the sound already exists before creating a new sound? If you do not check if the sound element already exists, then it will just ignore the old sound so sound[vehicle] will only give the newly created sound. Maybe try this: local url = "" sound = {} function playTheSound(x, y, z, vehicle) if not isElement(vehicle) then outputChatBox("Vehicle does not exist") return false end -- Checks if vehicle exist, and returns if vehicle does not exist if isElement(sound[vehicle]) then outputChatBox("Sound is already playing") return false end -- Checks if sound exist, and returns if sound does exist local theSound = playSound3D(url, x, y, z) if theSound then sound[vehicle] = theSound attachElements(sound[vehicle], vehicle) else outputChatBox("Sound failed to play") return false end end addEvent("playTheSound", true) addEventHandler("playTheSound", getRootElement(), playTheSound) function stopTheSound(vehicle) stopSound(sound[vehicle]) end addEvent("stopTheSound", true) addEventHandler("stopTheSound", getRootElement(), stopTheSound)
  14. Do you see anything in the console (f8) when starting the resource? We need more info to be able to help. You can follow this to make yourself admin in your server: ... nistrators