Jump to content

roaddog

Members
  • Posts

    346
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by roaddog

  1. roaddog

    outputting

    Still the same. this has been fixed. outputChatBox("gasstations's blips have been removed, type /station !", thePlayer , 255, 100, 0, true) end but this one still giving many messages outputChatBox("Streaming for gasstations, press F11!", thePlayer, 255, 100, 0, true) could you explain what was the problem?
  2. roaddog

    outputting

    Hello guys, I had no idea, why if I the function executed, I got many messages show up in a row, Then what would i do to make it 1 message only. I need an information about it, because I got 2 scripts which have same issue. I hope you guys understand what Im trying to do. function callPetrolBlips (thePlayer) if getElementType(thePlayer) == "player" and (thePlayer) then gasStationsBlip[name] = createBlip(x,y,z,48,0,0,0,0,0,0,450); setTimer (destroyPetrolBlips, 60000, 1 ) outputChatBox("Streaming for gasstations, press F11!", thePlayer, 255, 100, 0, true) end end addCommandHandler("station", callPetrolBlips) function destroyPetrolBlips (thePlayer ) blips = getElementsByType("blip") for i, v in ipairs (blips) do blipIcon = getBlipIcon ( v ) if (blipIcon == 48) then destroyElement(v) outputChatBox("gasstations's blips have been removed, type /station !", thePlayer , 255, 100, 0, true, 5) end end end addCommandHandler("ok", destroyPetrolBlips) Thank you.
  3. Sorry for double posting, but I gotta report these Skin Modifications https://community.multitheftauto.com/index.php?p= ... ls&id=9773 Vehicle modifications https://community.multitheftauto.com/index.php?p= ... ls&id=9775 https://community.multitheftauto.com/in ... ls&id=9776 DONE
  4. Weapon mod https://community.multitheftauto.com/index.php?p= ... ls&id=9768 None description https://community.multitheftauto.com/index.php?p= ... ls&id=9766 DONE
  5. roaddog

    Forever vs Iraq

    Cool video, keep it up!
  6. Skin mods https://community.multitheftauto.com/in ... ls&id=9737 https://community.multitheftauto.com/in ... ls&id=9736 https://community.multitheftauto.com/in ... ls&id=9735 DONE
  7. Oh, yeah omg thank you for explaining.
  8. Alright then. I removed those line and add this function showGang() for i,player in ipairs(getElementsByType"player") do isRendering = true end end addEventHandler("onClientResourceStart", getResourceRootElement(getThisResource()), showGang) then how to show only for others?
  9. I guess its gonna hide dxDraw if they are local player
  10. They can see their own text above. why doesnt that work?
  11. Hey guys I need help, I made this script which gonna draw gang above head, Idk if it works or not, so this isRendering = false addEventHandler( "onClientRender",root, function( ) if isRendering then local px, py, pz, tx, ty, tz, dist px, py, pz = getCameraMatrix( ) for _, v in ipairs( getElementsByType 'player' ) do tx, ty, tz = getElementPosition( v ) dist = math.sqrt( ( px - tx ) ^ 2 + ( py - ty ) ^ 2 + ( pz - tz ) ^ 2 ) if dist < 30.0 then if isLineOfSightClear( px, py, pz, tx, ty, tz, true, false, false, true, false, false, false,localPlayer ) then local sx, sy, sz = getPedBonePosition( v, 5 ) local x,y = getScreenFromWorldPosition( sx, sy, sz + 0.3 ) local lmao = getElementData(localPlayer, "Group") if x then -- getScreenFromWorldPosition returns false if the point isn't on screen dxDrawText( tostring(lmao), x-25, y-70, x, y, tocolor(0, 150, 0), 0.85 + ( 15 - dist ) * 0.02, "bankgothic","center", "center" ) end end end end end end ) for i, d in ipairs ( getElementsByType 'player' ) do if d ~= localPlayer then isRendering = false else isRendering = true end end Well is this gonna work? I mean localPlayer wont see his render, and only others can see it.
  12. roaddog

    Question :D

    Alright, Thank you guys
  13. roaddog

    Question :D

    Hello, how to remove decimals from the result? x, y, z = getElementPosition(localPlayer) wang = getDistanceBetweenPoints3D(x,y,z, -2017, 302, 34) my math sucks D: Thank you
  14. Thanks for replying. I resolved it.
  15. Hey guys, I got an issue with this function. in this case InterpolateBetween only execute when first time it renders, and after that I didnt see it animated. I mean first time it renders, InterpolateBetween works but second, and so on, It doesnt Anyone can help me out? Thank you function whenTelp() fadeCamera(false) showChat(false) addEventHandler("onClientRender", root, busmove) setElementFrozen(localPlayer, true) setTimer(function() fadeCamera(true) setElementFrozen(localPlayer, false) showChat(true) removeEventHandler("onClientRender", root, busmove) end, 12000, 1) end function busmove() progress = progress + step -- Increasing the progress each frame if progress > 1 then -- Progress can't be more than 1 so let's limit it progress = 1000 end py = interpolateBetween(-500,sy/2-ssy/2,0,sy/2-(470/ry)*sy/2,0,0,progress,"OutElastic") dxDrawImage((268/rx)*sx, py, (183/rx)*sx, (180/ry)*sy, "bus.png", 0, 0, 0, tocolor(254, 254, 254, 255), true) end
  16. Alright guys. I need a little help about this argument, so whenever it renders, warnings apppear y1 and y2 are nill function clicked () if source == rulesb then guiSetText (helpmemo, rules) y1 =(158/ry)*sy y2 = (189/ry)*sy elseif source == Infob then y1 = (199/ry)*sy y2 = (230/ry)*sy guiSetText (helpmemo, commands) elseif source == rosterb then y1 = (240/ry)*sy y2 = (271/ry)*sy guiSetText (helpmemo, info) elseif source == commandb then y1 = (281/ry)*sy y2 = (312/ry)*sy guiSetText (helpmemo, admins) end end addEventHandler("onClientGUIClick", root, clicked) function fill () if (isOpen) then dxDrawRectangle((211/rx)*sx, (158/ry)*sy, (157/rx)*sx, (31/ry)*sy, tocolor(107, 87, 171, 185), true) dxDrawLine((367/rx)*sx, y1, (367/rx)*sx, y2, tocolor(255, 255, 255, 255), 2, true) end addEventHandler("onClientRender", root, fill) how do I solve it?
  17. Hai I got a lil problem with this custom wanted level. error says attempt to compare number with nil function handleVehicleDamage(attacker, weapon, loss, x, y, z, tyre) -- Protect law and staff from getting wanted local hasWantedPlayersInside = false local occupants = getVehicleOccupants( source ) local vx,vy,vz = getElementPosition( source ) local px,py,pz = getElementPosition( localPlayer ) local dist = getDistanceBetweenPoints3D( vx,vy,vz, px,py,pz ) if occupants then for seat, occupant in pairs(occupants) do if getElementType(occupant) == "player" then if tonumber(getElementData(occupant,"Wanted")) > 0 then ----- this line gives error hasWantedPlayersInside = true end end end end
  18. roaddog

    dxRectangle

    So I did like this local time_lol_lol = tonumber(getElementData(localPlayer, "runrun")) dxDrawRectangle((530/resx)*sx, (590/resy)*sy, time_lol_lol, (31/resy)*sy, tocolor(254, 254, 254, 171), false) Well i use custom timer so, I need help with how the rectangle always fills the full bar. ty
  19. roaddog

    dxRectangle

    Good morning, Well, I need help, how to make rectangle decrease/increase. I made this, but it doesnt decrease or increase function show_time_left( ) if getElementData( localPlayer, "isInTurf" ) and not getElementData( localPlayer, "isInFriendlyTurf" ) then local timeMsg = getElementData( localPlayer, "captureTime" ) local time_to_capture = getElementData(localPlayer, "timeruns") local sx, sy = guiGetScreenSize( ) local resx, resy = 1280, 720 if timeMsg and timeMsg ~= "none" then dxDrawText ( timeMsg, (376/resx)*sx, (594/resy)*sy, (1014/resx)*sx, (646/resy)*sy, tocolor( 200, 200, 200, 255 ), (0.8/1366)*sx, (0.8/768)*sy, "bankgothic" ) dxDrawImage((988/resx)*sx, (275/resy)*sy, (275/resx)*sx, (51/resy)*sy, "background.png", 0, 0, 0, tocolor(0, 0, 0, 255), true) dxDrawRectangle((1014/resx)*sx, (285/resy)*sy, (time_to_capture-(51/resy)*sy), (31/resy)*sy, tocolor(254, 254, 254, 171), false) dxDrawText("Capture Time", (1070/resx)*sx, (285/resy)*sy, (1178/resx)*sx, (314/resy)*sy, tocolor(237, 0, 0, 178), (1/1366)*sx, (1/768)*sy, "bankgothic", "center", "center", false, false, true, false, false) end end end addEventHandler( "onClientRender", root, show_time_left )
  20. roaddog

    I need Help

    Okay, I understand now, Thanks for helping. I have fixed that.
  21. roaddog

    I need Help

    I need help with this save system, It doesn't want to work. I get headache because of this, I have tried alot things to fix but you know my capability is not good enough. thus this save system doesnt save em. I need help function loginHandler(thePlayer, username, password) if (username ~= "" and username ~= nil and password ~= "" and password ~= nil) then local account = getAccount(username) if (account) then local daRealAccount = getAccount(username, password) if (daRealAccount) then local x = getAccountData(daRealAccount, "x.position12") local y = getAccountData(daRealAccount, "y.position12") local z = getAccountData(daRealAccount, "z.position12") local playerWanted = getAccountData (daRealAccount, "wantedlevel") local armor = getAccountData(daRealAccount, "armor") local model = getAccountData(daRealAccount, "model") local interior = getAccountData(daRealAccount, "interior") local dimension = getAccountData(daRealAccount, "dimension") local rx = getAccountData(daRealAccount, "rotx") local ry = getAccountData(daRealAccount, "roty") local rz = getAccountData(daRealAccount, "rotz") local team = getTeamFromName("Unemployed") local money = getAccountData(daRealAccount, "Money") local health = getAccountData(daRealAccount, "health") local playerWeapons = getAccountData(daRealAccount, "weapons") if (x) and (y) and (z) then triggerClientEvent(thePlayer,"savexml",thePlayer,username,password) logIn(thePlayer, daRealAccount, password) triggerClientEvent(thePlayer,"hideWindow",thePlayer) fadeCamera(thePlayer, false, 2.0) setElementData(thePlayer, "basicrp.slider", 1) setElementData(thePlayer, "player.loggedin", 1) setTimer(function() if (playerWeapons and playerWeapons ~= "") then giveWeaponsFromJSON(thePlayer, playerWeapons) end spawnPlayer(thePlayer, tonumber(x), tonumber(y), tonumber(z)) setElementHealth ( thePlayer, tonumber(health)) --------------------------------- line 184 setPedArmor(thePlayer, tonumber(armor)) setPlayerWantedLevel(thePlayer, playerWanted) setElementInterior(thePlayer, tonumber(interior)) setElementDimension(thePlayer,tonumber(dimension)) setElementRotation(thePlayer, tonumber(rx), tonumber(ry), tonumber(rz)) setCameraTarget(thePlayer, thePlayer) showChat(thePlayer, true) setPedHeadless(thePlayer, false) setPlayerMoney(thePlayer, tonumber(money)) setElementModel(thePlayer, tonumber(model)) for i = 0,17 do local accd = getAccountData( daRealAccount, 'player.clothes.'..i ) if not accd:find 'false' then addPedClothes( thePlayer,accd:sub( 1,accd:find( ',' ) - 1 ),accd:sub( accd:find( ',' ) + 1,accd:len( ) ),i ) end end end, 2000, 1) setTimer(fadeCamera, 3000,1, thePlayer, true, 2.0) end end end end end function saveAccount(player) local account = getPlayerAccount(player) if isGuestAccount(account) then return end local money = getPlayerMoney(player) local health = tonumber(getElementHealth(player)) local armor = tonumber(getPedArmor(player)) local x, y, z = getElementPosition(player) local interior = tonumber(getElementInterior(player)) local dimension = tonumber(getElementDimension(player)) local model = tonumber(getElementModel(player)) local rx, ry, rz = getElementRotation(player) for i = 0,17 do local arg1,arg2 = getPedClothes( player, i ) setAccountData( account, "player.clothes."..tostring( i ),tostring( arg1 )..","..tostring( arg2 ) ) end setAccountData(account, "Money", money) setAccountData (account, "wantedlevel", getPlayerWantedLevel (player)) local weapons = convertWeaponsToJSON(player) setAccountData(account, "weapons", weapons) setAccountData(account, "health", health) setAccountData(account, "armor", armor) setAccountData(account, "model", model) setAccountData(account, "interior", interior) setAccountData(account, "dimension", dimension) setAccountData(account, "x.position12", tonumber(x)) setAccountData(account, "y.position12", tonumber(y)) setAccountData(account, "z.position12", tonumber(z)) setAccountData(account, "rotx", tonumber(rx)) setAccountData(account, "roty", tonumber(ry)) setAccountData(account, "rotz", tonumber(rz)) end ----------------saving them--------------------- addEventHandler("onPlayerQuit", cRoot, function() saveAccount(getPlayerAccount ( source )) end ) addEventHandler("onResourceStop", cThisRoot, function() for i,v in ipairs(getElementsByType("player")) do saveAccount(getPlayerAccount (v)) end end ) -----------------save weapons ------------------------------- function convertWeaponsToJSON(player) local weaponSlots = 12 local weaponsTable = {} for slot=1, weaponSlots do local weapon = getPedWeapon(player, slot ) local ammo = getPedTotalAmmo(player, slot ) if (weapon > 0 and ammo > 0) then weaponsTable[weapon] = ammo end end return toJSON(weaponsTable) end function giveWeaponsFromJSON(player, weapons) if (weapons and weapons ~= "") then for weapon, ammo in pairs(fromJSON(weapons)) do if (weapon and ammo) then giveWeapon(player, tonumber(weapon), tonumber(ammo)) end end end end -----------------saving wantedlevel on die------------------- addEventHandler ( "onPlayerWasted", root, function ( ) local account = getPlayerAccount(source) setAccountData ( account,"save-wanted",getPlayerWantedLevel ( source ) ) end ) addEventHandler ( "onPlayerSpawn", root, function () local account = getPlayerAccount ( source ) local playerWanted = getAccountData (account, "save-wanted") setPlayerWantedLevel ( source,playerWanted ) end ) Warnings [2014-07-06 05:45:46] WARNING: login\server.lua:184: Bad argument @ 'setElementHealth' [Expected number at argument 2, got nil] [2014-07-06 05:45:46] WARNING: login\server.lua:185: Bad argument @ 'setPedArmor' [2014-07-06 05:45:46] WARNING: login\server.lua:187: Bad argument @ 'setElementInterior' [Expected number at argument 2, got nil] [2014-07-06 05:45:46] WARNING: login\server.lua:188: Bad argument @ 'setElementDimension' [Expected number at argument 2, got nil] [2014-07-06 05:45:46] WARNING: login\server.lua:189: Bad argument @ 'setElementRotation' [Expected number at argument 2, got nil] [2014-07-06 05:45:46] WARNING: login\server.lua:194: Bad argument @ 'setElementModel' [Expected number at argument 2, got nil] I marked the folowing line in the code, Thank you very much
  22. Vehicle modification https://community.multitheftauto.com/in ... ls&id=9545 DONE
  23. roaddog

    help-bindKey

    Oh nvm i got to do this, the element was a house not a player local owner = getElementData( mrk, 'HS_INFO' )[7]; Fixed Thank you
×
×
  • Create New...