Jump to content

MIKI785

Members
  • Posts

    1,131
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by MIKI785

  1. It's some script doing that. Try stopping some resource, reconnect and see if it's still there, if so stop another resource, reconnect again and repeat until the message doesn't appear anymore. Then you know which resource is responsible.
  2. You're using onPlayerWasted, I'm not sure if you can set an animation to a dead player/ped. Use onPlayerDamage instead.
  3. It's simple: executeBrowserJavascript(theBrowser, "chat();") keep in mind that the browser has to be local.
  4. MIKI785

    Shoutall problem

    You're mixing client and server side functions... you have to use triggerClientEvent in this case.
  5. If there are errors in the script occurring every frame then that can decrease the FPS.
  6. Are you asking how to dump the whole file in one go? Just use fileGetSize like so: buffer = fileRead(hFile, fileGetSize(hFile))
  7. Yeah, simply loop through it and use getElementType. Or you could set the parent of all the attached elements to the vehicle using setElementParent and then simply use getElementsByType utilising the second argument.
  8. MIKI785

    Hi!

    That's because Marker is nil when addEventHandler is called. Simply remove the onClientResourceStart, I don't think there is any need for it in this case. Marker = createMarker(1788.9731445313, -1123.0570068359, 23.5, "cylinder", 1, 255, 0, 0, 5) setElementCollisionsEnabled(Marker, false) bl = createBlipAttachedTo(Marker, 45) addEventHandler("onMarkerHit", Marker, function(player) -- Attach the event handler to the marker so it detects when a player enters it. if (player) and (getElementType(player) == "player") then -- If the element who entered the marker was a player. setPedAnimation(player, "ROB_BANK", "CAT_SAFE_OPEN", 4000, false, false, false, false) -- Play an animation in the ROB_BANK category for 4000ms. end end) addEventHandler("onMarkerLeave", Marker, function(player) if (source ~= Marker) then return end if (isPedInVehicle(player)) then return end destroyElement(Marker) destroyElement(bl) randomMoney = math.random(22000, 22000) randomWanted = math.random (5, 5) givePlayerMoney(player, randomMoney) setPlayerWantedLevel(player, randomWanted) robPlayer = getPlayerName(player) setTimer(createRob, 600000, 1) end)
  9. One word: Shader. You're talking about objects but then you mention a weapon, so which one is it? Because afaik weapons are not elements, so you can't limit engineApplyShaderToWorldTexture to a single weapon.
  10. You're missing an end to close the function. engedelyezettserial = { [""]=true, -- NoOne [""]=true, -- Mili ["9BC41DB2DB129348886FB6A5603433F2"]=true, -- Jani } g_Me = getLocalPlayer( ); g_Root = getRootElement( ); g_ResRoot = getResourceRootElement( ); addEventHandler( "onClientResourceStart", g_ResRoot, function( ) if engedelyezettserial[getPlayerSerial(thePlayer)] then bindKey( "vehicle_fire", "both", toggleNOS ); bindKey( "vehicle_secondary_fire", "both", toggleNOS ); end --end of If end --end of Function ) function toggleNOS( key, state ) local veh = getPedOccupiedVehicle( g_Me ); if engedelyezettserial[getPlayerSerial(thePlayer)] then if veh and not isEditingPosition then if state == "up" then removeVehicleUpgrade( veh, 1010 ); setControlState( "vehicle_fire", false ); else addVehicleUpgrade( veh, 1010 ); end end end Btw. getPlayerSerial is deprecated on the client side, see the wiki.
  11. Unless you set the postGUI argument in dxDrawImage to true then the GUI should be on top of the image at all times.
  12. I don't see any issues there. As long as the 'zombies' event gets triggered then the other two should get handled as well. Did you get anything in the debug?
  13. What do you mean by 'set font of an image'?
  14. You can't use engineImportTXD as this function takes a model ID as an argument and paintjobs are not models. You have to use a shader to replace paintjob textures.
  15. Use isLineOfSightClear; first set of coordinates would be the vehicle and the second would be z+100 as in your code. You may also have to disable vehicle check.
  16. You're missing the mysql module. See here: https://wiki.multitheftauto.com/wiki/Modules/MTA-MySQL.
  17. Just so that you understand why it doesn't work: getBlipIcon() == (32 or 35) let's say that results in: 8 == (32 or 35) in this case it's obviously false.. but look at this: 35 == (32 or 35) that is also false. The reason is that this: (32 or 35) always results in 32, because 32 is a number -> it's not a falsey value. The code never even checks what's after the or because it doesn't have to as the condition was already satisfied. That means that the brackets will always result in 32, and 35 == 32 is obviously false.
  18. Depends on where you put it, post rest of the code.
  19. MIKI785

    "got vehicle"

    This or you can make the vehicle move on its own using setElementVelocity.
  20. MIKI785

    Help please

    You don't *have* to, but it will keep growing if you don't. But don't clear the whole blockList, only the player's table. So, addEventHandler("onPlayerQuit", function () blockList[source] = nil end) should do the job.
  21. MIKI785

    error 5 : access denied

    Well, it says 'Access denied' so did you try running it as an Administrator? That's the only thing I can think of besides a reinstall.
  22. MIKI785

    Help please

    Really nice subject.. very informative of the content... Aaaaaaanyway, I'm not really sure what Dimos7 was trying to do but I'd do something similar to this: local mycrpmpartner = {} --what's this for?? local blockList = {} --simple table for out block list function thePM(thePlayer,commandName,sendToName,...) local pmWords = { ... } local pmMessage = table.concat( pmWords, " " ) if sendToName then if getPlayerFromNamePart2(sendToName) then local toPlayer = getPlayerFromNamePart2(sendToName) if not (toPlayer == thePlayer) then --that () needed if not (pmMessage == "") then if blockList[toPlayer] and blockList[toPlayer][thePlayer] then --the table is present for the recipient AND the recipient has us blocked. outputChatBox("Blocked", thePlayer) return false --bye bye end outputChatBox("#757575[PM] Message to #ff00ff" .. getPlayerName(toPlayer) .. ":#ffffff " .. pmMessage, thePlayer, 255, 255, 255, true) outputChatBox("#FF0000[PM] Message from #ffFFff" .. getPlayerName(thePlayer) .. ":#ffff00 " .. pmMessage, toPlayer, 255, 255, 255, true) --These colour codes at the start are attritious btw. mycrpmpartner[thePlayer]=toPlayer mycrpmpartner[toPlayer]=thePlayer else outputChatBox("#FF0000[PM]Use:#ff9900 /pm [part of name] [message]", thePlayer, 255, 255, 255, true) end else outputChatBox("#FF000[PM] You cannot PM yourself #ff9900!", thePlayer, 255, 255, 255, true) end else outputChatBox("#FF0000[PM] Player not found! #FFFF00[#ff9900"..sendToName.."#FFFF00]", thePlayer, 255, 255, 255, true) end else outputChatBox("#FF0000[PM]Use:#ff9900 /pm [part of name] [message]", thePlayer, 255, 255, 255, true) end end addCommandHandler("pm", thePM) function getPlayerFromNamePart2 ( name ) if ( name ) then for _, player in ipairs ( getElementsByType ( "player" ) ) do local name_ = getPlayerName ( player ):gsub ( "#%x%x%x%x%x%x", "" ):lower ( ) if name_:find ( tostring ( name ):lower ( ), 1, true ) then return player end end end end addCommandHandler("blockpm", function (player, cmd, playerToBlock) if not blockList[player] then blockList[player] = {} --create a table for our player if there isn't one yet end playerToBlock = getPlayerFromNamePart2(playerToBlock) if not playerToBlock then return end blockList[player][playerToBlock] = not blockList[player][playerToBlock] --shouldn't complain about it being nil outputChatBox(getPlayerName(playerToBlock) .. " " .. (blockList[player][playerToBlock] == true and "" or "un") .. "blocked", player) end) I'm not guaranteeing that it will work, it's only a quick write-up but you should get the idea. Keep in mind that the blockList table isn't being cleared in any way, so it will keep growing unless you take care of that (eg. onPlayerQuit).
×
×
  • Create New...