-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
1: El script esta usando OOP, y juzgando por tus ultimos topics pidiendo ayuda, no sabrias usarlo. 2: Lo vi antes ( en el recurso "gps" que viene con el MTA ), creo que lo creo arc_.
-
Eso lo unico que impide es que aparezcan dentro del area.
-
function createKills ( scrollPane, theTable ) local stuffCount = 1 local kill = { } table.sort ( theTable, function ( a, b ) return ( tonumber ( a.kills ) or 0 ) > ( tonumber ( b.kills ) or 0 ) end ) for _, v in ipairs ( theTable ) do local label = guiCreateLabel ( 0, ( stuffCount * 19 ), 287, 17, tostring ( v [ "name" ] ) .." - ".. tostring ( v [ "kills" ] ), false, scrollPane ) guiSetFont ( label, "default-bold-small" ) table.insert ( kill, label ) stuffCount = ( stuffCount + 1 ) end return kill end
-
A que te referis con transparente? que no aparezca en el mapa?
-
Porque moririan los jugadores si es una zona anti zombis?
-
Yeah, my mistake.
-
triggerClientEvent ( root, "howManyBags", root, "BagNum", "There are now "..totalBags.." bags available around the city") Add that after givePlayerMoney.
-
local sm = {} sm.moov = 0 sm.object1, sm.object2 = nil, nil function removeCamHandler ( ) if ( sm.moov == 1 ) then sm.moov = 0 removeEventHandler ( "onClientPreRender", getRootElement(), camRender ) end end function camRender () local x1, y1, z1 = getElementPosition ( sm.object1 ) local x2, y2, z2 = getElementPosition ( sm.object2 ) setCameraMatrix ( x1, y1, z1, x2, y2, z2 ) end function smoothMoveCamera ( x1, y1, z1, x1t, y1t, z1t, x2, y2, z2, x2t, y2t, z2t, time ) if(sm.moov == 1) then return false end sm.object1 = createObject ( 1337, x1, y1, z1 ) sm.object2 = createObject ( 1337, x1t, y1t, z1t ) setElementAlpha ( sm.object1, 0 ) setElementAlpha ( sm.object2, 0 ) setObjectScale(sm.object1, 0.01) setObjectScale(sm.object2, 0.01) moveObject ( sm.object1, time, x2, y2, z2, 0, 0, 0, "InOutQuad" ) moveObject ( sm.object2, time, x2t, y2t, z2t, 0, 0, 0, "InOutQuad" ) addEventHandler ( "onClientPreRender", getRootElement(), camRender ) sm.moov = 1 sm.timer1 = setTimer ( removeCamHandler, time, 1 ) sm.timer2 = setTimer ( destroyElement, time, 1, sm.object1 ) sm.timer3 = setTimer ( destroyElement, time, 1, sm.object2 ) return true end addEventHandler ( "onClientResourceStart", root, function ( ) smoothMoveCamera ( 2317.369140625, 687.4677734375, 59.040821075439, 2407.83984375, 569.1337890625, 40.787521362305, 2227.458984375, 598.650390625, 29.868627548218, 2298.16015625, 572.3984375, 28.285842895508, 5000 ) end ) addEvent ( "stopCamera", true ) addEventHandler ( "stopCamera", root, function ( ) removeCamHandler ( ) if isElement ( sm.object1 ) then destroyElement ( sm.object1 ) end if isElement ( sm.object2 ) then destroyElement ( sm.object2 ) end if isTimer ( sm.timer1 ) then killTimer ( sm.timer1 ) end if isTimer ( sm.timer2 ) then killTimer ( sm.timer2 ) end if isTimer ( sm.timer3 ) then killTimer ( sm.timer3 ) end sm = { } end )
-
You must sort it. You can use table.sort.
-
You must trigger it everytime a bag is picked up.
-
You're welcome.
-
Replace the client-side function "removeCamHandler" with this one: function removeCamHandler ( ) if ( sm.moov == 1 ) then sm.moov = 0 removeEventHandler ( "onClientPreRender", getRootElement(), camRender ) end end addEvent ( "stopCamera", true ) addEventHandler ( "stopCamera", root, removeCamHandler ) And add this server-side: addEventHandler ( "onPlayerLogin", root, function ( ) triggerClientEvent ( source, "stopCamera", source ) end )
-
function showBagNums (source) -- Remove 'source'.
-
local messages = { { "*Info* Staff can be found with infront of their name", 255, 255, 255 }, { "*Rule* Speak english in main chat! Use local chat, team chat or group chat for other languages!", 255, 255, 255 }, { "*Info* This server need YOU to donate! Read more about donation in F1 panel.", 255, 255, 255 }, { "*Info* You can start music by type /soundon, then stop it by type /soundoff", 255, 255, 255 }, { "*Info* If we can get 40 players online at the same time then everyone will be able to use vip for 6days!", 255, 255, 255 } } function sendMessages ( ) outputTopChat ( unpack ( messages [ math.random ( #messages ) ] ) ) end setTimer ( sendMessages, ( 1000 * 40 ), 0 )
-
guiCreateScrollPane getElementsByType isElementOnScreen guiCreateLabel
-
Because "onPlayerJoin" is server-side only, use "onClientResourceStart".
-
Post the code you used.
-
local pbags = { {2028.2314453125, 648.09765625, 11.366704940796}, {2340.6474609375, 750.9208984375, 11.218271255493}, {1632.525390625, 1035.7626953125, 13.769004821777}, {1494.2626953125, 751.025390625, 29.161626815796}, {1454.25, 751.05859375, 32.736267089844}, {1533.3515625, 751.1181640625, 32.64266204834}, {1427.3037109375, 1462.958984375, 10.8203125} } local bags = { } local gotBag = { } local totalBags = #pbags addEventHandler ( "onResourceStart", resourceRoot, function ( ) for _, i in ipairs ( pbags ) do local baga = createPickup(i[1], i[2], i[3], 3, 1210 ) local bagb = createObject ( 1210, 0, 0, 0 ) addEventHandler ( "onPickupHit", baga, onPickupHit ) bags [ baga ] = bagb end end ) function onPickupHit ( player ) if ( not isPedInVehicle ( player ) and not isPedDead ( player ) and not gotBag [ player ] ) then exports.bone_attach:attachElementToBone ( bags [ source ], player, 12, 0, 0.1, 0.3, 0, 180, 0 ) gotBag [ player ] = bags [ source ] destroyElement ( source ) totalBags = ( totalBags - 1 ) end end function onBtnClick ( ) if ( gotBag [ source ] ) then local money = math.random ( 1000, 2000 ) givePlayerMoney ( source, money ) destroyElement ( gotBag [ source ] ) triggerClientEvent ( source, "WarningText", source, "reward", "You have rewarded and got ".. money .. "$ from the dealer!! Good Job Pro!" ) outputChatBox ( "you have Rewarded and got ".. money .."$ from the dealer...You are PRO!! Good JOB!", source, 0, 255, 0, false ) triggerClientEvent ( source,"winSound", source ) gotBag [ source ] = nil else triggerClientEvent ( source, "WarningText", source, "reward", "You have to get the briefcase of weapons First!" ) end end addEvent ( "reward", true ) addEventHandler ( "reward", root, onBtnClick ) function onPlayerQuit ( ) if ( gotBag [ source ] ) then destroyElement ( gotBag [ source ] ) local x, y, z = getElementPosition ( source ) local baga = createPickup ( x, y, z, 3, 1210 ) local bagb = createObject ( 1210, 0, 0, 0 ) addEventHandler ( "onPickupHit", baga, onPickupHit ) bags [ baga ] = bagb gotBag [ source ] = nil totalBags = ( totalBags + 1 ) end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit ) Then you can use the variable "totalBags" to know how much bags are left.
-
You can't export the functions as they're right now, if you want to do that, you'll have to create functions which will call the current ones.
-
CODE 1: DON'T TOUCH ANYTHING ON IT. local sm = {} sm.moov = 0 sm.object1, sm.object2 = nil, nil function removeCamHandler () if(sm.moov == 1) then sm.moov = 0 removeEventHandler ( "onClientPreRender", getRootElement(), camRender ) end end function camRender () local x1, y1, z1 = getElementPosition ( sm.object1 ) local x2, y2, z2 = getElementPosition ( sm.object2 ) setCameraMatrix ( x1, y1, z1, x2, y2, z2 ) end function smoothMoveCamera ( x1, y1, z1, x1t, y1t, z1t, x2, y2, z2, x2t, y2t, z2t, time ) if(sm.moov == 1) then return false end sm.object1 = createObject ( 1337, x1, y1, z1 ) sm.object2 = createObject ( 1337, x1t, y1t, z1t ) setElementAlpha ( sm.object1, 0 ) setElementAlpha ( sm.object2, 0 ) setObjectScale(sm.object1, 0.01) setObjectScale(sm.object2, 0.01) moveObject ( sm.object1, time, x2, y2, z2, 0, 0, 0, "InOutQuad" ) moveObject ( sm.object2, time, x2t, y2t, z2t, 0, 0, 0, "InOutQuad" ) addEventHandler ( "onClientPreRender", getRootElement(), camRender ) sm.moov = 1 setTimer ( removeCamHandler, time, 1 ) setTimer ( destroyElement, time, 1, sm.object1 ) setTimer ( destroyElement, time, 1, sm.object2 ) return true end CODE 2: GOES ALONG WITH THE OTHER CODE, BUT NOT MIXED. addCommandHandler ( "camera", function ( ) smoothMoveCamera ( 2317.369140625, 687.4677734375, 59.040821075439, 2407.83984375, 569.1337890625, 40.787521362305, 2227.458984375, 598.650390625, 29.868627548218, 2298.16015625, 572.3984375, 28.285842895508, 5000 ) end )
-
Post your current script ( whole script ).