Jump to content

Help me please !! :( fail script


xBladex

Recommended Posts

ok ok

The problem is this I'm trying to create a script to grab the helicopter on the screen they found out the hunter but I do not work: (here it is!: S

function someoneReachedHunter(number, sort, model) 
    if sort == "vehiclechange" and model == 425 then 
local getTickNow = getTickCount () - getTickStart 
if getTickNow <= 1000 then 
alfa = getTickNow/1000 
elseif getTickNow >= 4000 then 
alfa = (5000-getTickNow)/1000 
else 
alfa = 1 
end 
alfa = alfa * alfa * alfa 
if mes_ID == 1 then 
    dxDrawText("Hunter Reached!",-1,sy/3,sx-1,sy,tocolor(0,0,0,alfa*200),(2.5*sx/1920)*alfa*0.2,ffsfont,"center","center",true) 
    dxDrawText("Hunter Reached!",0,sy/3,sx,sy,tocolor(255,0,0,alfa*255),(2.5*sx/1920)*alfa*0.2,ffsfont,"center","center",true) 
  
elseif mes_ID == 2 then 
    dxDrawText("Hunters Fight!",-1,sy/3,sx-1,sy,tocolor(0,0,0,alfa*200),(2.5*sx/1920)*alfa*0.2,ffsfont,"center","center",true) 
    dxDrawText("Hunters Fight!",0,sy/3,sx,sy,tocolor(255,0,0,alfa*255),(2.5*sx/1920)*alfa*0.2,ffsfont,"center","center",true) 
  
addEvent("onHunterEvent",true) 
addEventHandler("onHunterEvent",getRootElement(),start_drawing) 
         
    end 
end 
addEvent("onPlayerPickUpRacePickup",true) 
addEventHandler("onPlayerPickUpRacePickup",getRootElement(),someoneReachedHunter) 
--end 

forgive a mistake if I'm bad at this

Link to comment

-- client side:

local mes_ID = 0 
local enabled = false 
local sx, sy = guiGetScreenSize() 
local getTickStart = getTickCount() 
  
function someoneReachedHunter(ID) 
    mes_ID = tonumber(ID) 
    if enabled then 
        removeEventHandler("onClientRender",root,drawHunterReached) 
        enabled = false 
    else 
        addEventHandler("onClientRender",root,drawHunterReached) 
        enabled = true 
    end 
end 
addEvent("onHunterEvent",true) 
addEventHandler("onHunterEvent",getRootElement(),someoneReachedHunter) 
  
function drawHunterReached() 
local getTickNow = getTickCount () - getTickStart 
if getTickNow <= 1000 then 
    alfa = getTickNow/1000 
elseif getTickNow >= 4000 then 
    alfa = (5000-getTickNow)/1000 
else 
    alfa = 1 
end 
alfa = alfa * alfa * alfa 
if mes_ID == 1 then 
    dxDrawText("Hunter Reached!",-1,sy/3,sx-1,sy,tocolor(0,0,0,alfa*200),(2.5*sx/1920)*alfa*0.2,ffsfont,"center","center",true) 
    dxDrawText("Hunter Reached!",0,sy/3,sx,sy,tocolor(255,0,0,alfa*255),(2.5*sx/1920)*alfa*0.2,ffsfont,"center","center",true)  
elseif mes_ID == 2 then 
    dxDrawText("Hunters Fight!",-1,sy/3,sx-1,sy,tocolor(0,0,0,alfa*200),(2.5*sx/1920)*alfa*0.2,ffsfont,"center","center",true) 
    dxDrawText("Hunters Fight!",0,sy/3,sx,sy,tocolor(255,0,0,alfa*255),(2.5*sx/1920)*alfa*0.2,ffsfont,"center","center",true)     
    end 
end 

-- server side:

function vehicleDetector(pickupID, pickupType, vehicleModel) 
    if (pickupType == "vehiclechange") then 
        if (vehicleModel == 425) then 
            triggerClientEvent(source,"onHunterEvent",source,1) 
        end 
    end 
end 
addEventHandler("onPlayerPickUpRacePickup",getRootElement(),vehicleDetector) 

Edited by Guest
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...