Sign in to follow this  
Reinhard

why

Recommended Posts

When im alone in the server it works. but when there are many players it doesn't

why does it still show the blip to the people not in the "Survivors" team?

help please!

function scheck()
local team = getPlayerTeam(source)
if getTeamName(team) == "Survivors" then blips[vehicles] = createBlipAttachedTo(vehicle, 51) return end
destroyElement(blips[vehicles])
end
addEventHandler("onPlayerSpawn", getRootElement(), scheck)
 
function createVehicles ( )
    loc = math.random ( #vehicles )
vehicle = createVehicle ( 609, vehicles[loc][1], vehicles[loc][2], vehicles[loc][3], 0, 0, 0)
addEventHandler ( "onVehicleEnter", vehicle, start )
addEventHandler ( "onVehicleExit", vehicle, removedata2 )
addEventHandler ( "onVehicleExplode", vehicle, fail )
local theTeam = getTeamFromName("Survivors")
if not theTeam then return end
for k,v in ipairs(getPlayersInTeam(theTeam)) do
      blips[vehicles] = createBlipAttachedTo(vehicle, 51)
outputChatBox("[Weapon Delivery] Weapon delivery truck available!", v, 100, 0, 0, true)
end
end

 

Share this post


Link to post

It is serverside script, yes?

if getTeamName(team) == "Survivors" then blips[vehicles] = createBlipAttachedTo(vehicle, 51, nil,nil,nil,nil,nil,nil,nil,getPlayersInTeam("Survivors")) return end

Replace line 3.

Edited by Yazir

Share this post


Link to post

it works at the first time but the second time it doesnt... expected element at argument 10: got table, at line 3 e.e createBlipAttachedTo

the problem is in the getPlayersInTeam it's arg 10.

i tried this and it doesn't give the error anymore and it works.. but when there are many players in the server will it still work??

 

if getTeamName(team) == "Survivors" then blips[vehicles] = createBlipAttachedTo(vehicle, 51, nil,nil,nil,nil,nil,nil,nil,getPlayersInTeam("Survivors")) return end

 

when i keep respawning over and over again with different teams it still shows the blip....

 

Edited by Reinhard

Share this post


Link to post
1 hour ago, Reinhard said:

when i keep respawning over and over again with different teams it still shows the blip....

 

found solution on this one.

Edited by Reinhard

Share this post


Link to post

why am i getting destroyElement expected element at argument 1 warning???? it's pretty annoying. when i spawn as different teams over and over again...

function scheck()
if source and getElementType ( source ) == 'player' then
local team = getPlayerTeam(source)
local teamname = getTeamFromName("Survivors")
if getTeamName(team) == "Survivors" then
setTimer(function()
blips[vehicles] = createBlipAttachedTo(vehicle, 51, nil,nil,nil,nil,nil,nil,nil,nil)
end
, 1000, 1)
end
if not blips[vehicles] then return end
destroyElement(blips[vehicles])
end
end
addEventHandler("onPlayerSpawn", getRootElement(), scheck)

 

Edited by Reinhard

Share this post


Link to post

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
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.