Jump to content

[HELP]


xeon17

Recommended Posts

Client Side:

local x, y = guiGetScreenSize() 
  
SkinMusic = "data/music/SkinSelectMusic.mp3" 
SkinAnims = {"dnce_M_b","DAN_Left_A","DAN_Down_A","DAN_Loop_A"} 
StartSkin = 0 
NewSkin = false 
  
--client 
addEvent("TriggerClient",true) 
function SelectSkin () 
    setElementInterior ( getLocalPlayer(), 0, 0,0,0 ) 
    setCameraMatrix( 2745.8266601563,-2231.1694335938,62.25520324707, 3999.9999499991,-2607.4000244141,16.1) 
    skin = createPed ( StartSkin, 2749.7502441406,-2232.7170410156,61.727611541748,60 ) 
    setPedAnimation( skin, "DANCING", SkinAnims[math.random(1,4)]) 
    fadeCamera( true, 10) 
    setTime(0,0) 
    SkinSelectMusic = playSound(SkinMusic,true) 
    bindKey("arrow_r","down",NextSkin) 
    bindKey("arrow_l","down",LastSkin) 
    bindKey(".","down",SpawnPlayer) 
    addEventHandler("onClientRender",getRootElement(),AnnounceSkinJob) 
    guiSetVisible(lnextskin,true) 
    guiSetVisible(rnextskin,true) 
    guiSetVisible(spawnskin,true) 
    showCursor(true) 
    showChat(false) 
    showPlayerHudComponent ( "radar", false ) 
end 
addEventHandler("TriggerClient",root,SelectSkin) 
function SpawnPlayer() 
    local r,g,b = math.random(0,255),math.random(0,255),math.random(0,255) 
    triggerServerEvent ( "onClientWantsToSpawn", getLocalPlayer(), getLocalPlayer(),StartSkin,r,g,b ) 
    unbindKey("arrow_r","down",NextSkin) 
    unbindKey("arrow_l","down",LastSkin) 
    unbindKey("lshift","down",SpawnPlayer) 
    setTime(12,0) 
    stopSound(SkinSelectMusic) 
    removeEventHandler("onClientRender",getRootElement(),AnnounceSkinJob) 
    showCursor(false) 
    showChat(true) 
    showPlayerHudComponent ( "radar", true ) 
    guiSetVisible(lnextskin,false) 
    guiSetVisible(rnextskin,false) 
    guiSetVisible(spawnskin,false) 
    setElementData(getLocalPlayer(),"red",r) 
    setElementData(getLocalPlayer(),"green",g) 
    setElementData(getLocalPlayer(),"blue",b) 
end 
function NextSkin() 
    if StartSkin == 312 then 
        StartSkin = -1 
    elseif StartSkin == 2 then 
        StartSkin = 8 
    end 
        StartSkin = StartSkin + 1 
        setElementModel(skin,StartSkin) 
        setPedAnimation( skin, "DANCING", SkinAnims[math.random(1,4)]) 
        SkinJobTextColor() 
end 
function LastSkin() 
    if StartSkin == 0 then 
        StartSkin = 313 
    elseif StartSkin == 9 then 
        StartSkin = 3 
    end 
        StartSkin = StartSkin - 1 
        setElementModel(skin,StartSkin) 
        setPedAnimation( skin, "DANCING", SkinAnims[math.random(1,4)]) 
        SkinJobTextColor() 
end 
  
lnextskin = guiCreateButton(x-x/1.30,y/1.22,x/5,y/20,"<<<",false) 
guiSetProperty(lnextskin,"PushedTextColour","FFFFFF00") 
guiSetFont(lnextskin,"sa-header") 
rnextskin = guiCreateButton(x-x/2.90,y/1.22,x/5,y/20,">>>",false) 
guiSetProperty(rnextskin,"PushedTextColour","FFFFFF00") 
guiSetFont(rnextskin,"sa-header") 
spawnskin = guiCreateButton(x-x/1.80,y/1.22,x/5,y/20,"Play",false) 
guiSetProperty(spawnskin,"PushedTextColour","FFFFFF00") 
guiSetFont(spawnskin,"sa-header") 
guiSetVisible(lnextskin,false) 
guiSetVisible(rnextskin,false) 
guiSetVisible(spawnskin,false) 
  
addEventHandler( "onClientGUIClick", getRootElement(), function() 
    if source == lnextskin then 
        LastSkin() 
    elseif source == rnextskin then 
        NextSkin() 
    elseif source == spawnskin then 
        SpawnPlayer() 
    end 
end) 
  
------PEDS 
  
function FreezeBots() 
    local Bots = getElementsByType("ped") 
        for k,v in ipairs(Bots) do 
        setElementFrozen(v,true) 
    end 
end 
  
function loadMansion () 
  
        outputChatBox("[bem-Vindo Ao Server]", getRootElement(), 255, 0, 0,true ) 
end 
addEventHandler("onClientResourceStart", getResourceRootElement(), loadMansion) 

Link to comment
  • Replies 52
  • Created
  • Last Reply

Top Posters In This Topic

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