Best-Killer Posted January 8, 2016 Share Posted January 8, 2016 i need example to make ATM's , Lottery Link to comment
Captain Cody Posted January 8, 2016 Share Posted January 8, 2016 Atms --- Store money in table, assigned to players serial, for deposits, add money to the table,take player the money if he has sufficient amount and for withdraws, take money from table, give it to player. ---------- Lottery -- Store people who bought tickets in a table, use same table just add the player to it if he buys a ticket, make a timer repeat every said minutes, and make it randomly select a name, with a random amount of money, or static amount. Link to comment
Best-Killer Posted January 8, 2016 Author Share Posted January 8, 2016 example wiki wiki what i need to use for that things after making gui Link to comment
starksZ Posted January 8, 2016 Share Posted January 8, 2016 You need good scripting skills to create that script, the wiki dont have this example. Link to comment
Best-Killer Posted January 8, 2016 Author Share Posted January 8, 2016 ok guys pls how to make peds table ? i mean like : local peds = { createPed(14, 1536.6, -1663.82, 13.55,260) createPed(14, 1536.6, -1663.82, 13.55,260) } i tried with that but not working any one can tell me ? Link to comment
' A F . Posted January 8, 2016 Share Posted January 8, 2016 local Peds = { -- id skin , x,y,z , Rotation {14,1536.6, -1663.82, 13.55,260}, {14,1536.6, -1663.82, 13.55,260}, } for _,v in ipairs ( Peds ) do createPed(v[1],v[2],v[3],v[4],v[5]) end this is you want ? Link to comment
Best-Killer Posted January 8, 2016 Author Share Posted January 8, 2016 local Peds = { -- id skin , x,y,z , Rotation {14,1536.6, -1663.82, 13.55,260}, {14,1536.6, -1663.82, 13.55,260}, } for _,v in ipairs ( Peds ) do createPed(v[1],v[2],v[3],v[4],v[5]) end this is you want ? thanks but local Peds = { -- id skin , x,y,z , Rotation {14,1536.6, -1663.82, 13.55,260}, {14,1536.6, -1663.82, 13.55,260}, } for _,v in ipairs ( Peds ) do createPed(v[1],v[2],v[3],v[4],v[5]) end function onPedClick(button, state, absX, absY, wx, wy, wz, element) if (element and getElementType(element) == "ped" and state=="down") then local x, y, z = getElementPosition(localPlayer) if (element == Peds) then if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz)<=3 then guiSetVisible(GUIEditor.window[1], true) showCursor (true) end end end end addEventHandler("onClientClick", root, onPedClick) when i click on the peds gui not showing Link to comment
' A F . Posted January 8, 2016 Share Posted January 8, 2016 test this local Peds = { -- id skin , x,y,z , Rotation {14,1536.6, -1663.82, 13.55,260}, {14,1536.6, -1663.82, 13.55,260}, } for _,v in ipairs ( Peds ) do Ped = createPed(v[1],v[2],v[3],v[4],v[5]) end function onPedClick(button, state, absX, absY, wx, wy, wz, element) if (element and getElementType(element) == "ped" and state=="down") then local x, y, z = getElementPosition(localPlayer) if (element == Ped) then if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz)<=3 then guiSetVisible(GUIEditor.window[1], true) showCursor (true) end end end end addEventHandler("onClientClick", root, onPedClick) Link to comment
Best-Killer Posted January 8, 2016 Author Share Posted January 8, 2016 thanks work bro bro i have drug dev script and now when i add lottery peds when i click on ped when i'm not as criminal the drug dev outputchatbox showing pls tell me the problem code : local ped = createPed(29, 1602.55, -1489.33, 13.59,180) setElementFrozen ( ped, true ) function showwindowdr () local visibe = guiGetVisible(GUIEditor.window[1]) if visibe == false then showCursor(true) guiSetVisible(GUIEditor.window[1],true) end end addEvent( "showwindowdr", true ) addEventHandler ( "showwindowdr", getRootElement(), showwindowdr) function onPedClick(button, state, absX, absY, wx, wy, wz, element) if (element and getElementType(element) == "ped" and state=="down") then if getTeamName(getPlayerTeam(getLocalPlayer())) ~= "Criminals" then outputChatBox("Drug Delivery: You must be criminal.",255,0,0) return end local x, y, z = getElementPosition(localPlayer) if (element == ped) then if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz)<=3 then guiSetVisible(GUIEditor.window[1], true) showCursor (true) end end end end addEventHandler("onClientClick", root, onPedClick) Link to comment
' A F . Posted January 8, 2016 Share Posted January 8, 2016 (edited) you are welcome test this function onPedClick(button, state, absX, absY, wx, wy, wz, element) if (element and getElementType(element) == "ped" and state=="down") then if ( getPlayerTeam ( localPlayer ) and getTeamName ( getPlayerTeam ( localPlayer ) ) == getTeamFromName('Criminals') ) then return outputChatBox("Drug Delivery: You must be criminal.",255,0,0) end local x, y, z = getElementPosition(localPlayer) if (element == ped) then if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz)<=3 then guiSetVisible(GUIEditor.window[1], true) showCursor (true) end end end end addEventHandler("onClientClick", root, onPedClick) Edited January 8, 2016 by Guest Link to comment
Best-Killer Posted January 8, 2016 Author Share Posted January 8, 2016 you are welcome test this function onPedClick(button, state, absX, absY, wx, wy, wz, element) if (element and getElementType(element) == "ped" and state=="down") then if ( getPlayerTeam ( localPlayer ) and getTeamName ( getPlayerTeam ( localPlayer ) ) ~= getTeamFromName('Criminals') ) then return outputChatBox("Drug Delivery: You must be criminal.",255,0,0) end local x, y, z = getElementPosition(localPlayer) if (element == ped) then if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz)<=3 then guiSetVisible(GUIEditor.window[1], true) showCursor (true) end end end end addEventHandler("onClientClick", root, onPedClick) same problem Link to comment
' A F . Posted January 8, 2016 Share Posted January 8, 2016 i edited code you can test new code Link to comment
Best-Killer Posted January 8, 2016 Author Share Posted January 8, 2016 i did other one pls check it gui not showing local locs = { { 1072.6, -1385.51, 13.88, 139 } } local peds = { } for i, v in ipairs ( locs ) do local x, y, z, rot = unpack ( v ) peds[i] = createPed ( 57, x, y, z, rot ) exports.SAEGJobs:create3DText ( "Lottery", { x, y, z }, { 255, 255, 0 }, nil, { } ) setElementFrozen ( peds[i], true ) addEventHandler ( "onClientPedDamage", peds[i], cancelEvent ) end function onPedClick(button, state, absX, absY, wx, wy, wz, element) if (element and getElementType(element) == "ped" and state=="down") then local x, y, z = getElementPosition(localPlayer) if (element == peds[i]) then if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz)<=3 then guiSetVisible(GUIEditor.window[1], true) showCursor (true) end end end end addEventHandler("onClientClick", root, onPedClick) Link to comment
luskanek Posted January 8, 2016 Share Posted January 8, 2016 Does debugscript 3 show any errors? Link to comment
Best-Killer Posted January 8, 2016 Author Share Posted January 8, 2016 000 errors nothing showing Link to comment
luskanek Posted January 8, 2016 Share Posted January 8, 2016 local locs = { { 1072.6, -1385.51, 13.88, 139 } } local peds = { } for i, v in ipairs ( locs ) do local x, y, z, rot = unpack ( v ) peds[i] = createPed ( 57, x, y, z, rot ) exports.SAEGJobs:create3DText ( "Lottery", { x, y, z }, { 255, 255, 0 }, nil, { } ) setElementFrozen ( peds[i], true ) addEventHandler ( "onClientPedDamage", peds[i], cancelEvent ) end function onPedClick(button, state, absX, absY, wx, wy, wz, element) if (element and getElementType(element) == "ped" and state=="down") then local x, y, z = getElementPosition(localPlayer) wx, wy, wz = getElementPosition(element) if (element == peds[i]) then if getDistanceBetweenPoints3D(x, y, z, wx, wy, wz) < 5 then guiSetVisible(GUIEditor.window[1], true) showCursor (true) end end end end addEventHandler("onClientClick", root, onPedClick) Link to comment
Best-Killer Posted January 8, 2016 Author Share Posted January 8, 2016 same problem nothing showing debug 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