Max+ Posted April 11, 2013 Share Posted April 11, 2013 Hello Guys when i press the button spawn , triggerServerEvent for spwn but it didn't spawn me , and the spawn point in Interior 3 , local spawns = { { x = 238.6613311767, y = 141.05133056641, z = 1003.0234375 }; { x = 190.87297058105, y = 158.49531555176, z = 1003.0234375 }; { x = 298.23620605496, y = 172.01306152344, z = 1007.171875 } } addEvent('onClientWatnsToSpawn', true) addEventHandler('onClientWatnsToSpawn', root, function (player) if not isElement(player) then return end x, y, z = unpack(spawns[math.random(#spawns)]) setTimer ( spawnPlayer,3000,1,player, x, y, z,0,0,3,0 ); setTimer ( fadeCamera, 3000, 1, player, true, 0.5 ) setTimer ( setCameraTarget, 3000, 1, player, player ) showCursor ( player, false ) end ) addEventHandler ( 'onPlayerWasted', root, function (player) fadeCamera ( player, false, 1.0, 0, 0, 0 ); setTimer ( fadeCamera, 3500, 1, player, true, 0.5 ); x, y, z = unpack(spawns[math.random(#spawns)]) setTimer ( spawnPlayer,3000,1,player, x, y, z,0,0,3,0 ); end ) Link to comment
iPrestege Posted April 11, 2013 Share Posted April 11, 2013 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,0,0,3,0 ); setTimer ( fadeCamera, 3000, 1, source, true, 0.5 ); setTimer ( setCameraTarget, 3000, 1, source, source ); showCursor ( source, false ); end ); addEventHandler ( 'onPlayerWasted', root, function ( ) 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,0,3,0 ); end ); Link to comment
Max+ Posted April 11, 2013 Author Share Posted April 11, 2013 Thank's Man it's Working Great is player a bug now that's way the script wont working ? Link to comment
iPrestege Posted April 11, 2013 Share Posted April 11, 2013 You're Table Was Wrong And Player Bug The Script Too . Link to comment
Max+ Posted April 11, 2013 Author Share Posted April 11, 2013 Oh , if You Can Help Me with This i tryed fix it but i couldn't the problem is when i select skin for example id 60 and when i spawn it dosnt give me the skin i have selected it's set my skin to 0 cj StartSkin = 0 triggerServerEvent('onClientWatnsToSpawn', getLocalPlayer(), StartSkin) ----------------------- Link to comment
iPrestege Posted April 11, 2013 Share Posted April 11, 2013 And How You Will Select The Skin ? GUI or Ped or ? Link to comment
Max+ Posted April 11, 2013 Author Share Posted April 11, 2013 it's ped look to you Inbox i'v sent the script , Link to comment
iPrestege Posted April 11, 2013 Share Posted April 11, 2013 You Have To Get The Ped Model And Send It Server Side And For Ex ; Ped = createPed(.....) local Model = getElementModel(Ped) triggerServerEvent("SetModel",localPlayer,Model) Link to comment
Max+ Posted April 11, 2013 Author Share Posted April 11, 2013 i alredy Tryed that , See , StartSkin = 0 function start () skin = createPed ( StartSkin, 2749.7502441406,-2232.7170410156,61.727611541748,60 ) ------------------------- addEventHandler('onClientGUIClick', root, function ( ) if ( source == spawnskin ) then local Model = getElementModel(skin) triggerServerEvent('onClientWatnsToSpawn', getLocalPlayer(), Model) ---------------------------------------------------------------- it's give me Cj skin addEventHandler('onClientGUIClick',root, function ( ) if( source == rnextskin ) then if StartSkin == 312 then StartSkin = -1 elseif StartSkin == 2 then StartSkin = 8 end StartSkin = StartSkin + 1 setElementModel(skin,StartSkin) end addEventHandler('onClientGUIClick', root, function ( ) if ( source == lnextskin ) then if StartSkin == 0 then StartSkin = 313 elseif StartSkin == 9 then StartSkin = 3 end StartSkin = StartSkin - 1 setElementModel(skin,StartSkin) end Link to comment
iPrestege Posted April 11, 2013 Share Posted April 11, 2013 Hmmm.. i have a quis do you want to put all the game skins? or custom skins? or what? and can u show me that part u set the player skin? Link to comment
Max+ Posted April 11, 2013 Author Share Posted April 11, 2013 Yes i want all MTa skins it's alreay add in onClientGUIClik , if startSkin == 0 then 1 2 3 ever time +1 or ... Link to comment
iPrestege Posted April 11, 2013 Share Posted April 11, 2013 Try This ; local id = 0 for i = 0,312 do skinID[i] = i end addEventHandler("onClientGUIClick",root, function ( ) if ( source == rnextskin ) then do id = id + 1 if id > #skinID then id = 0 end end if isElement(skin) then while not setElementModel(skin, skinID[id]) do id = id + 1 end end elseif ( source == lnextskin ) then do id = id - 1 if id < 0 then id = #skinID end end if isElement(skin) then while not setElementModel(skin, skinID[id]) do id = id - 1 end end end end ); Link to comment
Max+ Posted April 11, 2013 Author Share Posted April 11, 2013 attempt to skinID a number value Link to comment
iPrestege Posted April 11, 2013 Share Posted April 11, 2013 Aha , I Forget to create the table : skinID = {} local id = 0 for i = 0,312 do skinID[i] = i end addEventHandler("onClientGUIClick",root, function ( ) if ( source == rnextskin ) then do id = id + 1 if id > #skinID then id = 0 end end if isElement(skin) then while not setElementModel(skin, skinID[id]) do id = id + 1 end end elseif ( source == lnextskin ) then do id = id - 1 if id < 0 then id = #skinID end end if isElement(skin) then while not setElementModel(skin, skinID[id]) do id = id - 1 end end end end ); Link to comment
Max+ Posted April 11, 2013 Author Share Posted April 11, 2013 Nope no Spawn Skin = 0 cj , i think i know the problem should i put id on the spawn table on server side or after x,y, z on setTimer(spawnPlayer , Link to comment
iPrestege Posted April 11, 2013 Share Posted April 11, 2013 No i test it now and works? u can try this one ! and see if it works or no ok? Button_ = {} Left = {} Right = {} Spawn = {} skinID = {} local id = 0 ped = createPed(0,x,y,z); setPedFrozen(ped,true); setPedAnimation(ped,"DANCING"," DAN_Down_A"); Left_Button = guiCreateButton(0.19, 0.75, 0.18, 0.04, "Previous", true); guiSetFont(Left_Button, "default-bold-small"); guiSetProperty(Left_Button, "NormalTextColour", "FFFE0000"); Right_Button = guiCreateButton(0.63, 0.76, 0.18, 0.04, "Next", true); guiSetFont(Right_Button, "default-bold-small"); guiSetProperty(Right_Button, "NormalTextColour", "FF01F4FD"); Spawn_Button = guiCreateButton(0.39, 0.70, 0.18, 0.04, "Spawn !", true); guiSetFont(Spawn_Button, "default-bold-small"); guiSetProperty(Spawn_Button, "NormalTextColour", "FF23FE00"); for i = 0, 400 do skinID[i] = i end addEventHandler("onClientGUIClick",root, function ( ) if ( source == Right_Button ) then do id = id + 1 if id > #skinID then id = 0 end end if isElement(ped) then while not setElementModel(ped, skinID[id]) do id = id + 1 end end elseif ( source == Left_Button ) then do id = id - 1 if id < 0 then id = #skinID end end if isElement(ped) then while not setElementModel(ped, skinID[id]) do id = id - 1 end end end end ); Link to comment
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