Jump to content

Aibo

Retired Staff
  • Posts

    1,105
  • Joined

  • Last visited

Everything posted by Aibo

  1. highly unlikely that your debug is empty function InJob1() local Job1 = createMarker( -1979.3596191406, 483.17581176758, 34.100391387939, 'cylinder',0.8, 0, 255, 0, getRootElement()) end "local" variables declared inside of a function don't exist outside of the function. so this: addEventHandler( "onMarkerHit", Job1 ,ShowJob1) should give you error. your Job2 marker is declared outside. you should do the same with Job1 marker variable.
  2. with POST, and MTA itself can recieve only JSON data to callback function as i recall. https://wiki.multitheftauto.com/wiki/CallRemote
  3. use takePlayerMoney(source, 500) or even takePlayerMoney(500) if it's client-side. and addEvent("StartJobCheckPoint", getRootElement(), JobCP)
  4. here: https://community.multitheftauto.com/index.php?p= ... ls&id=1299 :3
  5. haven't thought of that, thank you. looks like working like a charm :3
  6. currently i'm making a CCTV resource. basically, placing security cameras that can be viewed by admins and/or connected to "public" terminals access to which can be restricted by team/ACL/password. thing is, when player switches camera to position that is relatively far from the player, world around him is not "rendered", so he falls through the ground to the void. i've tried freezing the ped while camera is away, and as a result he dies on camera return/unfreeze. i've also tried to set back his position on camera return - somewhat helped, but he still can get damage/die on camera return. so i'm looking for a better way to keep the dude alive and well while his camera is far away from him. maybe i'm missing something, any suggestions?
  7. Aibo

    Mute function

    your function is triggered by timer, so "source" is not passed to it. so you need to pass it in arguments: function unmutep(player) setPlayerMuted(player, false) outputChatBox("You can talk again!", player) end ------------------- setTimer( unmutep, 30000, 1, player) -- player must be defined here and must be a player element you wish to unmute
  8. https://wiki.multitheftauto.com/wiki/ACL
  9. you know, there are already teams in MTA
  10. great, now learn about booleans in Lua and «isDM=isDM» is Captain Obvious style.
  11. Aibo

    Help?

    you didn't "wrote" this script, it was generated by my resource. and unless you've edited it (and it looks like you did), it should work fine. line 11(12): moveObject(omg6537,250,-294.5478515625,[color=#FF0000]1006,5712890625[/color],144.27891540527,0,0,0) 1006,5712890625 > 1006.5712890625 fix this.
  12. ok dude, you're way out of line here (like there are any other forums to post ), try to behave yourself the reason you markers wont work: "onMarkerHit" is server event. i didnt know whether this script is client or server side (hard to understand what you're saying), so i havent changed them to either side. i've put timers on resource start because in that mess of a code you got it wasnt obvious where you want them to start (and again, your "explanations" not helping much). and that is i've put a COMMENT in there to note how it will work. you don't want to learn, you dont even want to understand, you just want that someone scripted it for you. well that way eventually noone will bother to help you, not with that attitude. function startclient () outputChatBox ( "= = = = = = = = = =" , 255 , 255 , 0 , true ) outputChatBox ( " " , 0 , 0 , 0 , true ) outputChatBox ( "#ff0000Happy #0000f0New #00ff002011 #ff00ffYear" , 0 , 0 , 0 , true ) outputChatBox ( " ",0,0,0,true) outputChatBox ( "= = = = = = = = = =" , 255 , 255 , 0 , true ) setSkyGradient ( 50 , 255 , 255 , 65 , 100 , 25 ) setWaterColor ( 50 , 60 , 100 ) setTime ( 1 , 0 ) setWaveHeight ( 0.5 ) setBlurLevel ( 5 ) setWeather ( 99 ) Marker1 = createMarker ( 4182.88671875, -2876.1853027344, 1062.5003662109, "corona", 7, 0, 0, 255, 200) Marker2 = createMarker ( 4703.38525390, -2239.5251464844, 1609.0306396484, "corona", 10, 255, 55, 55, 200) addEventHandler("onClientMarkerHit", Marker1, warp) addEventHandler("onClientMarkerHit", Marker2, warp) end function warp(player) if player == getLocalPlayer() and isPedInVehicle(player) then if source == Marker1 then -- First Marker markerHitSound() local vehicle=getPedOccupiedVehicle(player) setElementPosition (vehicle , 4154.0571289063, -2392.6955566406, 1608.3810302734 ) setElementRotation (vehicle , 0,0,310.5) setVehicleFrozen ( vehicle , true ) setTimer( setVehicleFrozen, 300, 1, vehicle, false ) setWeather ( 99 ) setTime ( 00 , 0 ) setBlurLevel ( 0 ) elseif source == Marker2 then -- Second Marker setTimer(lights, 800, 0) setTimer(loll, 800, 0) setTimer(randomVehColors, 800, 0) markerHitSound() local vehicle=getPedOccupiedVehicle(player) setElementPosition (vehicle , 4169.7006835938, -2271.2592773438, 1111.0838623047 ) setElementRotation (vehicle , 0, 0, 0 ) setVehicleFrozen ( vehicle , true ) setTimer( setVehicleFrozen, 700, 1, vehicle, false ) setTime ( 00, 0 ) setBlurLevel (20 ) setGameSpeed ( 1.2 ) setWeather ( 99 ) end end end function randomVehColors() --LOOOOOL ... FINALLY I MADE THIS SCRIPT !!!! xDDDD for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,126) -- random from 0 to 126, because colors is from 0 to 126 color[2] = math.random(0,126) color[3] = math.random(0,126) color[4] = math.random(0,126) -- we take 4 random numbers because setVehicleColor have parameters with 4 colors setVehicleColor ( car, color[1], color[2], color[3], color[4] ) -- setting color to vehicle end end function loll() -- Mario World setSkyGradient(math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255)) setWaterColor(math.random (0,255), math.random (0,255), math.random (0,255)) end function lights() for i,v in pairs (getElementsByType ("vehicle")) do setVehicleHeadLightColor(v, math.random(0,255), math.random(0,255), math.random(0,255)) end end function markerHitSound() local sound = playSound("files/warp.mp3") -- Sound Isn't Working end addEventHandler("onClientResourceStart", resourceRoot, startclient)
  13. because you've lost your "end"s again, try at least use indents, right now it's a mess. you can't just take a part of the code and stick it anywhere expecting it to work. function startclient () outputChatBox ( "= = = = = = = = = =" , 255 , 255 , 0 , true ) outputChatBox ( " " , 0 , 0 , 0 , true ) outputChatBox ( "#ff0000Happy #0000f0New #00ff002011 #ff00ffYear" , 0 , 0 , 0 , true ) outputChatBox ( " ",0,0,0,true) outputChatBox ( "= = = = = = = = = =" , 255 , 255 , 0 , true ) setSkyGradient ( 50 , 255 , 255 , 65 , 100 , 25 ) setWaterColor ( 50 , 60 , 100 ) setTime ( 1 , 0 ) setWaveHeight ( 0.5 ) setBlurLevel ( 5 ) setWeather ( 99 ) Marker1 = createMarker ( 4182.88671875, -2876.1853027344, 1062.5003662109, "corona", 7, 0, 0, 255, 200) Marker2 = createMarker ( 4703.38525390, -2239.5251464844, 1609.0306396484, "corona", 10, 255, 55, 55, 200) addEventHandler("onMarkerHit", Marker1, warp) addEventHandler("onMarkerHit", Marker2, warp) setTimer(lights, 800, 0) -- this way your timers will start at resource start setTimer(loll, 800, 0) setTimer(randomVehColors, 800, 0) end function warp(player) if isPedInVehicle(player) then if source == Marker1 then -- First Marker markerHitSound() local vehicle=getPedOccupiedVehicle(player) setElementPosition (vehicle , 4154.0571289063, -2392.6955566406, 1608.3810302734 ) setElementRotation (vehicle , 0,0,310.5) setVehicleFrozen ( vehicle , true ) setTimer( setVehicleFrozen, 300, 1, vehicle, false ) setWeather ( 99 ) setTime ( 00 , 0 ) setBlurLevel ( 0 ) elseif source == Marker2 then -- Second Marker markerHitSound() local vehicle=getPedOccupiedVehicle(player) setElementPosition (vehicle , 4169.7006835938, -2271.2592773438, 1111.0838623047 ) setElementRotation (vehicle , 0, 0, 0 ) setVehicleFrozen ( vehicle , true ) setTimer( setVehicleFrozen, 700, 1, vehicle, false ) setTime ( 00, 0 ) setBlurLevel (20 ) setGameSpeed ( 1.2 ) setWeather ( 99 ) end end end function randomVehColors() --LOOOOOL ... FINALLY I MADE THIS SCRIPT !!!! xDDDD for i, car in ipairs( getElementsByType( "vehicle" ) ) do local color = {} color[1] = math.random(0,126) -- random from 0 to 126, because colors is from 0 to 126 color[2] = math.random(0,126) color[3] = math.random(0,126) color[4] = math.random(0,126) -- we take 4 random numbers because setVehicleColor have parameters with 4 colors setVehicleColor ( car, color[1], color[2], color[3], color[4] ) -- setting color to vehicle end end function loll() -- Mario World setSkyGradient(math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255), math.random (0,255)) setWaterColor(math.random (0,255), math.random (0,255), math.random (0,255)) end function lights() for i,v in pairs (getElementsByType ("vehicle")) do setVehicleHeadLightColor(v, math.random(0,255), math.random(0,255), math.random(0,255)) end end function markerHitSound() local sound = playSound("files/warp.mp3") -- Sound Isn't Working end addEventHandler( "onClientResourceStart", resourceRoot, startclient)
  14. Aibo

    setRadioChannel

    1. getLocalPlayer() is client function 2. setRadioChannel() is client function 3. there is no "onColShapHit" event, correct event is "onColShapeHit" and it is server-side. client event is "onClientColShapeHit".
  15. because race_starter_pack is poorly made.
  16. i second that request. have the same issue in my "omg" resource (need to correctly attach an object to main object if main is rotated by any axis, currently only Z rotation is fine). it's not that i have no idea how to do this, in fact i do. but all these matrix calculations, euler angles and other math stuff are making my brain hurt. and i'm not even a programmer, im a designer. :3
  17. Aibo

    Need HELP!

    like this? -- Settings variables local textFont = "default-bold" -- The font of the tag text local textScale = 1 -- The scale of the tag text local heightPadding = 1 -- The amount of pixels the tag should be extended on either side of the vertical axis local widthPadding = 1 -- The amount of pixels the tag should be extended on either side of the horizontal axis local xOffset = 8 -- Distance between the player blip and the tag local minAlpha = 10 -- If blip alpha falls below this, the tag won't the shown local textAlpha = 255 local rectangleColor = tocolor(0,0,0,230) -- Other variables local floor = math.floor local w,h = guiGetScreenSize() local function drawMapStuff() if isPlayerMapVisible() then local sx,sy,ex,ey = getPlayerMapBoundingBox() -- Map positions local mw,mh = ex-sx,sy-ey -- Map width/height local cx,cy = (sx+ex)/2,(sy+ey)/2 -- Center position of the map local ppuX,ppuY = mw/6000,mh/6000 -- Pixels per unit local fontHeight = dxGetFontHeight(textScale,textFont) -- Height of the specified font local yOffset = fontHeight/2 -- How much pixels the tag should be offsetted at local blips = getElementsByType("blip") for k,v in ipairs(blips) do local attached=getElementAttachedTo(v) if isElement(attached) and getElementType(attached)=="player" then local px,py = getElementPosition(attached) -- Player's position local x = floor(cx+px*ppuX+xOffset) -- X for the nametag local y = floor(cy+py*ppuY-yOffset) -- Y for the nametag local pname = getPlayerName(attached) -- Player name local nameLength = dxGetTextWidth(pname,textScale,textFont) -- Width of the playername local r,g,b = getPlayerNametagColor(attached) -- Player's nametag color local _,_,_,a = getBlipColor(v) -- Blip alpha local team = getPlayerTeam(attached) -- Player's team if a>minAlpha and getTeamName(team) ~= "Police" then dxDrawRectangle(x-widthPadding,y+heightPadding,nameLength+widthPadding*2,fontHeight-heightPadding*2,rectangleColor,false) dxDrawText(pname,x,y,x+nameLength,y+fontHeight,tocolor(r,g,b,textAlpha),textScale,textFont,"left","top",false,false,false) end end end end end addEventHandler("onClientRender",getRootElement(),drawMapStuff)
  18. is playerName passed to the handler? is playerName really a player NAME? why dont you use source (i bet the source of the event is player)? p.s.: that is one crazy velocity setting.
  19. Aibo

    Help ?!

    that is because cause you've used volk-rus "fix" solution. and i'm not here to help people who won't listen and don't want to even try and uderstand the problems they have. actually you should read the wiki yourself first, before posting here nonsense like this: addEventHandler( "onMarkerHit", Marker1)
  20. this is just wrong in so many ways i don't even know where to start.
  21. https://wiki.multitheftauto.com/wiki/GetAccountData getAccountData/setAccountData requires player account, not player element, try using getAccountData(getPlayerAccount(source), "points") P.S.: just noticed you got the account in pA variable, why not use it in getAccountData? and onPlayerLogin event also sends account to the function
  22. https://wiki.multitheftauto.com/wiki/PlaySound
  23. function player_Wasted ( ammo, attacker, weapon, bodypart ) local k = getElementData (source, "kills") --40 local p = getElementData (source, "points") local yes = k + p and local k = getElementData (source, "kills") local p = getElementData (source, "points") local playerstats = k + p i can't see where are you setting element data for "kills", except the manual command in the end. so, probably, getElementData (source, "kills") returns false.
×
×
  • Create New...