5150 Posted October 9, 2015 Posted October 9, 2015 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?
HUNGRY:3 Posted October 9, 2015 Posted October 9, 2015 function lol() setElementModel(source,0) end addEventHandler("onPlayerSpawn",root,lol) Server side
ozulus Posted October 10, 2015 Posted October 10, 2015 function setSkinOnSpawn () setPedSkin ( source, 0 ) end addEventHandler ( "onPlayerSpawn", getRootElement(), setSkinOnSpawn )
1LoL1 Posted October 10, 2015 Posted October 10, 2015 function skin () setPedSkin ( source, 0 ) end addEventHandler("onPlayerSpawn", getRootElement(), skin) -- spawn addEventHandler("onPlayerJoin", getRootElement(), skin) -- join
5150 Posted October 10, 2015 Author Posted October 10, 2015 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
t3wz Posted October 10, 2015 Posted October 10, 2015 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.
5150 Posted October 11, 2015 Author Posted October 11, 2015 can i just add the script to the spawnmanager? because i kinda need spawnmanager
5150 Posted October 11, 2015 Author Posted October 11, 2015 and then what do i use if i cant use setpedskin?
Noki Posted October 11, 2015 Posted October 11, 2015 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.
5150 Posted October 11, 2015 Author Posted October 11, 2015 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
Noki Posted October 11, 2015 Posted October 11, 2015 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.
5150 Posted October 11, 2015 Author Posted October 11, 2015 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
t3wz Posted October 11, 2015 Posted October 11, 2015 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 )
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