[FREE] [ESX /QBCore] Player Ped

Player Ped Script

  • Admins can give peds to the player using /setped [playerid] [model] command or if they want to browse through the models before giving ped, they can simply just type the command /setped [playerid] and it’ll pop up a menu to select the ped. If you still don’t understand it, please watch the video preview.

  • Players can access their given ped by using the command /pedmenu from which they can set a given ped as default ped and if they want to reset their skin back, they can do it as well.

  • Supports ESX & QBCore framework

Video Preview

Image Preview

image



Requirements

  • es_extended / qb-core
  • ox_mysql
  • ox_lib

Command

  • /setped [playerid] [model]
  • /pedmenu

Download

Installation

  • Import no1-playerped.sql from the folder
  • Open config/config.lua and set the Config.Framework according to your framework
  • Ensure the script and you’re good to go!
  • Enjoy :+1:
13 Likes

Can I use this
With hazmat suit then make hazmat an item basically can I make that slash command an item instead?

1 Like

Just what i needed! Thanks!
BTW is it locked to admins?

Yes

1 Like

Neat concept and use of local functions. Few things though, should probably do some sort of ped validation because if the ped is wrong they would be invisible especially needed since you allow args to be used for the player so if its wrong the command user may not know and the database will be updated as soon as it’s done. It’s also probably a poor idea to run a query on start without at the very least some sort of error logging since the resource is dependent on that.

You could also do some sort of oop and save the player peds this way (on drop and restart) instead of updating the database every single time a command is invoked. While its perm restricted and its not a lot of data, should just be avoided imo but not a big deal.

Edit: Made a PR with ped model check.

1 Like

Thank you man!

Update by @ ROCKY_southpaw - thank you

  • check if the model is valid
  • add chat message for bad peds

Seems to be failing on finding a valid ped model, even though im directly copy pasting the ped name from the ped.lua and using the correct framework.

2 Likes

Every time I type /setped id model I get a server-side error server.lua:53 attempt to call a nil value (global ‘ValidPedModel’) :frowning:

2 Likes

Yup same here.

Probs on my part.

You can change no1-playerped/server.lua at 66774916f66c2ca3c55b5343f572f3e0694e9221 · FingersNo1/no1-playerped · GitHub this to just function ValidPedModel(pedModel) instead of it being a local function.

I made it apparent that I didn’t test my PR with this resource as my core does this on its own. So not sure why OP didn’t test it but :man_shrugging:.

1 Like

FIXED!! Thank you very much!

Thanks :slight_smile:

Thanks

hello, can we set 1 steamhex only 1 peds type ? thanks

It’s already like that. You can only set ped for single identifier.

Oke thanks for answer, but after setting via /setped, the character is permanent or not

Thnaks! i have a question, im new on all this world, and im trying to figure out how stop peds (being a cop) like you stop a player. this script could be for that? (sorry for my english)

Thank you all!

1 Like

Hey, i’ve delete the “local” juste before function ValidPedModel(pedModel), but i got the same problem …

is there a way to save the ped to a character, after flying in and out it goes back to a default model.