EmBaby85 Posted February 23, 2017 Share Posted February 23, 2017 (edited) I am creating a script, I have peds in database with different X,Y,Z but now I see all of them spawn at the same position. What's wrong in my code? [lua]function loadPeds() local P = dbPoll ( dbQuery ( db, "SELECT * FROM peds LIMIT 120" ), -1 ) for index, variable in ipairs(P) do local X, Y, Z, R = variable['pos_x'], variable['pos_y'], variable['pos_z'], variable['rot_z'] local ID, anim, wep = variable['sID'], getWeaponIDFromName(variable['anim']), variable['wep'] local frozen, headless, muscels = variable['freeze'], variable['headless'], variable['muscels'] CP = createPed(ID, X, Y, Z, R) end end addEventHandler("onResourceStart", resourceRoot, loadPeds)[/lua] Edited February 23, 2017 by Rands 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