Jump to content

[REQ]Take money


Launo112

Recommended Posts

Hi, my english is very bad, but i try to explain what i need.

When player presses to the button called "save" then it's gonna take automatically $2500, how can i do that?

At the moment it's such

GUIEditor_Button[11] = guiCreateButton(144,60,41,16,"Save",false,GUIEditor_Tab[6]) 
GUIEditor_Button[12] = guiCreateButton(145,133,41,16,"Save",false,GUIEditor_Tab[6]) 

I know my english sucks... :/

Link to comment

we are not fullfilling requests here, remember that.

you need to learn a lot about scripting i think, because only thing you have is the generated gui i see..

you will need:

addEventHandler

onClientGUIClick

triggerServerEvent

and on server side:

addEvent

addEventHandler

takePlayerMoney

use wiki - https://wiki.multitheftauto.com/ - and its search feature to know more. there is example within every page. also check scripting tutorial if you are new to lua: https://wiki.multitheftauto.com/wiki/Scr ... troduction

And i have seen many users with much worse English than yours :P

Link to comment

you need server-side

like this

addEvent("onsave", true) 
addEventHandler("onsave", getRootElement(), 
function() 
      if ( getPlayerMoney (source) >= 2500 ) then 
        takePlayerMoney(source, 2500) 
        outputChatBox(............................", getRootElement(),0,255,0) 
      else 
    outputChatBox ("You not have enough Money!", source, 255, 0, 0, false) 
    end 
  end 
) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...