-
Posts
21,935 -
Joined
-
Last visited
-
Days Won
6
Everything posted by Castillo
-
That doesn't make any sense.
-
That's where you're wrong, you must use the first script I posted, then you execute the function like I did on the second one.
-
You can copy the script and put it on the other resource.
-
You're kidding me? you didn't copy the script I posted.
-
You'll have to define a variable, then lower it when a pickup is taken.
-
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 end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit )
-
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 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 )
-
Why not? is there any debug output?
-
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 = { } 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 ) 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 ) baga = createPickup ( x, y, z, 3, 1210 ) gotBag [ source ] = nil end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit )
-
I think that he wants to hide the weapon itself. I doubt that's even possible.
-
Change 'source' to 'player'.
-
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 = { } 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 ) ) then exports.bone_attach:attachElementToBone ( bags [ source ], player, 12, 0, 0.1, 0.3, 0, 180, 0 ) gotBag [ player ] = bags [ source ] destroyElement ( source ) 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 ) 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 ) baga = createPickup ( x, y, z, 3, 1210 ) end end addEventHandler ( "onPlayerQuit", root, onPlayerQuit )
-
It's not possible.
-
Post your new code.
-
You could either get the players server side and then send them to the client side to add them to the grid list, or you could set element data on each player, which would be the ACL the player is part of.
-
Why are you attaching the pickup and then destroying it?
-
"race/textlib.lua".
-
Your code really doesn't make much sense, you are attaching the pickup, then destroying it, why?
-
And the problem is...?
-
Tried removing it manually with removeWorldModel?
-
You must edit the library used by the race resource to draw the texts, to enable the colorCoded argument which let's you use HEX colors.
-
Well, to begin with, you're using getElementData, but you're not defining it, which means you're getting it for nothing.
-
You can't get the serial stored there. You can create a SQLite table and store serials with the account names there when they register. executeSQLQuery
-
local sx, sy = guiGetScreenSize ( ) local resX, resY = 0, 0 -- Put the resolution used to draw it here. function Money ( ) dxDrawText ( "Money", ( 377 / resX ) * sx, ( 196 / resY ) * sy, 683, 246, tocolor(0, 0, 0, 255), 2.00, "pricedown", "center", "center", true, true, true, true, false ) end addEventHandler ( "onClientRender", root, Money ) Try it.