Jammie

Members
  • Content Count

    52
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Jammie

  • Rank
    Snitch

Details

  • Gang
    Greengang
  1. It's already fixed... This can be closed!
  2. This will not fix my problem!
  3. Hi People, I've got a problem about this save system for your weapons. I work with account data and the problem is that if you die then it saved your weapons and if you die and you type after die /logout then it saved your weapons too.. but without die and you type: /logout or /disconnect (quit) then you lost all your weapons... doesnt save!. And if you after die type: /disconnect then it will not save too!! This will be saved in accounts.xml. I hope someone knows the problem... thanks! local playerWeapons = createElement("playerWeapons") function resourceStart() local players = getElementsByType("player") for index, value in pairs(players) do local newElement = createElement("playerWeapons") setElementData(newElement, "player", value, false) setElementData(newElement, "weapons", {}, false) setElementParent(newElement, playerWeapons) end end addEventHandler("onResourceStart", getResourceRootElement(), resourceStart) function playerLogin(previousAcc, currentAcc) local weaponList = getElementChildren(playerWeapons) for index, value in pairs(weaponList) do if getElementData(value, "player", false) == source then local weapons = getElementData(value, "weapons", false) for count = 0, 11, 1 do local weapon, ammo = getAccountData(currentAcc, "weapon"..count), getAccountData(currentAcc, "ammo"..count) if weapon and ammo then weapons[count] = { [0] = weapon, [1] = ammo } giveWeapon(source, weapon, ammo) end end setElementData(value, "weapons", weapons, false) return end end end addEventHandler("onPlayerLogin", getRootElement(), playerLogin) function playerLogout(prevAccount) local weaponList = getElementChildren(playerWeapons) for index, value in pairs(weaponList) do if getElementData(value, "player", false) == source then local weapons = getElementData(value, "weapons", false) for count = 0, 11, 1 do if weapons[count] then setAccountData(prevAccount, "weapon"..count, weapons[count][0]) setAccountData(prevAccount, "ammo"..count, weapons[count][1]) setWeaponAmmo(source, weapons[count][0], getPedTotalAmmo(source, count) - weapons[count][1]) weapons[count][1] = getPedTotalAmmo(source, count) - weapons[count][1] end end end end end addEventHandler("onPlayerLogout", getRootElement(), playerLogout) function playerSpawn() local weaponList = getElementChildren(playerWeapons) for index, value in pairs(weaponList) do if getElementData(value, "player", false) == source then local weapons = getElementData(value, "weapons", false) for count = 0, 11, 1 do if weapons[count] then giveWeapon(source, weapons[count][0], weapons[count][1]) end end return end end end addEventHandler("onPlayerSpawn", getRootElement(), playerSpawn) function playerWasted() local weaponList = getElementChildren(playerWeapons) for index, value in pairs(weaponList) do if getElementData(value, "player", false) == source then local weapons = getElementData(value, "weapons", false) for count = 0, 11, 1 do weapons[count] = { [0] = getPedWeapon(source, count), [1] = getPedTotalAmmo(source, count) } end setElementData(value, "weapons", weapons, false) return end end end addEventHandler("onPlayerWasted", getRootElement(), playerWasted) function playerQuit(prevAccount) local weaponList = getElementChildren(playerWeapons) for index, value in pairs(weaponList) do if getElementData(value, "player", false) == source then local weapons = getElementData(value, "weapons", false) for count = 0, 11, 1 do if weapons[count] then setAccountData(prevAccount, "weapon"..count, weapons[count][0]) setAccountData(prevAccount, "ammo"..count, weapons[count][1]) setWeaponAmmo(source, weapons[count][0], getPedTotalAmmo(source, count) - weapons[count][1]) weapons[count][1] = getPedTotalAmmo(source, count) - weapons[count][1] end end end end end addEventHandler("onPlayerQuit", getRootElement(), playerQuit)
  4. if not ( isPedInVehicle ( hitPlayer ) ) then This warning in console: WARNING: houses.lua: Bad 'ped' pointer @ 'isPedInVehicle'<1> Line: 141...? Everytime I restart houses.lua then I'll see this line! whats the problem!?
  5. I have the same problem. they doesn't work, no errors. If I starting slrfuel then is nothing happening and cvehiclefuel works only if someone is tanking then is it to everybody.. and if you drive then it goes to 99 and back to 100.. for everyone
  6. Jammie

    House icon

    Its already done.. I have another house script and that works very well but thanks for you replies!
  7. Jammie

    House icon

    Good job, I will test it now! can you add the lock command too ?
  8. Jammie

    House icon

    Nope it doesn't work..
  9. Jammie

    House icon

    Its ok now, I have another house script. that works great!. kihc has little bugs and I hope they update their script! uhmm I hope you can help me with this!. I have made a screen of it. and the script I will put here: Script (cylinder), createMarker ( x, y, z, "cylinder", 2.0, 255, 255, 255, 255 ) Why is he fly in the air ?! SEE THE ATTACHMENT! [attachment=0]Naamloos2.png[/attachment]
  10. Jammie

    House icon

    That's right, because if you create a house then its the icon "green" because no owners. But if you buy a house then it stays the icon "green". And if i change the whole script to that blue icon "1272" and I delete "1273" (the green icon) then I've the same problem.. then it stays "blue". What I want is if you buy a house then it must be the icon "blue". Why did kihc not included that -,- I hope so you can help me with this. But it doesn't work if I change the id of the icon to blue... then you have only blue icons...
  11. Jammie

    House icon

    thanks! Yea, that should work but that "?" must be "none" ? see "buy" script. It's difficult because its not mine script..
  12. Jammie

    House icon

    I've found some lines of the house script, kihc does'nt have that script included. What I have found when you "buy" a house then he must change to "blue". House blue = "1272". This is when you create a house: function createHouseXX( x , y , z, ix, iy , iz , ii , cost , owner ) local pickup = createPickup( x , y , z, 3 ,1273 ) pickupCount = pickupCount + 1 houseElement = "house"..pickupCount id[ pickup ] = houseElement HouseOutX[ houseElement ] = x HouseOutY[ houseElement ] = y HouseOutZ[ houseElement ] = z HouseInX[ houseElement ] = ix HouseInY[ houseElement ] = iy HouseInZ[ houseElement ] = iz HouseInI[ houseElement ] = ii IsHousePickup[ houseElement ] = true if existData_kihc( houseElement ) then -- nothing else createData_kihc( houseElement ) saveData_kihc( houseElement , "owner" , owner ) saveData_kihc( houseElement , "cost" , cost ) saveData_kihc( houseElement , "rent" , "50" ) saveData_kihc( houseElement , "bank" , "0" ) end return houseElement end And this is when you buy a house and here you must add the lines that you change the icon color to blue: function houseSystem( player , arg1 , arg2 ) local sourceAccount = getClientAccount ( player ) if not isGuestAccount( sourceAccount ) then if PlayerInHouse[ player ] then if arg1 == "buy" then if getHouseOwner( PlayerInHouse[ player ] ) == "none" then if getPlayerMoney( player ) > getHouseCost( PlayerInHouse[ player ] ) then local name = getClientName( player ) setHouseOwner( PlayerInHouse[ player ] , name ) outputChatBox( "#00FF00 Congrats, now you are the owner of this house." , player , 255, 255, 255, true) outputChatBox( "#00FF00 [ #FF9900/Withdraw ] - ] #FF9900/Setrent ] - [ #FF9900/Sell ]" , player , 255, 255, 255, true) takePlayerMoney( player , getHouseCost( PlayerInHouse[ player ] )) PlayerBlip[ player ] = createBlip( HouseOutX[ PlayerInHouse[ player ] ] , HouseOutY[ PlayerInHouse[ player ] ] , HouseOutZ[ PlayerInHouse[ player ] ] , 35 , 2 , 0 , 0 , 0 , 0 , 0 , player ) else outputChatBox( "#00FF00 You dont have enough money." , player, 255, 255, 255, true ) end else outputChatBox( "#00FF00 The house is not for sale." , player ) end
  13. Jammie

    House icon

    Ok, thanks for reply I will reply after I have found the lines. Maybe is it already included...
  14. Jammie

    House icon

    Hi all, The house kihc script works great only if someone bought a house then it stays the color "green". Do somebody know how you can fix that... Because the good way is if someone bought a house then it must the right color "blue". I hope so!
  15. Thanks Alexander, I have put this script on the same place: server side but now he drops nothing anymore... its very strange..