Jump to content

Help - Resource functions


Recommended Posts

Posted

Hey!

I use a MTA DayZ Original (v0.5.5) gamemode, but I need to export functions of a resource for the gamemode. I can't post the code, not this time.

Code function from MTA DayZ gamemode:

client-side

function playerStatsClientSite() 
if getElementData(getLocalPlayer(),"logedin") then 
toggleControl ("radar",false) 
showPlayerHudComponent ("clock",false)  
showPlayerHudComponent ("radar",false) 
showPlayerHudComponent ("money",false)  
showPlayerHudComponent ("health",false)  
--showPlayerHudComponent ("weapon",false)  
--showPlayerHudComponent ("ammo",false)  
showPlayerHudComponent ("breath",false)  
if getElementData(getLocalPlayer(),"Map") >= 1  then 
    toggleControl ("radar",true) 
end 
if getElementData(getLocalPlayer(),"GPS") >= 1  then 
    showPlayerHudComponent ("radar",true)  
end 
if getElementData(getLocalPlayer(),"Watch") >= 1 then 
    showPlayerHudComponent ("clock",true)  
end 
end 
end 
setTimer(playerStatsClientSite,1000,0) 

But this part:

if getElementData(getLocalPlayer(),"GPS") >= 1  then 
    showPlayerHudComponent ("radar",true)  
end 

Need, rather than on / off the radar, it enable resource called hud. But if you do not have the GPS item, must stop the resource HUD.

Someone can help me?

SORRY FOR MY ENGLISH.

Posted
You will need to modify your hud resource. If you want us to help you in that, you should post the script(s).

This is the gamemode hud script. But I don't want to activate the radar, but activate the another resource called Hud.

Posted
if getElementData(getLocalPlayer(),"GPS") >= 1  then 
    showPlayerHudComponent ("radar",false) 

That only disable the radar... I need start the Hud resource. PS: Hud is a resource name.

Posted

You can't just start and stop a resource for one player only. If you start a resource, it will be loaded for every single player on your server same thing applies for stopping and restarting it, keep that in mind.

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...