Jump to content

Dentos

Members
  • Posts

    68
  • Joined

  • Last visited

Everything posted by Dentos

  1. I tried and only thing it did is show my playerblip when i reconnect and not all gang members had restart manually for it to show i think i need use a eventhandler restart the resource everytime someone logs in
  2. I have this other little problem when i reconnect it wont show you on map anymore I tried adding addEventHandler ( "onPlayerJoin", root, addTeamBlip ) but didnt work I have to restart script everytime i reconnect for it to work heres what i added local pBlips = { } addEventHandler("onResourceStart", resourceRoot, function() for index, player in ipairs(getElementsByType("player")) do addTeamBlip(player) end end ) function addTeamBlip(player) if ( pBlips[player] ) then return false end -- Adding a prevention of duplicate blips local theGang = getElementData ( player, "gang" ) if ( theGang and theGang ~= "None" ) then local r, g, b = getPlayerNametagColor( player ) local theBlip = createBlipAttachedTo( player, 0, 2, 0, 255, 0 ) -- Change visibility to only the team members setElementVisibleTo( theBlip, root, false ) for index, value in ipairs ( getPlayersByGang ( theGang ) ) do -- THIS setElementVisibleTo( theBlip, value, true ) end pBlips[player] = theBlip end end function destroyBlip(element) local theElement = source or element if ( theElement ) then destroyElement(pBlips[theElement]) pBlips[theElement] = nil -- Just in-case... end end -- Events addEventHandler ( "onPlayerJoin", root, addTeamBlip ) --ADDED THIS! addEventHandler ( "onPlayerSpawn", root, addTeamBlip ) -- onPlayerSpawn will now add a teamBlip addEventHandler ( "onPlayerQuit", root, destroyBlip ) addEventHandler ( "onPlayerWasted", root, destroyBlip ) function getPlayersByGang ( gang ) local players = { } for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( getElementData ( player, "gang" ) == gang ) then table.insert ( players, player ) end end return players end or maybe a command to to make resource restart every 5 seconds automatically or something but i think it be more efficient if reousrce restarted when player connected
  3. Now I have this other little problem when i reconnect it wont show you on map anymore I tried adding addEventHandler ( "onPlayerJoin", root, addTeamBlip ) but didnt work I have to restart script everytime i reconnect for it to work heres what i added local pBlips = { } addEventHandler("onResourceStart", resourceRoot, function() for index, player in ipairs(getElementsByType("player")) do addTeamBlip(player) end end ) function addTeamBlip(player) if ( pBlips[player] ) then return false end -- Adding a prevention of duplicate blips local theGang = getElementData ( player, "gang" ) if ( theGang and theGang ~= "None" ) then local r, g, b = getPlayerNametagColor( player ) local theBlip = createBlipAttachedTo( player, 0, 2, 0, 255, 0 ) -- Change visibility to only the team members setElementVisibleTo( theBlip, root, false ) for index, value in ipairs ( getPlayersByGang ( theGang ) ) do -- THIS setElementVisibleTo( theBlip, value, true ) end pBlips[player] = theBlip end end function destroyBlip(element) local theElement = source or element if ( theElement ) then destroyElement(pBlips[theElement]) pBlips[theElement] = nil -- Just in-case... end end -- Events addEventHandler ( "onPlayerJoin", root, addTeamBlip ) --ADDED THIS! addEventHandler ( "onPlayerSpawn", root, addTeamBlip ) -- onPlayerSpawn will now add a teamBlip addEventHandler ( "onPlayerQuit", root, destroyBlip ) addEventHandler ( "onPlayerWasted", root, destroyBlip ) function getPlayersByGang ( gang ) local players = { } for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( getElementData ( player, "gang" ) == gang ) then table.insert ( players, player ) end end return players end
  4. Thank you so much man cant thank you enough you dont know how long i been stuck on this
  5. like this ? still not working very sorry for my silly mistakes i feel so noob lua just not my forte sorry again and thanks a bunch for you time local pBlips = { } addEventHandler("onResourceStart", resourceRoot, function() for index, player in ipairs(getElementsByType("player")) do addTeamBlip(player) end end ) function getPlayersByGang ( gang ) local players = { } for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( getElementData ( player, "gang" ) == gang ) then table.insert ( players, player ) end end return players end function destroyBlip(element) local theElement = source or element if ( theElement ) then destroyElement(pBlips[theElement]) pBlips[theElement] = nil -- Just in-case... end end -- Events addEventHandler ( "onPlayerSpawn", root, addTeamBlip ) -- onPlayerSpawn will now add a teamBlip addEventHandler ( "onPlayerQuit", root, destroyBlip ) addEventHandler ( "onPlayerWasted", root, destroyBlip )
  6. Ok so I replaced but its not working and not geting any errors now not sure if I replaced it right sorry kinda new at all this local pBlips = { } addEventHandler("onResourceStart", resourceRoot, function() for index, player in ipairs(getElementsByType("player")) do addTeamBlip(player) end end ) function addTeamBlip(player) if ( pBlips[player] ) then return false end -- Adding a prevention of duplicate blips local pAccount = getPlayerAccount(player) local theGang = ( isGuestAccount(pAccount) and false ) or exports["gang_system"]:getAccountGang(pAccount) if ( theGang ) then local r, g, b = getPlayerNametagColor( player ) local theBlip = createBlipAttachedTo( player, 0, 2, r, g, b ) -- Change visibility to only the team members setElementVisibleTo( theBlip, root, false ) for index, value in ipairs function getPlayersByGang ( gang ) local players = { } for _, player in ipairs ( getElementsByType ( "player" ) ) do if ( getElementData ( player, "gang" ) == gang ) then table.insert ( players, player ) end end return players end do setElementVisibleTo( theBlip, value, true ) end pBlips[player] = theBlip end end function destroyBlip(element) local theElement = source or element if ( theElement ) then destroyElement(pBlips[theElement]) pBlips[theElement] = nil -- Just in-case... end end -- Events addEventHandler ( "onPlayerSpawn", root, addTeamBlip ) -- onPlayerSpawn will now add a teamBlip addEventHandler ( "onPlayerQuit", root, destroyBlip ) addEventHandler ( "onPlayerWasted", root, destroyBlip )
  7. So im trying run this script and i keep geting this error ERROR: [Addons]/gangblipq/playerblips.lua:20: bad argument #1 'ipairs (table expected,got boolea) this the script local pBlips = { } addEventHandler("onResourceStart", resourceRoot, function() for index, player in ipairs(getElementsByType("player")) do addTeamBlip(player) end end ) function addTeamBlip(player) if ( pBlips[player] ) then return false end -- Adding a prevention of duplicate blips local pAccount = getPlayerAccount(player) local theGang = ( isGuestAccount(pAccount) and false ) or exports["gang_system"]:getAccountGang(pAccount) if ( theGang ) then local r, g, b = getPlayerNametagColor( player ) local theBlip = createBlipAttachedTo( player, 0, 2, r, g, b ) -- Change visibility to only the team members setElementVisibleTo( theBlip, root, false ) for index, value in ipairs ( exports["gang_system"]:getGangMembers(theGang) ) do setElementVisibleTo( theBlip, value, true ) end pBlips[player] = theBlip end end function destroyBlip(element) local theElement = source or element if ( theElement ) then destroyElement(pBlips[theElement]) pBlips[theElement] = nil -- Just in-case... end end -- Events addEventHandler ( "onPlayerSpawn", root, addTeamBlip ) -- onPlayerSpawn will now add a teamBlip addEventHandler ( "onPlayerQuit", root, destroyBlip ) addEventHandler ( "onPlayerWasted", root, destroyBlip ) '
  8. Sorry the ] was for closing [ /lua ] added an extra by accident I dont think it recognizes as a resource since in console after refresh I dont get failed to load
  9. So i been trying load this resource for player blip but as much as try it wont load here it is playerblips.lua local pBlips = { } addEventHandler("onResourceStart", resourceRoot, function() for index, player in ipairs(getElementsByType("player")) do addTeamBlip(player) end end ) function addTeamBlip(player) if ( pBlips[player] ) then return false end -- Adding a prevention of duplicate blips local pAccount = getPlayerAccount(player) local theGang = ( pAccount and isGuestAccount(pAccount) and false ) or exports["gang_system"]:getAccountGang(pAccount) if ( theGang ) then local r, g, b = getPlayerNametagColor( player ) local theBlip = createBlipAttachedTo( player, 0, 2, r, g, b ) -- Change visibility to only the team members setElementVisibleTo( theBlip, root, false ) for index, value in ipairs ( exports["gang_system"]:getGangMembers(theGang) ) do setElementVisibleTo( theBlip, value, true ) end pBlips[player] = theBlip end end function destroyBlip(element) local theElement = source or element if ( theElement ) then destroyElement(pBlips[theElement]) pBlips[theElement] = nil -- Just in-case... end end -- Events addEventHandler ( "onPlayerSpawn", root, addTeamBlip ) -- onPlayerSpawn will now add a teamBlip addEventHandler ( "onPlayerQuit", root, destroyBlip ) addEventHandler ( "onPlayerWasted", root, destroyBlip )] meta.xml Ive tried doing refresh on console and everything but server wont load it please help other resources load just fine
  10. please help me out with script I beg you its just im not very good on lua and its last thing I need for my server please I been stuck on this more than a month
  11. Me ayudas con el script porfa esq no se mucho de lua y es lo ultimo que me falta porfa te lo ruego e estado mas de un mes atrapado con este problema
  12. So the script work but it only does the same as my old script show every player in map to everyone when you die or reconnect Im trying to make it so only gang members can see eachother
  13. Dosent work maybe dosent work cuz im using catillos gang system?
  14. How to I define sorry im kinda new I trired adding ' ' on player --> 'player' didnt work
  15. So I did what you said and I removed few end and now I get no error but it still dosent work root = getRootElement () color = { 0, 255, 0 } players = {} resourceRoot = getResourceRootElement ( getThisResource () ) players = { } function onResourceStart ( resource ) local team = getPlayerTeam ( source ) if player == team then players [ player ] = createBlipAttachedTo ( player, 0, 2, r, g, b, 255 ) else destroyElement(blip) end end function onPlayerSpawn ( spawnpoint ) local team = getPlayerTeam ( source ) if player == team then players [ player ] = createBlipAttachedTo ( player, 0, 2, r, g, b, 255 ) else destroyElement(blip) end end addEventHandler ( "onPlayerSpawn", root, onPlayerSpawn ) function destroyBlips ( totalammo, killer, killerweapon ) destroyBlipsAttachedTo ( source ) end addEventHandler ( "onPlayerQuit", root, destroyBlips ) addEventHandler ( "onPlayerWasted", root, destroyBlips ) function destroyBlipsAttachedTo ( player ) local attached = getAttachedElements ( player ) if ( attached ) then for _, element in ipairs ( attached ) do if ( getElementType ( element ) == "blip" ) then destroyElement ( element ) end end end end theres script with no errors but no idea why it dosent work
  16. So I made this script that only allows you to see only your team members on map but I get this error in debugscript 3 ERROR: Loading script failed:gangblipps/playerblips.lua:10: 'then' expected near '=' root = getRootElement () color = { 0, 255, 0 } players = {} resourceRoot = getResourceRootElement ( getThisResource () ) players = { } function onResourceStart ( resource ) local team = getPlayerTeam ( source ) if player = team then players [ player ] = createBlipAttachedTo ( player, 0, 2, r, g, b, 255 ) else destroyElement(blip) end end end function onPlayerSpawn ( spawnpoint ) local team = getPlayerTeam ( source ) if player = team then players [ player ] = createBlipAttachedTo ( player, 0, 2, r, g, b, 255 ) else destroyElement(blip) end end end addEventHandler ( "onPlayerSpawn", root, onPlayerSpawn ) function destroyBlips ( totalammo, killer, killerweapon ) destroyBlipsAttachedTo ( source ) end addEventHandler ( "onPlayerQuit", root, destroyBlips ) addEventHandler ( "onPlayerWasted", root, destroyBlips ) function destroyBlipsAttachedTo ( player ) local attached = getAttachedElements ( player ) if ( attached ) then for _, element in ipairs ( attached ) do if ( getElementType ( element ) == "blip" ) then destroyElement ( element ) end end end oh im using castillos gang system idk if that has anything to do with it not working Im still learning so sorry if I made a stupid mistake
  17. esque quiero no tener que poner manualmente cada team quiero que sea automatico te unes a un team y ya puedes ver donde estan todos tus compraneros en el mapa
  18. el script funciona pero noc como hacerle que solo se puedan ver localizacion del jugador entre miembros del mismo team envez q todos se puedan ver a todos
  19. lo que pasa es que quiero que este script de blips de mapa (puntos verdes donde estan localizados los jugadores) solo sirva para los gang y solo se puedan ver entre equipos este es el script porfavor ayuda root = getRootElement () color = { 0, 255, 0 } players = {} resourceRoot = getResourceRootElement ( getThisResource () ) players = { } function onResourceStart ( resource ) for _, player in ipairs ( getElementsByType ( "player" ) ) do local team = getPlayerTeam ( player ) local r, g, b = unpack ( ( team and { getTeamColor ( team ) } or { getPlayerNametagColor ( player ) } ) ) players [ player ] = createBlipAttachedTo ( player, 0, 2, r, g, b, 255 ) end end addEventHandler ( "onResourceStart", resourceRoot, onResourceStart ) function onPlayerSpawn ( spawnpoint ) local team = getPlayerTeam ( source ) local r, g, b = unpack ( ( team and { getTeamColor ( team ) } or { getPlayerNametagColor ( source ) } ) ) if ( players [ source ] ) then setBlipColor ( players [ source ], r, g, b, 255 ) else players [ source ] = createBlipAttachedTo ( source, 0, 2, r, g, b, 255 ) end end addEventHandler ( "onPlayerSpawn", root, onPlayerSpawn ) function destroyBlips ( totalammo, killer, killerweapon ) destroyBlipsAttachedTo ( source ) end addEventHandler ( "onPlayerQuit", root, destroyBlips ) addEventHandler ( "onPlayerWasted", root, destroyBlips ) function destroyBlipsAttachedTo ( player ) local attached = getAttachedElements ( player ) if ( attached ) then for _, element in ipairs ( attached ) do if ( getElementType ( element ) == "blip" ) then destroyElement ( element ) end end end end el script sirve pero salen todos los jugadores en el mapa solo quiero q se puedan ver entre equipos
  20. also tried this any nothing please help skype denntos root = getRootElement () color = { 0, 255, 0 } players = {} resourceRoot = getResourceRootElement ( getThisResource () ) players = { } function onResourceStart ( resource ) for _, player in ipairs ( getElementsByType ( "player" ) ) do local gang = getPlayergang ( player ) local r, g, b = unpack ( ( gang and { getgangColor ( gang ) } or { getPlayerNametagColor ( player ) } ) ) players [ player ] = createBlipAttachedTo ( player, 0, 2, r, g, b, 255 ) end end addEventHandler ( "onResourceStart", resourceRoot, onResourceStart ) function onPlayerSpawn ( spawnpoint ) local gang = getPlayergang ( source ) local r, g, b = unpack ( ( gang and { getgangColor ( gang ) } or { getPlayerNametagColor ( source ) } ) ) if ( players [ source ] ) then setBlipColor ( players [ source ], r, g, b, 255 ) else players [ source ] = createBlipAttachedTo ( source, 0, 2, r, g, b, 255 ) end end addEventHandler ( "onPlayerSpawn", root, onPlayerSpawn ) function destroyBlips ( totalammo, killer, killerweapon ) destroyBlipsAttachedTo ( source ) end addEventHandler ( "onPlayerQuit", root, destroyBlips ) addEventHandler ( "onPlayerWasted", root, destroyBlips ) function destroyBlipsAttachedTo ( player ) local attached = getAttachedElements ( player ) if ( attached ) then for _, element in ipairs ( attached ) do if ( getElementType ( element ) == "blip" ) then destroyElement ( element ) end end end end
  21. I also tried this but dosent work playerBlibs = {} amouunt = 0 function updateGPS () amouunt = 0 local gangname = getElementData(getLocalPlayer(),"gang") for i, blip in ipairs(playerBlibs) do destroyElement(blip) end if getElementData(getLocalPlayer(),"gang") == "None" then return end playerBlibs = {} for i, player in ipairs(getElementsByType("player")) do if gangname == getElementData(player,"gang") then amouunt = amouunt+1 playerBlibs[amouunt] = createBlipAttachedTo(player,0,2,22,255,22) setBlipVisibleDistance(playerBlibs[amouunt],1000) end end end setTimer(updateGPS,10000,0)
  22. ok but cant manage make it so only gang member can see there team blips to work with castillo
×
×
  • Create New...