Jump to content

luskanek

Members
  • Posts

    37
  • Joined

  • Last visited

About luskanek

  • Birthday August 4

Details

  • Location
    Slovakia

luskanek's Achievements

Rat

Rat (9/54)

0

Reputation

  1. -- This piece of code in located in the 'onPlayerQuit' event handler. It saves the player's weapons and ammo if he has any, this is all working correctly local weapons = {} for slot = 1, 12 do local weapon = getPedWeapon(source, slot) if weapon > 0 then local ammo = getPedTotalAmmo(source, slot) if ammo > 0 then table.insert(weapons, {weapon, ammo}) end end end -- This is what appears under the 'weapons' column in the player's account table entry [ [ [ 30, 176 ] ] ] -- Which means the player left the server and had an AK-47 with total 176 ammo left -- And this is the part which loads the SQL weapons data for weapon, ammo in ipairs(fromJSON(accountData.weapons)) do giveWeapon(player, tonumber(weapon), tonumber(ammo)) end -- The problem is, the player doesn't get the weapons he has saved, instead, he'll be given a brassknuckle everytime and the SQL entry is reset Any ideas why it is not working properly? I'm using SQLite not MySQL. The weapons are saved correctly, so it would seem that the problems stems in the loading part.
  2. luskanek

    Fixed

    *boop* got a new problem with my script for i, colshape in ipairs(getElementsByType("colshape")) do if isElementWithinColShape(player, colshape) then for o, object in ipairs(getElementsByType("object")) do if isElementWithinColShape(object, colshape) then for _, object in ipairs(getElementsByType("object")) do GUIEditor.row[1] = guiGridListAddRow(GUIEditor.gridlist[1]) guiGridListSetItemText(GUIEditor.gridlist[1], GUIEditor.row[1], column, getElementModel(object), false, false) end end end end end Hey guys I got a problem with my function. I have 3 objects within a colshape and I want their model IDs to be added to a gridlist GUI. The problem is, there are 3 objects, but about 15 rows get added to the gridlist with duplicated IDs. The rows should look like this: 1 2 3 But what happens is: 1 2 3 3 3 1 2 3 3 3 and this goes on until it loops 3 times. How do I fix it?
  3. luskanek

    Fixed

    Nevermind fixed it
  4. The way it works is, that you post a script here and we fix it for you. You can ask someone to make a script for money.
  5. It is not that easy to detect if someone has been killed by a hydra, hunter or any rocket at all. It is doable but requires advanced knowledge of the language. You should focus on something easier first and try it later, when you learn more advanced things.
  6. Whoops, was in a hurry and forgot about that one, fixed. Thanks for pointing it out!
  7. lv = createColRectangle(901.67871, 601.66272, 2050, 2400) theTeam = createTeam("Criminal") addEventHandler("onColShapeLeave", getRootElement(), function(hitElement) if getElementType(hitElement) == 'player' then if source == lv then setPlayerTeam(hitElement, anotherTeam) end end end )
  8. luskanek

    Help

    Well ofcourse someone else should kill you in order for the message to appear. Are you killed by an another player or not?
  9. Whoops, my bad, sorry! Try this: lv = createColRectangle(901.67871, 601.66272, 2050, 2400) theTeam = createTeam("Gangsters") addEventHandler("onColShapeHit", getRootElement(), function(hitElement) -- forgot hitElement if getElementType(hitElement) == 'player' then if source == lv then outputChatBox("test") setPlayerTeam(hitElement, theTeam) end end end )
  10. luskanek

    Help

    function player_Wasted(_, attacker) if attacker then if getElementType(attacker) == "player" then outputChatBox(getPlayerName(attacker).. " killed " ..getPlayerName(source),getRootElement(),255,255,255) end end end addEventHandler ( "onPlayerWasted", getRootElement(), player_Wasted )
  11. lv = createColRectangle(901.67871, 601.66272, 2050, 2400) theTeam = createTeam("Gangsters") addEventHandler("onColShapeHit", getRootElement(), function() if getElementType(hitElement) == 'player' then if source == lv then outputChatBox("test") setPlayerTeam(hitElement, theTeam) end end end )
  12. addEventHandler("onResourceStart", getRootElement(), handl) function handl() for _, v in ipairs(getElementsByType("vehicle")) do if getElementModel(v) == 601 then setVehicleHandling(v, "mass", 15000.0) setVehicleHandling(v, "turnMass", 15000) setVehicleHandling(v, "maxVelocity", 70.0) setVehicleHandling(v, "engineAcceleration", 5.0 ) setVehicleHandling(v, "engineInertia", 25.0) setVehicleHandling(v, "steeringLock", 25.0 ) setVehicleHandling(v, "seatOffsetDistance", 1.0) end end end No need to make another topic if you already have one.
  13. addEventHandler("onResourceStart", getRootElement(), function() setModelHandling(601, "mass", 15000.0) setModelHandling(601, "turnMass", 15000) setModelHandling(601, "maxVelocity", 70.0) setModelHandling(601, "engineAcceleration", 5.0 ) setModelHandling(601, "engineInertia", 25.0) setModelHandling(601, "steeringLock", 25.0 ) setModelHandling(601, "seatOffsetDistance", 1.0) end ) Use this instead, it's alot better.
  14. Well just use the variables in dxDrawText and you're good to go
×
×
  • Create New...