Jump to content

[HelP] Save Skin After Deatch to Respawn


TDK

Recommended Posts

Posted

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?

----/

Fresh Russian Server! Fresh every day=D

Posted

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
)

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted

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

Fresh Russian Server! Fresh every day=D

Posted

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

Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online!

programista php rzeszów

Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting.

Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!

Posted
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!

Fresh Russian Server! Fresh every day=D

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...