mjau Posted July 15, 2011 Posted July 15, 2011 A bit of client side function armyspawn(button,state) if button == "left" and state == "up" then triggerServerEvent("movePlayerToPosition",getLocalPlayer(),207.00390625,1865.75390625,13.140625,0) closeWindow() removecursor() armyskin(thePlayer) end end function armyskin(thePlayer) setElementModel ( thePlayer, 287 ) end And my Serverside function moveThePlayer(x,y,z,rotation) if x and y and z and rotation then spawnPlayer(source,x,y,z,rotation,skin) setCameraTarget(source,source) end end addEvent("movePlayerToPosition",true) addEventHandler("movePlayerToPosition",root,moveThePlayer)] It wont change the skin
mjau Posted July 15, 2011 Author Posted July 15, 2011 shall i add it serverside and how cuz that skin is for one button of the gui i made and i dont want that skin to be in every spawn
Castillo Posted July 15, 2011 Posted July 15, 2011 function armyspawn(button,state) if button == "left" and state == "up" then triggerServerEvent("movePlayerToPosition",getLocalPlayer(),207.00390625,1865.75390625,13.140625,0) closeWindow() removecursor() armyskin(getLocalPlayer()) end end function armyskin(thePlayer) setElementModel ( thePlayer, 287 ) end Try that.
mjau Posted July 15, 2011 Author Posted July 15, 2011 hmm now it swaps over to the army skin and fast back to the skin i were using i can barely see it swaps before it goes back
Castillo Posted July 15, 2011 Posted July 15, 2011 Try this: --client side function armyspawn(button,state) if button == "left" and state == "up" then triggerServerEvent("movePlayerToPosition",getLocalPlayer(),207.00390625,1865.75390625,13.140625,0,287) closeWindow() removecursor() end end --server side function moveThePlayer(x,y,z,rotation,skin) if x and y and z and rotation and skin then spawnPlayer(source,x,y,z,rotation,skin) setCameraTarget(source,source) end end addEvent("movePlayerToPosition",true) addEventHandler("movePlayerToPosition",root,moveThePlayer) As you can see i'm passing "skin" argument to the server side.
mjau Posted July 15, 2011 Author Posted July 15, 2011 oh and how do i restrict it to the players i choose or what do i need to do that
MTA Team qaisjp Posted July 15, 2011 MTA Team Posted July 15, 2011 Allow only some people to use it, solidsnake/cast
mjau Posted July 15, 2011 Author Posted July 15, 2011 like i create a table with the accounts wich are allowed to spawn and the script reads that table I hate tables so give me a start ore sumething
mjau Posted July 15, 2011 Author Posted July 15, 2011 Fuck hell ill upload my whole code now my adminspawn button dont work
mjau Posted July 15, 2011 Author Posted July 15, 2011 Client side GUIEditor_Window = {} GUIEditor_Button = {} GUIEditor_TabPanel = {} GUIEditor_Tab = {} function createthegui() showCursor(true,true) GUIEditor_Window[1] = guiCreateWindow(6,0,297,596,"Spawn menu",false) GUIEditor_Button[1] = guiCreateButton(12,24,98,43,"Adminspawn",false,GUIEditor_Window[1]) GUIEditor_Button[2] = guiCreateButton(176,38,88,33,"Pilot",false,GUIEditor_Window[1]) GUIEditor_Button[3] = guiCreateButton(16,87,89,41,"Robber",false,GUIEditor_Window[1]) GUIEditor_Button[4] = guiCreateButton(16,149,88,40,"Hobo",false,GUIEditor_Window[1]) GUIEditor_Button[5] = guiCreateButton(15,200,92,35,"Carjacker",false,GUIEditor_Window[1]) GUIEditor_Button[6] = guiCreateButton(17,245,88,38,"Army Rangers",false,GUIEditor_Window[1]) GUIEditor_Button[7] = guiCreateButton(12,288,92,40,"Arms Dealer",false,GUIEditor_Window[1]) GUIEditor_Button[8] = guiCreateButton(14,335,87,37,"Drug Dealer",false,GUIEditor_Window[1]) GUIEditor_Button[9] = guiCreateButton(13,377,88,36,"The Organisation",false,GUIEditor_Window[1]) GUIEditor_TabPanel[1] = guiCreateTabPanel(288,123,0,5,false,GUIEditor_Window[1]) GUIEditor_Tab[1] = guiCreateTab("Tab",GUIEditor_TabPanel[1]) addEventHandler("onClientGUIClick", GUIEditor_Button[1], teleportPlayer, false) addEventHandler("onClientGUIClick", GUIEditor_Button[6], armyspawn, false) end function openTeleportWindow() createthegui() end addCommandHandler("teleportme",openTeleportWindow) function teleportPlayer(button,state) if button == "left" and state == "up" then triggerServerEvent("movePlayerToPosition",getLocalPlayer(),1479.6,-1612.8,14.0,69) closeWindow() removecursor() end end function armyspawn(button,state) if button == "left" and state == "up" then triggerServerEvent("movePlayerToPosition",getLocalPlayer(),207.00390625,1865.75390625,13.140625,0,287) closeWindow() removecursor() end end function closeWindow() destroyElement(GUIEditor_Window[1]) end function removecursor() showCursor ( false ) end Server side function moveThePlayer(x,y,z,rotation,skin) if x and y and z and rotation and skin then spawnPlayer(source,x,y,z,rotation,skin) setCameraTarget(source,source) end end addEvent("movePlayerToPosition",true) addEventHandler("movePlayerToPosition",root,moveThePlayer)
mjau Posted July 15, 2011 Author Posted July 15, 2011 so still ned help with restricting the spawns .
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