Jump to content

Newbie

Members
  • Posts

    208
  • Joined

  • Last visited

Everything posted by Newbie

  1. Newbie

    GUI Label

    maybe, can you show an example ?
  2. Newbie

    GUI Label

    I need to set data in label somehow, i need an example or explaination how to do it, heres how i get data: local playerdeaths = getAccountData ( playeraccount, "deaths" ) and label: GUIEditor.label[1] = guiCreateLabel(sizeX/2, sizeY/2, 263, 292, "Wins:\n\nDeaths:\n\nCash:\n\nHunters:\n\nTime:\n\n", false)
  3. Newbie

    GUI Questions

    Thanks guys, made what i needed
  4. Newbie

    GUI Questions

    Uhm.. 1, fades in totaly black is there any way to fade that wont be black, like apha: 0.2
  5. Newbie

    GUI Questions

    1. Is it possible to make a image at whole screen at all resolutions ? Or, is there any way to make a screen blacker like if i press F7 and screen gets a bit darker and after i press again it goes back to normal ? 2. How to centerize gui label ? Thanks.
  6. if someone dont get what im trying to do: I made a GUI when player clicks buy car it spawns vehicle near him and i want to set owner (buyer) for it, so nobody other wont be able to drive it
  7. As you see when i buy a car i should be a owner so nobody can drive car. But when i test it with other acc's it fails. Looks like that script does't work as it should No errors At DS3 function BuyTractor () local money = getPlayerMoney(source) if (money > 5000) then takePlayerMoney(source,5000) local vehicleModel = 411 local x,y,z = getElementPosition(source) y = y + 5 local veh = createVehicle(tonumber(vehicleModel),x,y,z) setElementData(veh, "owner", source) else outputChatBox ( "* Earn more OP (Oil Points) to buy this vehicle", source, 255, 255, 255, true ) end end addEvent("Car1",true) addEventHandler( "Car1", getRootElement(), BuyTractor ) function enterVehicle ( player, seat, jacked ) --when a player enters a vehicle if ( getElementData(source, "owner") and player ~= getElementData(source, "owner") ) then cancelEvent() outputChatBox ( "You don't have the keys for this vehicle", player ) end end addEventHandler ( "onVehicleStartEnter", getRootElement(), enterVehicle )
  8. Newbie

    anti forward

    so nobody will help when i need so so.. to finish it ?
  9. Newbie

    anti forward

    i got bad argument
  10. Newbie

    anti forward

    Made it! function blowNoobs ( thePlayer ) local theVehicle = getPedOccupiedVehicle ( thePlayer ) id = getVehicleID ( theVehicle ) if id == 411 then blowVehicle ( theVehicle ) outputChatBox ( "You're noob..", getRootElement(), 255, 0, 0, true ) else outputChatBox ( "Test", getRootElement(), 255, 0, 0, true ) end end addCommandHandler ( "nx", blowNoobs ) But now i need to make it at a bind not as command, could any one help ? I got bad argument while testing with bind key
  11. Newbie

    anti forward

    function blowNoobs ( thePlayer ) local theVehicle = getPedOccupiedVehicle ( thePlayer ) id = getVehicleID ( theVehicle ) if id == 411 then blowVehicle ( source ) outputChatBox ( "You're noob..", getRootElement(), 255, 0, 0, true ) end end bindKey ( "W", blowNoobs ) Hmmm ?
  12. Newbie

    anti forward

    Hello. I am trying to do anti forward script for infernus. If player goes forward in this case he press "W" car blows. function blowNoobs ( thePlayer ) id = getVehicleID ( theVehicle ) if id == 411 then blowVehicle ( source ) outputChatBox ( "You're noob..", getRootElement(), 255, 0, 0, true ) end end bindKey ( "W", blowNoobs ) bad argument bind key
  13. Newbie

    Bugs

    Oh my good. Yes i did. /debugscript 3 ..
  14. Newbie

    Bugs

    no errors
  15. Newbie

    Bugs

    addEvent("onMapStarting", true) addEventHandler("onMapStarting", getRootElement(), function() for i,v in ipairs(getElementsByType('player')) do setElementData(v, "Hunter", false) end end) function someoneReachedHunter(number, sort, model) for index, account in ipairs ( getAccounts ( ) ) do if getAccountPlayer ( account ) then if (model == 425) then if (getElementData(source, "Hunter") == false ) then outputChatBox ( "#000000* #ffffff " ..getPlayerName(source).." Got hunter! $#11dd111000", getRootElement(), 255, 255, 255, true ) setAccountData( account,"Hunters",tonumber( getAccountData( account,"Hunters" ) or 0 )+1 ) setAccountData( account,"Cash",tonumber( getAccountData( account,"Cash" ) or 0 )+1000 ) setAccountData( account,"EXP",tonumber( getAccountData( account,"EXP" ) or 0 )+5 ) setElementData(source,"Hunter",true) end end end end end addEvent("onPlayerPickUpRacePickup",true) addEventHandler("onPlayerPickUpRacePickup",getRootElement(),someoneReachedHunter) I Got some bugs.. Lets say we are playing 2 in the server. And if both gots hunters, data sets only to one player.. What's wrong ?
  16. function someoneReachedHunter(number, sort, model) for index, account in ipairs ( getAccounts ( ) ) do if getAccountPlayer ( account ) then local alreadyGotHunter = getElementData(source, "gotHunter") if sort == "vehiclechange" and model == 425 and not alreadyGotHunter then outputChatBox ( "#000000* #ffffff " ..getPlayerName(source).." Got hunter! $#11dd111000", getRootElement(), 255, 255, 255, true ) setAccountData( account,"Hunters",tostring( getAccountData( account,"Hunters" ) or 0 )+1 ) setAccountData( account,"Cash",tostring( getAccountData( account,"Cash" ) or 0 )+1000 ) setAccountData( account,"EXP",tostring( getAccountData( account,"EXP" ) or 0 )+5 ) setElementData(source, "gotHunter", true) end end end end addEvent("onPlayerPickUpRacePickup",true) addEventHandler("onPlayerPickUpRacePickup", root, someoneReachedHunter) addEvent("onMapStarting", true) function resetHunterStatus() for k, player in ipairs(getElementsByType("player")) do setElementData(player, "gotHunter", false) end end addEventHandler("onMapStarting", root, resetHunterStatus) Its script that when player takes hunter it sets his Hunters data +1, and if he takes hunter again in same map, data wont be +1. But when server plays 2 or more players, it bugs.. When other player gots hunter the data wont change.
  17. LoL.. Fixed it addEvent( 'onPlayerRaceWasted',true ) addEventHandler( "onPlayerRaceWasted", root,DestructionWin )
  18. function DestructionWin( ) local account = getPlayerAccount( source ) if account then local alivePlayers = getAlivePlayers( ) if #alivePlayers == 1 then local account = getPlayerAccount( alivePlayers[1] ) if account then if isGuestAccount( account ) then return end setAccountData( account,"Wins",tostring( getAccountData( account,"Wins" ) or 0 )+1 ) setAccountData( account,"Cash",tostring( getAccountData( account,"Cash" ) or 0 )+ 250 ) setAccountData( account,"EXP",tostring( getAccountData( account,"EXP" ) or 0 )+math.random(3,5) ) outputChatBox("#000000* #ffffffYou won! $#11dd11250 #FFFFFF", source, 255, 255, 255, true) end end end end I dont know why it doesnt work..
  19. Newbie

    race state

    it works perfectly, but when i login with /login it starts to bug, it shows all the time.. Strange..
  20. exports[ 'scoreboard' ]:addScoreboardColumn( 'Hunters' ) exports[ 'scoreboard' ]:addScoreboardColumn( 'Maps' ) exports[ 'scoreboard' ]:addScoreboardColumn( 'Wins' ) exports[ 'scoreboard' ]:addScoreboardColumn( 'Cash' ) exports[ 'scoreboard' ]:addScoreboardColumn( 'EXP' ) Heh, i need to update scoreboard on event "onMapStarting"
  21. Newbie

    What's that?

    2. local angle = math.fmod((getTickCount() - g_PickupStartTick) * 360 / 2000, 360)
  22. Newbie

    What's that?

    function updatePickups() local angle = math.fmod((getTickCount() - g_PickupStartTick) * 360 / 2000, 360) local g_Pickups = g_Pickups local pickup, x, y, cX, cY, cZ, pickX, pickY, pickZ for colshape,elem in pairs(g_VisiblePickups) do pickup = g_Pickups[colshape] if pickup.load then setElementRotation(elem, 0, 0, angle) if pickup.label then cX, cY, cZ = getCameraMatrix() pickX, pickY, pickZ = unpack(pickup.position) x, y = getScreenFromWorldPosition(pickX, pickY, pickZ + 2.85, 0.08 ) local distanceToPickup = getDistanceBetweenPoints3D(cX, cY, cZ, pickX, pickY, pickZ) if distanceToPickup > 80 then pickup.labelInRange = false pickup.label:visible(false) elseif x then if distanceToPickup < 60 then if isLineOfSightClear(cX, cY, cZ, pickX, pickY, pickZ, true, false, false, true, false) then if not pickup.labelInRange then if pickup.anim then pickup.anim:remove() end pickup.anim = Animation.createAndPlay( pickup.label, Animation.presets.dxTextFadeIn(500) ) pickup.labelInRange = true pickup.labelVisible = true end if not pickup.labelVisible then pickup.label:color(255, 153, 0,255) end pickup.label:visible(true) else pickup.label:color(255, 153, 0,255) pickup.labelVisible = false pickup.label:visible(false) end else if pickup.labelInRange then if pickup.anim then pickup.anim:remove() end pickup.anim = Animation.createAndPlay( pickup.label, Animation.presets.dxTextFadeOut(1000) ) pickup.labelInRange = false pickup.labelVisible = false pickup.label:visible(true) end end local scale = (60/distanceToPickup)*0.7 pickup.label:scale(scale) pickup.label:position(x, y, false) else pickup.label:color(255, 153, 0,255) pickup.labelVisible = false pickup.label:visible(false) end if Spectate.fadedout then pickup.label:visible(false) -- Hide pickup labels when screen is black end end else if pickup.label then pickup.label:visible(false) if pickup.labelInRange then pickup.label:color(255, 153, 0,255) pickup.labelInRange = false end end end end end addEventHandler('onClientRender', g_Root, updatePickups)
  23. Newbie

    race state

    Thanks. I've removed playerElement otherwise i was getting a nil.
  24. Newbie

    race state

    How to kill it on state Running
×
×
  • Create New...