SoMoRay Posted March 9, 2013 Posted March 9, 2013 there proplem with this script if player join server see what he got but when he in the server and I restart the mode we got like this ...........
SoMoRay Posted March 9, 2013 Author Posted March 9, 2013 Are you sure you are running this client sided? sorry i forget put him this is a client side ! x, y = guiGetScreenSize ( ) function centerWindow ( center_window, k, v ) local screenW, screenH = guiGetScreenSize ( ) local windowW, windowH = guiGetSize ( center_window, false ) local x, y = ( screenW - windowW ) / v, ( screenH - windowH )/k guiSetPosition ( center_window, x, y, false ) end thePed = createPed ( 1, 0, 0, 500, 90 ) setElementFrozen ( thePed, true ) setCameraMatrix ( -3.6658203125, 0, 500.48254455566, 2906.9938964844, 0, 201.84664916992 ) Animations = { "dnce_M_b"} setPedAnimation( thePed, "DANCING", Animations [ math.random ( #Animations ) ] ) theObject = createObject ( 1337, 0, 0, 499, 60 ) setElementAlpha ( theObject, 0 ) SpawnBtn = guiCreateButton( 0, 0, 125, 62.5, "Spawn", false ) centerWindow ( SpawnBtn, 1.2, 1.96 ) RightBtn = guiCreateButton( 0, 0, 70, 35, ">", false ) centerWindow ( RightBtn, 2, 1.4 ) LeftBtn = guiCreateButton( 0, 0, 70, 35, "<", false ) centerWindow ( LeftBtn, 2, 3.3 ) showCursor ( true ) function Right ( ) if ( isElement ( thePed ) ) then if ( getElementModel ( thePed ) ~= 280 ) then setElementModel ( thePed, 280 ) else setElementModel ( thePed, 1 ) end end end function Left ( ) if ( isElement ( thePed ) ) then if ( getElementModel ( thePed ) ~= 1 ) then setElementModel ( thePed, 1 ) else setElementModel ( thePed, 280 ) end end end addEventHandler ( "onClientGUIClick", root, function ( ) if ( source == SpawnBtn ) then triggerServerEvent ( "spawnPed", localPlayer, getElementModel ( thePed ) ) if isElement ( thePed ) then destroyElement ( thePed ) end if isElement ( theObject ) then destroyElement ( theObject ) end destroyElement ( SpawnBtn ) destroyElement ( RightBtn ) destroyElement ( LeftBtn ) stopSound(sound) sound = nil showCursor ( false ) elseif ( source == RightBtn ) then Right ( ) elseif ( source == LeftBtn ) then Left ( ) end end )
OGF Posted March 9, 2013 Posted March 9, 2013 I'm assuming you have onPlayerJoin in the server script, then spawn player within the event/function. Instead trigger a client side event that puts you into the ped select mode.
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