Skip to content

Suggested change: Max Player #1

Description

@IdrisDose

This function

function GetPlayerByEntityID(id)
for i=0,32 do
if(NetworkIsPlayerActive(i) and GetPlayerPed(i) == id) then return i end
end
return nil
end

should be changed to

function GetPlayerByEntityID(id)
	for i=0, GetConvarInt('sv_maxclients', 32) do
		if(NetworkIsPlayerActive(i) and GetPlayerPed(i) == id) then return i end
	end
	return nil
end

To account for more than 32 players or alternatively replace with returning NetworkGetPlayerIndexFromPed(id).

Ref:
citizenfx/cfx-server-data#199
citizenfx/cfx-server-data#214

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions