Hello, I am working on deathmatch gamemode. Simple thing.
I do spawn with luacode weapons on gm_construct. I did also respawn for this random weapon on same position if there is no weapon anymore (because someone took it).
So I use like so:
[CODE]
function GM:PlayerCanPickupWeapon( player, entity )
--If a weapon is taken he needs to respawn after time
if IsValid(player) and IsValid(entity) then
if entity:GetNWBool("Taken") == false then
entity:SetNWBool("Taken", true)
local spawnpos = entity:GetNWVector("Spawnpos")
table.insert(wep_respawncheck_list, {spawnpos, CurTime() + 3})
print("take<<<<", player, entity, spawnpos)
end
end
return true
end
[/CODE]
It works perfect.
But Problem is this. The Player spawns with pistole. So the function above get calls if player get loadout with pistole. So queue list "wep_respawncheck_list" gets a Spawnpos what does not exists (ofc because the pistol spawned with the player together)
So I have no idea why this is like so. I don't also know alternatives... =/
There's no way around this. The best you can do is just check how long the player's been alive.
Sorry, you need to Log In to post a reply to this thread.