Jump to content

Why the hell it doesn't work?


Chlorek

Recommended Posts

Posted

Hi again.

I am scripting something to mta community but I met problems again :evil: So I have:

function omgmode() 
    local kierowca = getLocalPlayer() 
    local siedzenie = getPedOccupiedVehicleSeat(kierowca) 
    if(getPlayerMoney(kierowca) >= 15000)then 
        if(getPedOccupiedVehicle(kierowca))then 
            if(tonumber(siedzenie) == 0)then 
                triggerServerEvent ("omgModeEvent", getLocalPlayer(), kierowca) 
            else 
                outputChatBox("You must be a driver!", kierowca, 255, 0, 0) 
            end 
        else 
            outputChatBox("You must be in a vehicle!", kierowca, 255, 0, 0) 
        end 
    else 
        outputChatBox("You need 15000$ to buy an OMG-Mode!", kierowca, 255, 0, 0) 
    end 
end 
addCommandHandler ( "omg", omgmode) 
  

So, in this function is triggeing server event and it doesn't work. But problem isn't at server side... it's in this function bcuz triggerServerEvent is not started. Why? I don't get any errors in the console and no texts on the chat? Please help... I am makin this shi.t 2 hours -,- Thanks for help!

Posted

Do /debugscript 3 when scripting

Then you will notice that getPedOccupiedVehicleSeat is server side only (it doesn't work client side) if you had debugscript on then you will see an error.

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