Jump to content

event add to clientside


Dzsipszi

Recommended Posts

Posted

What is this?

ERROR: Server triggered clientside event 'showBuyCar', but event is not added clientside 

If the car don't have owner then showBuyCar.... but the buy panel don't pop up. Script:

function enterVehicle ( thePlayer, seat, jacked ) 
    local playercar = getPedOccupiedVehicle ( thePlayer ) 
    if ( seat == 0 ) then 
        if ( getElementData ( playercar, "owner" ) ~= "Nobody" ) then 
            if ( getElementData ( playercar, "owner" ) == getPlayerName ( thePlayer ) ) then 
                outputChatBox ( "(( Ennek a járműnek a tulajdonosa: "..getElementData ( playercar, "owner" )..". ))", source, 185, 86, 185 ) 
            else 
                if getVehicleEngineState ( playercar ) then 
                    setVehicleEngineState ( playercar, false ) 
                else 
                    setVehicleEngineState ( playercar, false ) 
                end 
            end  
        else 
            local price = getElementData ( playercar, "price" ) 
            triggerClientEvent ( thePlayer, "showBuyCar", source, price ) 
            toggleAllControls ( thePlayer, false, true, false ) 
            return true 
        end 
    end 
end 
  
addEventHandler ( "onVehicleEnter", getRootElement(), enterVehicle ) 

Posted
You want to trigger a client-sided event named "showBuyCar" (on line 16), but it's not added on client-side with addEvent.

Not really, he could simply have made the mistake of adding the server side script before the client side one in the 'meta.xml' file.

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