Jump to content

[HELP]-Please-


SoMoRay

Recommended Posts

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 
  
) 
  
  
Link to comment

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