Enargy, Posted February 21, 2014 Share Posted February 21, 2014 Hello, I'm finishing a script said a ped, which tries to create a ped with a specific ID, but my question is. What is a table or to choose a specific number of skin ? For example: "/ped 1" = 240 or "/ped 2" = 217 pedCreated = function pedCreated(command) local x, y, z = getElementPosition(source) local pedModel = createPed(0, x, y + 5, z) end addCommandHandler("ped", pedCreated) Link to comment
cheez3d Posted February 21, 2014 Share Posted February 21, 2014 pedCreated = function (player,_,pedid) local x, y, z = getElementPosition(player) local pedModel = createPed(tonumber(pedid), x, y + 5, z) end addCommandHandler("ped", pedCreated) This is a server-side script. What it does is: it gets the id you specify when you use the command (example: /ped 23) and stores it in pedid as a string. Then it runs the function and creates a ped with the id you specified. Link to comment
Moderators Citizen Posted February 21, 2014 Moderators Share Posted February 21, 2014 (edited) This ? (server-script) local skinList = { 240, -- 1 217 -- 2 } function pedCreated(thePlayer, cmd, skinNumber) local x, y, z = getElementPosition(thePlayer) local thePed = createPed(skinList[tonumber(skinNumber)] or 0, x, y + 5, z) end addCommandHandler("ped", pedCreated) Edited February 21, 2014 by Guest Link to comment
Anubhav Posted February 21, 2014 Share Posted February 21, 2014 No Citizen , He wants that he uses /ped skinID and he will get the skin. Any skin ID. Not only theese two. Link to comment
Moderators Citizen Posted February 21, 2014 Moderators Share Posted February 21, 2014 No Citizen , He wants that he uses /ped skinID and he will get the skin. Any skin ID. Not only theese two. For me, this: For example: "/ped 1" = 240 or "/ped 2" = 217 For me it means that he wants to spawn a ped with the skin id 240 when he writes /ped 1 etc. Of course he can add other skins to the list. Link to comment
Enargy, Posted February 21, 2014 Author Share Posted February 21, 2014 hmmm no, I'm trying to make is that with the command /ped 1 make the appearance of the Model 240 and the same command but with the number two /ped 2 make up another model. Link to comment
Karuzo Posted February 21, 2014 Share Posted February 21, 2014 That's exactly what Citizen gave you. Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now