DarkLink Posted June 27, 2012 Posted June 27, 2012 How can I destroy a Player ? I mean , the ped itself ? I created it using 'spawnPlayer', now how I destroy that ped ? destroyElement says that cant destroy player, so ? Thanks alot. Borderpatrol Project Gamemode - Under Development (80%)
robhol Posted June 27, 2012 Posted June 27, 2012 You probably can't, and are most likely doing the wrong thing in order to accomplish your goals. If you explain why you want to do this, there's most likely some other solution. Do NOT PM ME for help unless invited. - New MTA Script Editor Scripting help "etiquette": understandable language, relevant code (ALL code if unsure), [Lua] tags, error messages with line numbers. Super simple stuff.
ahdon Posted June 27, 2012 Posted June 27, 2012 Maybe you mean this? https://wiki.multitheftauto.com/wiki/KillPed "People who think they know everything are annoying to those of us who do"
DarkLink Posted June 27, 2012 Author Posted June 27, 2012 You probably can't, and are most likely doing the wrong thing in order to accomplish your goals. If you explain why you want to do this, there's most likely some other solution. Because I want to spawn the player on another spot ty Borderpatrol Project Gamemode - Under Development (80%)
MTA Team qaisjp Posted June 27, 2012 MTA Team Posted June 27, 2012 You can't. Instead, try this code at the start of your gamemode _getElementsByType = getElementsByType _spawnPlayer = spawnPlayer _destroyElement = destroyElement function getElementsByType(i, ...) if i == "player" then local tab = {} for i,v in ipairs(_getElementsByType"player") do if not getElementData("isDestroyed") then tab[i] = v end end return tab else return _getElementsByType(i,...) end end function spawnPlayer(p,...) setElementData(p, "isDestroyed", false, true) _spawnPlayer(p,...) end function destroyElement(e,...) setElementData(e, "isDestroyed", true, true) _destroyElement(e) end it's untested. syntax is correct tho
MTA Team qaisjp Posted June 27, 2012 MTA Team Posted June 27, 2012 You can spawnPlayer on the same person even if they are spawned btw, it wont create a clone.
DarkLink Posted June 27, 2012 Author Posted June 27, 2012 You can spawnPlayer on the same person even if they are spawned btw, it wont create a clone. Hmm didnt know about this, thanks I guess my question is answered Borderpatrol Project Gamemode - Under Development (80%)
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