Jump to content

setting a default skin for spawn/connecting


5150

Recommended Posts

Posted

so i have private skins in my server, but every time a player spawns, they get a random skin, which sometimes allows them access to the private skins (if they get it by luck with default). does anyone have a script that will always set a players skin to 0 (CJ) when they spawn?

Posted
  
function setSkinOnSpawn () 
    setPedSkin ( source, 0 ) 
end 
addEventHandler ( "onPlayerSpawn", getRootElement(), setSkinOnSpawn ) 
  

Posted
function skin () 
setPedSkin ( source, 0 ) 
end 
addEventHandler("onPlayerSpawn", getRootElement(), skin) -- spawn 
addEventHandler("onPlayerJoin", getRootElement(), skin) -- join 

Posted

still not working.... maybe its me? i added a meta, everythings named correctly, and its in a zip file. i start it and it successfully loads/starts but it still doesnt set the skin to CJ when i spawn

Posted

  • Make sure that the script is in the right type (server)
  • Make sure that there's no other resources which sets the player's skin (spawnmanager etc)

Also don't use 1LoL1/ozulus' code, setPedSkin is a deprecated function.

Posted
setElementModel 

If a skin is still being given randomly and the code is not working, I take it you are using the freeroam resource? My guess is that would be overriding your code.

Posted

ok thanks, but like i asked is there a way to add this into spawnmanager? i need my spawnpoints working + setskin to default when a player joins or spawns

Posted

Yes, when you create your spawnpoints using createSpawnpoint (spawnmanager/spawn.lua - line 6), just specify the skin as the ID of your default skin to 0.

exports.spawnmanager:createSpawnpoint(0, 0, 5, 90, 0 --[[ CJ skin ]], 0, 0) 

That will create a spawnpoint at 0, 0, 5 (center of the map), rotate the player 90 degrees, spawn him with the CJ skin and put him in interior and dimension 0.

Posted

oh wtf i used the play gamemode to create the spawnpoints..... sorry im making this so complicated lol. this is basically how i did it

BrophY

1.0

at the very bottom

Posted

the play gamemode doesn't uses createSpawnpoint, it just spawn the player using spawnPlayerAtSpawnpoint and then set him skin to a random one.

To edit this just open play/broph.lua and find line 19:

repeat until setElementModel(player,math.random(312)) 

change to:

setElementModel( player, 0 ) 

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...