01-15-2014, 01:10 AM
@STR_Warrior
okey. Have you found a mistake in protocols for my client crashes.
okey. Have you found a mistake in protocols for my client crashes.
Countdown
|
01-15-2014, 01:10 AM
@STR_Warrior
okey. Have you found a mistake in protocols for my client crashes.
01-15-2014, 01:12 AM
01-15-2014, 01:24 AM
(01-15-2014, 01:12 AM)STR_Warrior Wrote:(01-15-2014, 01:10 AM)daniel0916 Wrote: okey. Have you found a mistake in protocols for my client crashes. For you Player:SetFoodLevel works? Maybe PlayerJoined Hook haven't spawned the player so it comes a error. Maybe i should use the PlayerSpawned Hook? I will try it.
01-15-2014, 01:30 AM
Yea try the OnPlayerSpawned hook.
01-15-2014, 01:33 AM
(This post was last modified: 01-15-2014, 01:37 AM by daniel0916.)
01-15-2014, 01:38 AM
Yes, it should be.
Thanks given by: daniel0916
01-15-2014, 03:44 AM
How can i make a list?
I will add/remove there players who are alive. (for a minigame)
01-15-2014, 03:54 AM
Use a Lua table, index by number.
01-15-2014, 04:22 AM
01-15-2014, 05:07 AM
-- Create table at startup: g_Players = {} function OnWorldStarted(World) -- Hook that gets called when the worlds are initialized g_Players[World:GetName()] = {} end -- Add to table: table.insert(g_Players[cPlayer:GetWorld():GetName()], cPlayer:GetName()) -- Go through all the values. Assuming you need it every tick: function OnWorldTick(World, TimeDelta) for Idx, PlayerName in ipairs(g_Players[World:GetName()]) World:DoWithPlayer(PlayerName, function(Player) -- Do awesome stuff here end) end end |
« Next Oldest | Next Newest »
|