Jump to content

bandi94

Members
  • Posts

    1,037
  • Joined

  • Last visited

Everything posted by bandi94

  1. Well i think there is no source code for it , Most possible all inbuild function's are in dll format (c++). On the end setCameraTarget is working with , OnClientPreRender and setCameraMatrix .
  2. it kill's the player who is in that vehicle.
  3. try this. (Car's start burning around ~200HP , so i put 200 but you can make test's with bike's) It's server side function KillVehicleOwner() if getElementHealth(source) <= 200 and getVehicleType(source) == "BMX" then local thePlayer = getVehicleOccupant(source) killPed(thePlayer) end end addEventHandler("onVehicleDamage", getRootElement(), KillVehicleOwner)
  4. bandi94

    Timers

    Well both of them will work , now it's up to you if you wanna only draw it by text,number or you wanna show it to, with a progressbar. Also you can use: onClientElementDataChange
  5. for i , elements in pairs(getAttachedElements(player)) do if getElementType(elements) == "blip" then -- there is a blip attached to the player end end
  6. bandi94

    Timers

    It should work
  7. bandi94

    Timers

    Well the best option for server side would be , to create a table with 2 value's. table.name = getPlayerName(LogedPlayer) table.timer = setTimmer(.......) then on playerQuit , you can get his name =>> find him in the table =>> killTimer=>> table.remove But why not make it client side then you can use dxDraw/Gui ? Or make only a timmer , and loop trought all player's. Then you don't need to kill it.
  8. pfuu. thx mate. I made a whole function to keep ID's growing up one by one , when a simpel " ID INTEGER PRIMARY KEY AUTOINCREMENT," make's all the jobb
  9. THX. Well yah i added one more column with the ID. And using the ID when i am removing the row .
  10. I don't wanna update anything , i wanna delete only one of the row's (from the duplicates) and not all of them.
  11. Yah it's kinda new world for me I hit another problem : I am saving bank deposit's , every deposit has a time in witch it can't be withdrawed. Now when i deposit 2 time's (one after another) the same amount of money for same amount of day's , i will have a duplicated row : ( myname , 1000 , 5 ) ( myname , 1000 , 5 ) this is fine bk i wanna keep every deposit separately, But when it come's the time of withdraw , i need to delete the row , but here come's the problem both of the row's will be deleted bk there are the same , but i wanna delete only one of them. Is this possible or i need to insert one more column with the "deposit number (ID)" and use that for delete ?
  12. I need to select a row , from a table but with 3 conditions. Something like this executeSQLQuery("SELECT value,day FROM Bank WHERE account_name=? , value=?,day=? ", getAccountName(acc),value_d,day_d) But how i tought it's not working like this. It is possible to make this ?? Or i need to select them only from the AccountName and after with loop ,sort them after the received data/values ? EDIT: Ohh i just found out that i need to put "AND" , problem solved
  13. Ofc the "code literally does nothing" . You are using Y+0.04 with absolute system that mean very very litel. And with that timmer you will need 1.2 secound only to grow it 1px. @xXMADEXx 's code it's better bk it's faster but still +0.04 very low , with 60fps you will need +/- 0.25 s to move it 1 px so you will move it 4px/s
  14. ok , then it's time to learn SQLite
  15. My problem is that i need to save every deposit alone. Every deposit has a time in witch you cannot withdraw it . I used it like. table= {value=.... , day = ........ } if i use it like table={value,day} --without data name it will save some space right ?? Or for the best solution i should use 2 Table one holding the money , secound one holding day count . ? And before saving i will check the leght. (do you know witch is the limit ??).
  16. yah , after 5 deposit's after converting back the JSON , i got " in pars table got nil " pfffff.
  17. pffff . THX , now is working
  18. IDK why the hell is not working. So is about a bank system. Putting money in. local table_d = getAccountData(acc,"deposits") if not table_d then table_d = {} end local time = getRealTime() local day_c = getDayCount(time.year,time.month,time.monthday) table_d[#table_d+1] = {value = value_d , day = (day+day_c)} setAccountData(acc,"deposits",table_d) setAccountData(acc,"penz",money-value) triggerClientEvent(source,"upShowMsg",source,"Successfully deposited !") No error even the msg is showed(+ my money is taken). After sending the table to client. local table_d = getAccountData(acc,"deposits") if not table_d then outputChatBox("there is no table") table_d = {} end local time = getRealTime() local day_c = getDayCount(time.year,time.month,time.monthday) triggerClientEvent(source,"updateDepositTable",source,table_d,day_c) Where i get the outputChatBox , that there is no table .... thefuck. Both of them are server sided. Trigger'ed from client side whit getLocalPlayer() , putting it with button , sending table when window is opened(ofc after i put the money in i closed the window and re opened it)
  19. bandi94

    ejector seat

    EDIT: tested and working (it must be min + 100 on pZ to have time to open the Parachute , you will get the Parachute after you are deatached from the seat) function carEject(player) ocVeh = getPedOccupiedVehicle(player) if (ocVeh) then vehSeatNo = getPedOccupiedVehicleSeat(player) if vehSeatNo == 0 then removePedFromVehicle(player, ocVeh) pX, pY, pZ = getElementPosition(player) rX, rY, rZ = getElementRotation(player) ejectorSeat = createObject(1562, pX, pY, pZ, rX, rY, rZ) setElementAlpha(ejectorSeat, 0) -- make the seat invis. setElementCollisionsEnabled(ejectorSeat, false) -- make the seat untouchable so as to avoid crashes attachElements(player, ejectorSeat, 0, 0, 0, 0, 0, 0) giveWeapon(player, 46,1,true) moveObject(ejectorSeat, 5000, pX, pY, pZ + 100) setTimer(detachElements,5000,1,player,ejectorSeat) setTimer(destroyElement,5000,1,ejectorSeat) end end end addCommandHandler("e", carEject)
  20. bandi94

    ejector seat

    what's the problem ? debugscript error ?
  21. bandi94

    Table

    @tosfera well how dugasz1 say'd it's more better to use table with AccountData . xml file's are not the best solution to save such amount of data's.
  22. bandi94

    ejector seat

    Try this function carEject(source) ocVeh = getPedOccupiedVehicle(source) if (ocVeh) then vehSeatNo = getPedOccupiedVehicleSeat(source) if vehSeatNo == 0 then removePedFromVehicle(source, ocVeh) pX, pY, pZ = getElementPosition(source) rX, rY, rZ = getElementRotation(source) ejectorSeat = createObject(1562, pX, pY, pZ, rX, rY, rZ) setElementAlpha(ejectorSeat, 0) -- make the seat invis. setElementCollisionsEnabled(ejectorSeat, false) -- make the seat untouchable so as to avoid crashes attachElements(source, ejectorSeat, 0, 0, 0, 0, 0, 0) giveWeapon(source, 46) moveObject(ejectorSeat, 5000, pX, pY, pZ + 10) setTimer(detachElements,5500,1,source,ejectorSeat) setTimer(destroyElement,6000,1,ejectorSeat) end end end addCommandHandler("e", carEject)
  23. bandi94

    Table

    Well loop's are a solution. If not a txt generator made in (c/c++) is an another option (if you don't wanna use the loop's on every resource start.)
  24. Somthing like this .( Maybe i did something wrong , i never tryed to use Parent Element in EventHandler) group1 = createElement("carGroups1") local veh1 = createVehicle() local veh2 = createVehicle() setElementParent(veh1,groupe1) setElementParent(veh2,groupe1) function entered() outputChatBox("You are in a car from groupe1") end addEventHandler("onVehicleEnter",group1,entered)
×
×
  • Create New...