Author Topic: [Resolved] CIT Hunger Games  (Read 1759 times)

Offline Gonzalo

  • Honorable
  • *****
  • Posts: 127
  • Lua, C#, PHP, HTML & CSS Developer
  • Registered: 07/10/2011
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
  • Group: BNA
  • Ingame: Gonzalo|BNA
  • Squad: SO -Special Ops
[Resolved] CIT Hunger Games
« on: 29 09, 2012, 05:22:54 am »
This script is nearly done. I just have to find a way to make player blips dissapear, I tried using the following:

Code: [Select]
Server Side

function hideBlip()
exports.CITteams:setPlayerBlipAlpha(client, 0)
end
addEvent("HungerGames.blips", true)
addEventHandler("HungerGames.blips", root, hideBlip)

function showBlip()
exports.CITteams:setPlayerBlipAlpha(client, 255)
end
addEvent("regularBlips", true)
addEventHandler("regularBlips", root, showBlip)

Code: [Select]
Client Side

function hideBlips()
dim = getElementDimension(localPlayer)
if (dim == 860) then
triggerServerEvent("HungerGames.blips", root)
elseif (dim ~= 860) then
triggerServerEvent("regularBlips", root)
end
end
addEventHandler("onClientRender", root, hideBlips)

But I keep getting an error like this: exports.CITteams:setPlayerBlipAlpha string "?"

After I sort that out, (help is welcomed), the script will be pretty much done, so I'll be adding it to SMU.

Original suggestion is here: http://cit2.net/forum/index.php?topic=47061.0
But I didn't moved it here because it would appear in messages of the week and it'll say "in Suggestion Procesing"
« Last Edit: 04 10, 2012, 06:39:57 pm by Arran »
Quote
Innovation fuels success

beerman123

  • Guest
Re: CIT Hunger Games
« Reply #1 on: 29 09, 2012, 01:26:21 pm »
triggerServerEvent("HungerGames.blips", root)

Don't send the root element at triggerServerEvent, it's the source/client element you're sending which can't be root. Should use localPlayer for 2nd argument.
« Last Edit: 29 09, 2012, 01:28:42 pm by Rick »

Offline Arran

  • Administrator
  • ******
  • Posts: 5642
  • Registered: 20/11/2010
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
  • Ingame: [CIT]Arran
Re: CIT Hunger Games
« Reply #2 on: 29 09, 2012, 03:53:57 pm »
triggerServerEvent("HungerGames.blips", root)

Don't send the root element at triggerServerEvent, it's the source/client element you're sending which can't be root. Should use localPlayer for 2nd argument.

False. Using root is the most efficient element to send as it's userdata value is the lowest. Local player doesn't need to be sent because the predefined value of client is used server side when the event is handled.

There is no export to make peoples blips invisible. Instead tell me a way of distinguishing whether it should be visible or not client side for example if they should be disabled in a certain dimension and I'll update CITteams.
« Last Edit: 29 09, 2012, 04:02:39 pm by Arran »
Proof You Are so Much More Than What You Realise
Authority is not truth. Truth is authority.

Offline Gonzalo

  • Honorable
  • *****
  • Posts: 127
  • Lua, C#, PHP, HTML & CSS Developer
  • Registered: 07/10/2011
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
  • Group: BNA
  • Ingame: Gonzalo|BNA
  • Squad: SO -Special Ops
Re: CIT Hunger Games
« Reply #3 on: 29 09, 2012, 10:34:16 pm »
False. Using root is the most efficient element to send as it's userdata value is the lowest. Local player doesn't need to be sent because the predefined value of client is used server side when the event is handled.

There is no export to make peoples blips invisible. Instead tell me a way of distinguishing whether it should be visible or not client side for example if they should be disabled in a certain dimension and I'll update CITteams.


If you can disable them in   dimension 860 it should be more than enough 
Quote
Innovation fuels success

Offline Arran

  • Administrator
  • ******
  • Posts: 5642
  • Registered: 20/11/2010
    YearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYearsYears
  • Ingame: [CIT]Arran
Re: CIT Hunger Games
« Reply #4 on: 01 10, 2012, 02:15:17 pm »

If you can disable them in   dimension 860 it should be more than enough

Done. Restart CITteams.
Proof You Are so Much More Than What You Realise
Authority is not truth. Truth is authority.