[SOLVED] Creating ESX_policejob commands

Hi there,

I’m very new to .lua scripting, but very interested.

At the moment, all police tasks such as search, cuff, escort, put in vehicle etc are accessible via the “F6” menu, however, this menu freezes your character which hinders you in an on-foot police chase.

I’m trying to create a script that registers commands in correlation to the F6 police menu items.

Like:
/escort (Used to call the esx_policejob:drag event)
or
/cuff

The image attached is what I have so far. I’m currently getting an error for the line with local xPlayer (Error: attempt to call a nil value (field ‘GetPlayerFromID’)

Any help is appreciated!

[Solved]: I discovered in the ESX docs here that I was using ESX.GetOkayerFromId in the client.lua when it should have been in the server.lua

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.