Jump to content

bartje01

Members
  • Posts

    208
  • Joined

  • Last visited

Everything posted by bartje01

  1. alright. I'm going to try. I don't think I will succeed. I hope one of you can script it for me but I don't want to ask a to big question edit": found this somewhere. Doesn't work though function onPlayerQuit ( ) -- when a player leaves, store his current money amount in his account data local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playermoney = getPlayerMoney ( source ) setAccountData ( playeraccount, "savemoney.money", playermoney ) end end function onPlayerJoin ( ) -- when a player joins, retrieve his money amount from his account data and set it local playeraccount = getPlayerAccount ( source ) if ( playeraccount ) then local playermoney = getAccountData ( playeraccount, "savemoney.money" ) -- make sure there was actually a value saved under this key (check if playermoney is not false). -- this will for example not be the case when a player plays the gametype for the first time if ( playermoney ) then setPlayerMoney ( source, playermoney ) end end end addEventHandler ( "onPlayerQuit", getRootElement ( ), onPlayerQuit ) addEventHandler ( "onPlayerJoin", getRootElement ( ), onPlayerJoin )
  2. Can anyone give me a little explain/example about how I can save money to accounts with setAccountDate? Zango thanks for reply btw.
  3. Hey guys. I searched on wiki already on how to save money. I found something like ACL save but that is not what I need. I want to know how to save player's money when they relog. Can someone give me an example or wiki page that I need?| Thanks
  4. OMG IT WORKS> THANKYU!!!!!!
  5. Hey guys. I'm trying to make deagle kills with one bullet. It's not working addEventHandler ("onClientPedWeaponFire",getRootElement(), function(weap,ammo,_,_,_,_,player) if isElement (player) and(weapon == 24) and (getElementType (player) == "player") then setElementHealth (player,0) end end) addEventHandler ( "onClientPlayerWeaponFire", getLocalPlayer(), onClientPlayerWeaponFireFunc ) I don't know what's wrong. it just has no effect. Please help
  6. bartje01

    gui help

    Hey guys. I have a little problem at my gui. if (source == buyweapondeagle) then giveWeapon (getLocalPlayer(),24) outputChatBox ("You've bought a deagle!") end end addEventHandler ("onClientGUIClick",getRootElement(),guiClick) It only shows me the text but it's not giving me the deagle. HOw to fix? Yes this is client side.
  7. Hey guys. SOrry that I'm asking another question already. But I've searched Wiki and I already asked someone else buy he didn't come out either. if (source == buyweapondeagle) then givePlayerMoney ( getLocalPlayer (), -350 ) outputChatBox ("You've bought a deagle!") end end addEventHandler ("onClientGUIClick",getRootElement(),guiClick) The text: You've bought a deagle is working. But the money isn't working. I tried alot of things now. Please help
  8. Ye I am really sorry that I'm asking so many questions. But that is the way I learn the best. Tutorials have a low effect on me. Now I do understand that local didn't work. With that tutorial I shouldn't know that. Thanks very much.
  9. Now why doesn't this work? I want that when you click on the weaponx button the gui dissapears. addEventHandler ("onClientGUIClick",getRootElement(), function(button) if (source == buyweaponx) then guiSetVisible (buyweapon,false) showCursor (false,false) end end) No effect.
  10. No effect but no errors or warnings eitehr Without the buttons the menu will show up: function buyweapon(playerSource, commandName) local buyweapon = guiCreateWindow ( 0.3398, 0.2333, 0.3297, 0.6500, "Weapon Shop", true ) guiSetVisible ( buyweapon, true ) end addCommandHandler("buyweapons", buyweapon) But with the buttons nothing shows up
  11. This is my client.lua function buyweapon(playerSource, commandName) local buyweapon = guiCreateWindow ( 0.3398, 0.2333, 0.3297, 0.6500, "Weapon Shop", true ) local buyweapondeagle = guiCreateButton ( 0.2915, 0.0369, 0.4242, 0.0641, "Deagle", true, buyWeapon ) local buyweapontec-9 = guiCreateButton ( 0.2938, 0.1058, 0.4265, 0.0609, "Tec-9", true, buyWeapon ) guiSetVisible ( buyweapon, true ) end addCommandHandler("buyweapons", buyweapon)
  12. ERROR:freerpg/script/lua.133:attempt to call global 'guiCreateWindow' (a nil value)
  13. yours doesn't work either ?
  14. Hey guys. my gui is workign a bit now function buyweapon(playerSource, commandName) local buyweapon = guiCreateWindow ( 0.3398, 0.2333, 0.3297, 0.6500, "Weapon Shop", true ) local buyweapondeagle = guiCreateButton ( 0.2915, 0.0369, 0.4242, 0.0641, "Deagle", true ) local buyweapontec-9 = guiCreateButton ( 0.2938, 0.1058, 0.4265, 0.0609, "Tec-9", true ) guiSetVisible ( buyweapon, true ) guiSetVisible ( buyweapondeagle, true ) guiSetVisible ( buyweapontec-9, true ) end addCommandHandler("buyweapons", buyweapon) With only the guiSetVisible ( buyweapon, true ) it works But with the other two the gui won't show up anymore. Help please
  15. Hey guys. I have a marker and it shows a message. But I only want it to show it to the person that stands in the marker and not to everyone. local myMarker = createMarker( 1368.49, -1279.94, 13.54, 'cylinder', 2.0, 255, 0, 0, 150 ) function MarkerHit( hitElement, matchingDimension,player ) if getElementType( hitElement ) == "player" then outputChatBox ( "You have picked up a Nite Stick.", player ) end end addEventHandler( "onMarkerHit", myMarker, MarkerHit ) Ty
  16. So with reading the wiki time after time I can be a pro scripter?
  17. eh. He shows his problem. He probaly doesn't know what's wrong with the code so the link you gave won't help him
  18. But what when I want a gui menu shows up when someone steps in the marker?
  19. Thaknyou :D:D It works fine now I will also use the other things you told me like debugging. Thanks in regards. Btw. is it hard to make this things client side? SO I can use it with GUI
×
×
  • Create New...