Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

expose IsPlayer() #42

Merged
merged 7 commits into from
Jun 7, 2022
Merged

expose IsPlayer() #42

merged 7 commits into from
Jun 7, 2022

Conversation

55Honey
Copy link
Member

@55Honey 55Honey commented Jun 4, 2022

Exposed/added functions/methods:

  • IsPlayer()
    - Object:AddLoot(entry,amount)

55Honey and others added 5 commits June 4, 2022 19:36
Exposed/added functions/methods:
- IsPlayer()
- GameObject:AddLoot(entry,amount)
@55Honey
Copy link
Member Author

55Honey commented Jun 6, 2022

I'm trying to AddLoot() to a chest, but it doesn't show up when looting. Despite the code running with correct entry and amount in the debugger:
image

Script:

local PLAYER_EVENT_ON_COMMAND = 42       -- (event, player, command)
local TYPE_GAME_OBJECT = 2

local function TestCommand(event,player,command)
    if command ~= 'abc' then
        return
    end

    local worldObject = PerformIngameSpawn( TYPE_GAME_OBJECT, 2850, player:GetMap():GetMapId(), 0, player:GetX(), player:GetY(), player:GetZ(), 0, false, 0, 1 )

    if worldObject then
        worldObject:AddLoot(50608,1,19019,1,34721,15)
        print(worldObject:GetName())
    end

    return false
end

RegisterPlayerEvent(PLAYER_EVENT_ON_COMMAND, TestCommand)

@55Honey 55Honey requested review from Nyeriah and r-o-b-o-t-o June 7, 2022 09:33
@55Honey
Copy link
Member Author

55Honey commented Jun 7, 2022

AddLoot() seems to work only on GO generation, so we need to exclude it from this PR. Reduced to only Object:IsPlayer()

@55Honey 55Honey changed the title expose core functions (WIP) expose IsPlayer() Jun 7, 2022
@55Honey 55Honey merged commit bfe1634 into master Jun 7, 2022
@55Honey 55Honey deleted the PR-features branch June 7, 2022 13:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants