AfuSensi

User Guide Contributor
  • Content Count

    46
  • Joined

  • Last visited

  • Days Won

    1

AfuSensi last won the day on July 18

AfuSensi had the most liked content!

Community Reputation

7 Neutral

About AfuSensi

  • Rank
    User Guide Contributor
  • Birthday August 11

Details

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

Recent Profile Visitors

353 profile views
  1. 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.
  2. AfuSensi

    req doublesided

    https://wiki.multitheftauto.com/wiki/Se ... oubleSided
  3. 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)
  4. 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.
  5. 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.
  6. local myMessage = exports.msg:message setTimer(myMessage,23000,1,"Let's try this way",source,255,255,0) That should work.
  7. I solved this by loading the image in html with mtalocal:// <img src="mtalocal://dancething.gif">
  8. 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 ?
  9. Then the event will only trigger if it get's triggered by the resource(resourceRoot) or his children, instead of everything (root). https://wiki.multitheftauto.com/wiki/AddEventHandler https://wiki.multitheftauto.com/wiki/Element_tree
  10. AfuSensi

    [REL] Soundform

    Impressive! Very nice.
  11. 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.
  12. 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 = "http://www.181.fm/winamp.pls?station=181-power&style=mp3&description=Power%20181%20(Top%2040)&file=181-power.pls" 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)
  13. 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: http://wiki.multitheftauto.com/wiki/Ser ... nistrators
  14. This is not a request forum, if you have problems you can post it here. I doubt anyone will help you if you are not willing to put in any effort. (referring to this topic too: viewtopic.php?f=91&t=88508 )