Jump to content

Jammie

Members
  • Posts

    51
  • Joined

  • Last visited

Everything posted by Jammie

  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..
  16. Alexander, it doens't work. Maybe we need both glasses of Hans anders I have this now but the same effect: function createMoney(mx,my,mz,level) local x1=(mx-2)+(math.random()*4) local y1=(my-2)+(math.random()*4) local x2=(mx-2)+(math.random()*4) local y2=(my-2)+(math.random()*4) local getPlayerMoney=math.floor(200*level^0.2) setElementData(createPickup(x1,y1,mz,3,1212),"amount",moneyamount) setElementData(createPickup(x2,y2,mz,3,1212),"amount",moneyamount) end And I have try this: function createMoney(mx,my,mz,level) local x1=(mx-2)+(math.random()*4) local y1=(my-2)+(math.random()*4) local x2=(mx-2)+(math.random()*4) local y2=(my-2)+(math.random()*4) local getPlayerMoney=math.floor(200*level^0.2) setElementData(createPickup(x1,y1,mz,3,1212),"amount",getPlayerMoney) setElementData(createPickup(x2,y2,mz,3,1212),"amount",getPlayerMoney) end But the same effect...
  17. Jammie

    Safe Marker

    I did something wrong yea... I am back in 20 minutes... (go to work). I will create a client one after my work over 20 minutes.
  18. Jammie

    Safe Marker

    Yea of course... I was go to home and I was thinking about toggle.. it "can't very stupid... -,- but I will add cancelEvent. I have add a CancelEvent. local myMarker = createMarker( -2596.6259765625, 579.3583984375, 15.626741409302, 'cylinder', 2.0, 255, 0, 0, 150 ) function safezone(attacker, weapon, bodypart) cancelEvent() end addEventHandler( "onMarkerHit", myMarker, MarkerHit ) addEventHandler("onClientPlayerDamage", getLocalPlayer(), safezone) function markerLeave( leaveElement, matchingDimension ) if getElementType( leaveElement ) == "player" then outputChatBox ( "* You Left The Safe Zone", getRootElement(), 255, 255, 0 ) end end addEventHandler( "onMarkerLeave", myMarker, markerLeave )
  19. Jammie

    Safe Marker

    I know about the toggle but maybe should this work? I am now at school and I can't create a bigger script... this I have fastly scripted.. ]local myMarker = createMarker( -2596.6259765625, 579.3583984375, 15.626741409302, 'cylinder', 2.0, 255, 0, 0, 150 ) function MarkerHit( hitElement, matchingDimension ) if getElementType( hitElement ) == "player" then outputChatBox( "* You Entered The Safe Zone", getRootElement(), 255, 255, 0 ) toggleControl ( thePlayer, "onClientPlayerDamage", false ) end end addEventHandler( "onMarkerHit", myMarker, MarkerHit ) function markerLeave( leaveElement, matchingDimension ) if getElementType( leaveElement ) == "player" then outputChatBox ( "* You Left The Safe Zone", getRootElement(), 255, 255, 0 ) toggleControl ( thePlayer, "onClientPlayerDamage", true ) end end addEventHandler( "onMarkerLeave", myMarker, markerLeave )
  20. Jammie

    Safe Marker

    varez hehe, ok but I dont want a complete script I want a god mode toggle.. Thanks Wojak, i take a look!
  21. Jammie

    Safe Marker

    Thanks Varez, can you enable godmode in that marker?
  22. Jammie

    Safe Marker

    Thanks Varez, can you enable godmode in that marker?
  23. Jammie

    Safe Marker

    Ok, thanks for you tips, I can modify that greenzone script to a marker script but how can you enable the god mode in the marker?
  24. Hey Alexander, do you know jim & wappie? about the script, I have try to fill in a value but nothing changed. local y2=(my-2)+(math.random()*4) local moneyamount=math.floor(200*level^0.2) setElementData(createPickup(x1,y1,mz,3,1212),"amount",moneyamount) Maybe 3,1212 or amount or (200*level^0.2) I think these 3 are the amount what you drop..
×
×
  • Create New...