-
Posts
208 -
Joined
-
Last visited
Everything posted by Newbie
-
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)
-
Thanks guys, made what i needed
-
Uhm.. 1, fades in totaly black is there any way to fade that wont be black, like apha: 0.2
-
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.
-
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
-
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 )
-
so nobody will help when i need so so.. to finish it ?
-
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
-
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 ?
-
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
-
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 ?
-
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.
-
LoL.. Fixed it addEvent( 'onPlayerRaceWasted',true ) addEventHandler( "onPlayerRaceWasted", root,DestructionWin )
-
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..
-
it works perfectly, but when i login with /login it starts to bug, it shows all the time.. Strange..
-
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"
-
2. local angle = math.fmod((getTickCount() - g_PickupStartTick) * 360 / 2000, 360)
-
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)
-
Thanks. I've removed playerElement otherwise i was getting a nil.