TDK Posted August 19, 2010 Share Posted August 19, 2010 Hi all, i have a simple question: how to:save skin after death and give it to player after respawn? my code don't work, and sorry, but i delete code....((( it's my sketch: skin = getPlayerSkin(source) function spawnOnFinish (prevA, curA, autoLogin) outputChatBox ("You are spawned ...", source, 38,120,50, false) spawnPlayer (source, 0, 0, 5, 0, skin, 0, 0, Gamers) else spawnPlayer (source, 0, 0, 5, 0, math.random(50,60), 0, 0, Players) fadeCamera (source, true) setCameraTarget (source, source) end addEventHandler("onClientDownloadFinished", getRootElement(), spawnOnFinish) ----\ It's from wiki, but i try to spawn player after all Downloadings Finished, and save skin after death... anybody have any ideas? ----/ Link to comment
dzek (varez) Posted August 19, 2010 Share Posted August 19, 2010 you are mixing server-side (spawnPlayer) with client-side (onClientDownloadFinished). my modified play resource: function spawn(player) if getElementType(player)=="player" then local desiredSkin = getElementData(player, "skinID") if desiredSkin then skinID=desiredSkin else skinID= math.random(9,288) end spawnX = math.random(-691, -671) spawnY = math.random(962, 971) spawnZ = 20 repeat until spawnPlayer ( player, spawnX, spawnY, spawnZ, 180, skinID ) fadeCamera(player, true) setCameraTarget(player, player) end end addEventHandler("onPlayerJoin", root, function() setTimer(function(src) spawn(src) end, 5000, 1, source) end ) addEventHandler("onPlayerWasted", root, function() if getElementType(source)=="player" then local tmpID = getPedSkin(source) --outputChatBox(tmpID.."f") setElementData(source,"skinID",tmpID) setTimer(spawn, 5000, 1, source) end end ) Link to comment
TDK Posted August 19, 2010 Author Share Posted August 19, 2010 Thank you varez, god of mta scripting=D i'm stupid, serverside and clientside))))) im' lol) thanks) ----------/ And My Second Stupid Question: dxDrawImage and hide player nick if it's an admin ----------\ Sketch: function CheckACLgroup () if aclgroup = admin then dxDrawImage(х,у,3,admin.png) ShowPlayerNick = false Link to comment
dzek (varez) Posted August 19, 2010 Share Posted August 19, 2010 wtf? it's so random. teach yourself more, as i won't be doing everything for you. setPlayerNametagShowing to hide name tag. using this and a little wiki - you will make admin icon on admin head: https://forum.multitheftauto.com/viewtop ... 91&t=28836 Link to comment
TDK Posted August 19, 2010 Author Share Posted August 19, 2010 wtf? it's so random.teach yourself more, as i won't be doing everything for you. setPlayerNametagShowing to hide name tag. using this and a little wiki - you will make admin icon on admin head: https://forum.multitheftauto.com/viewtop ... 91&t=28836 setPlayerNametagShowing <<< thanks for this, my script done and fully worked! Link to comment
TDK Posted August 19, 2010 Author Share Posted August 19, 2010 you are mixing server-side (spawnPlayer) with client-side (onClientDownloadFinished).my modified play resource: function spawn(player) if getElementType(player)=="player" then local desiredSkin = getElementData(player, "skinID") if desiredSkin then skinID=desiredSkin else skinID= math.random(9,288) end spawnX = math.random(-691, -671) spawnY = math.random(962, 971) spawnZ = 20 repeat until spawnPlayer ( player, spawnX, spawnY, spawnZ, 180, skinID ) fadeCamera(player, true) setCameraTarget(player, player) end end addEventHandler("onPlayerJoin", root, function() setTimer(function(src) spawn(src) end, 5000, 1, source) end ) addEventHandler("onPlayerWasted", root, function() if getElementType(source)=="player" then local tmpID = getPedSkin(source) --outputChatBox(tmpID.."f") setElementData(source,"skinID",tmpID) setTimer(spawn, 5000, 1, source) end end ) F*ck! Don't work! black screen only! help plz! Link to comment
TDK Posted August 19, 2010 Author Share Posted August 19, 2010 Debug, Debug, Debug... looool debug is still=D 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