Jump to content

Spawn The Ped Skin ,


Max+

Recommended Posts

Hello i got problem with i have a skin selector if i select skin 60 he always give me cj skin witch is 0

The Script,

ped = createPed ( id, 2749.7502441406,-2232.7170410156,61.727611541748,60 )  
  
addEventHandler('onClientGUIClick', root, 
    function ( ) 
    if ( source == Spawn_Button ) then 
    local skin = getElementModel(ped) 
    triggerServerEvent('onClientWatnsToSpawn', localPlayer,skin) 
    playSoundFrontEnd ( 18 ) 
    stopSound(Intro) 
    showCursor(false) 
    showChat(true) 
    showPlayerHudComponent ( "all", true ) 
    guiSetVisible(Left_Button,false) 
    guiSetVisible(Right_Button,false) 
    guiSetVisible(Spawn_Button,false) 
end 
end 
) 

local spawns = { 
    { 238.6613311767,141.05133056641,1003.0234375 }; 
    { 190.87297058105,158.49531555176,1003.0234375 }; 
    { 298.23620605496,172.01306152344,1007.171875 }; 
}; 
  
addEvent('onClientWatnsToSpawn', true) 
addEventHandler('onClientWatnsToSpawn', root, 
function () 
    if not isElement(source) then return end 
local x, y, z = unpack(spawns[math.random(#spawns)]) 
    setTimer ( spawnPlayer,3000,1,source, x, y, z); 
    setTimer ( fadeCamera, 3000, 1, source, true, 0.5 ); 
    setTimer ( setCameraTarget, 3000, 1, source, source ); 
    showCursor ( source, false ); 
    end 
); 
  
addEventHandler ( 'onPlayerWasted', root, 
    function (skin) 
        fadeCamera ( source, false, 1.0, 0, 0, 0 ); 
        setTimer ( fadeCamera, 3500, 1, source, true, 0.5 ); 
         local x, y, z = unpack(spawns[math.random(#spawns)]); 
         setTimer ( spawnPlayer,3000,1,source, x, y, z); 
    end 
); 

Link to comment
local spawns = { 
    { 238.6613311767,141.05133056641,1003.0234375 }; 
    { 190.87297058105,158.49531555176,1003.0234375 }; 
    { 298.23620605496,172.01306152344,1007.171875 }; 
}; 
  
addEvent('onClientWatnsToSpawn', true) 
addEventHandler('onClientWatnsToSpawn', root, 
function (skin) 
    if not isElement(source) then return end 
local x, y, z = unpack(spawns[math.random(#spawns)]) 
    setTimer ( spawnPlayer,3000,1,source, x, y, z,0,skin); 
    setTimer ( fadeCamera, 3000, 1, source, true, 0.5 ); 
    setTimer ( setCameraTarget, 3000, 1, source, source ); 
    showCursor ( source, false ); 
    end 
); 
  
addEventHandler ( 'onPlayerWasted', root, 
    function () 
        local id = getElementModel (source) 
        fadeCamera ( source, false, 1.0, 0, 0, 0 ); 
        setTimer ( fadeCamera, 3500, 1, source, true, 0.5 ); 
         local x, y, z = unpack(spawns[math.random(#spawns)]); 
         setTimer ( spawnPlayer,3000,1,source, x, y, z,0,id); 
    end 
); 

Link to comment

local spawns = { 
    { 238.6613311767,141.05133056641,1003.0234375 }; 
    { 190.87297058105,158.49531555176,1003.0234375 }; 
    { 298.23620605496,172.01306152344,1007.171875 }; 
}; 
  
addEvent('onClientWatnsToSpawn', true) 
addEventHandler('onClientWatnsToSpawn', root, 
function (skin) 
    if not isElement(source) then return end 
local x, y, z = unpack(spawns[math.random(#spawns)]) 
    setTimer ( spawnPlayer,3000,1,source, x, y, z,0,skin,3); 
    setTimer ( fadeCamera, 3000, 1, source, true, 0.5 ); 
    setTimer ( setCameraTarget, 3000, 1, source, source ); 
    showCursor ( source, false ); 
    end 
); 
  
addEventHandler ( 'onPlayerWasted', root, 
    function () 
        local id = getElementModel (source) 
        fadeCamera ( source, false, 1.0, 0, 0, 0 ); 
        setTimer ( fadeCamera, 3500, 1, source, true, 0.5 ); 
         local x, y, z = unpack(spawns[math.random(#spawns)]); 
         setTimer ( spawnPlayer,3000,1,source, x, y, z,0,id,3); 
    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...