swag_k_dog Posted October 13, 2016 Share Posted October 13, 2016 (edited) I made another script where it's a window to choose your skin. after that window comes this script: --server local creen, hotel, fbi, cross, cj local screenW, screenH = guiGetScreenSize() addEventHandler("onClientResourceStart", resourceRoot, function() showCursor(true) creen = guiCreateStaticImage(0.00, 0.00, 1.00, 1.00, ":spawnpanel/images/SPAWN.png", true) hotel = guiCreateButton(359, 316, 36, 36, "", false, creen) guiSetAlpha(hotel, 0.00) fbi = guiCreateButton(656, 310, 36, 36, "", false, creen) guiSetAlpha(fbi, 0.00) cross = guiCreateButton(712, 200, 36, 36, "", false, creen) guiSetAlpha(cross, 0.00) cj = guiCreateButton(870, 231, 36, 36, "", false, creen) guiSetAlpha(cj, 0.00) function closePanel() destroyElement(creen) removeEventHandler("onClientGUIClick", resourceRoot, guiClicked) showCursor(false) end function guiClicked(btn, state) if btn == "left" and state == "up" then if source == fbi then triggerServerEvent("FBI", localPlayer) closePanel() elseif source == hotel then triggerServerEvent("HOTEL", localPlayer) closePanel() elseif source == cross then triggerServerEvent("CROSS", localPlayer) closePanel() elseif source == cj then triggerServerEvent("CJ", localPlayer) closePanel() end end end addEventHandler("onClientGUIClick", resourceRoot, guiClicked) end ) addEvent("FBI", true) addEvent("HOTEL", true) addEvent("CJ", true) addEvent("CROSS", true) addEventHandler("FBI", getRootElement(), function() spawnPlayer (source, 1525.7, -1474, 9.5) end ) addEventHandler("HOTEL", getRootElement(), function() spawnPlayer (source, 293, -1531, 24.6) end ) addEventHandler("CJ", getRootElement(), function() spawnPlayer (source, 2328, -1222, 22.6) end ) addEventHandler("CROSS", getRootElement(), function() spawnPlayer(source, 1822, -1116, 24) end ) why do I spawn with CJ skin when I click one of the spawn buttons? and how do I spawn with the skin I chose? ty Edited October 13, 2016 by swag_k_dog Link to comment
iPrestege Posted October 13, 2016 Share Posted October 13, 2016 bool spawnPlayer ( player thePlayer, float x, float y, float z, [ int rotation = 0, int skinID = 0, int interior = 0, int dimension = 0, team theTeam = getPlayerTeam(thePlayer) ] ) Argument 5 skinID or it will be 0 so add the skin id 1 Link to comment
swag_k_dog Posted October 13, 2016 Author Share Posted October 13, 2016 Just now, FaHaD said: bool spawnPlayer ( player thePlayer, float x, float y, float z, [ int rotation = 0, int skinID = 0, int interior = 0, int dimension = 0, team theTeam = getPlayerTeam(thePlayer) ] ) Argument 5 skinID or it will be 0 so add the skin id yes, but the player will be spawned with the argument I gave(for example, if I write 30, he will spawn with the skin id 30 ) but I want it to scan what skin the player has already and teleport them with the skin they had before without changing it.. thanks Link to comment
iPrestege Posted October 13, 2016 Share Posted October 13, 2016 2 minutes ago, swag_k_dog said: yes, but the player will be spawned with the argument I gave(for example, if I write 30, he will spawn with the skin id 30 ) but I want it to scan what skin the player has already and teleport them with the skin they had before without changing it.. thanks Oh then no need to use spawnPlayer use : setElementPosition 1 Link to comment
swag_k_dog Posted October 13, 2016 Author Share Posted October 13, 2016 Just now, FaHaD said: Oh then no need to use spawnPlayer use : setElementPosition thanks, ill try out 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