Jump to content

Can you help in my script? :|


bencskrisz

Recommended Posts

local marker = createMarker(2167.1208496094,-1672.4111328125,13.075506210327,"cylinder", 1.5, 139, 0, 285,77)
local Blip = createBlipAttachedTo(marker,31)
function myCommandHandler(thePlayer)
     if isElementWithinMarker(thePlayer, marker) then
takePlayerMoney( thePlayer, 35000 )
outputChatBox('Gratulálok az új lakásához! A Lakás kulcsai mostantól az Öné! (IK: /086372)',player,60,238,7)

end
end
addCommandHandler('lakasvetel1',myCommandHandler)

 

So with this if I'm in the marker and type the command it gonna take the money from me and gonna get the output message. It obviously works. But I want a part in this script that does not allow you (with an outputchatbox text) to take the money from you when entering the command when you dont have sufficient money. Cause currently it just goes to minus, I mean my money even if I dont have sufficient money..

Link to comment
  • Moderators

https://wiki.multitheftauto.com/wiki/GetPlayerMoney

 

local marker = createMarker(2167.1208496094,-1672.4111328125,13.075506210327,"cylinder", 1.5, 139, 0, 285,77)
local Blip = createBlipAttachedTo(marker,31)

function myCommandHandler(thePlayer)
    if isElementWithinMarker(thePlayer, marker) then
    	if getPlayerMoney(thePlayer) >= 35000 then
            takePlayerMoney( thePlayer, 35000 )
            outputChatBox('Gratulálok az új lakásához! A Lakás kulcsai mostantól az Öné! (IK: /086372)',thePlayer,60,238,7)
        else
            outputChatBox("Nincs elég pénzed!", thePlayer, 255, 0, 0)
        end
    end
end
addCommandHandler('lakasvetel1',myCommandHandler)

 

And one more thing, read this before your next post in this topic

 

Link to comment
  • Moderators
12 minutes ago, bencskrisz said:

Okay okay got it, wont post anything like this one more time.. Thank you for ur script but for some reason nothing happens when im in the marker and I write the command :/ Why?? Script looks perfect tho

The marker maybe too small or too low in the ground.

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...