Jump to content

triggerServerEvent in OOP


OrionTH1

Recommended Posts

Posted (edited)

My guess is it's because it's not really player related, unlike with triggerClientEvent you can specifically target a player (in the 1st parameter) that's why there's a oop method.

Also, you should avoid passing the local player by argument or source as the wiki states, you should use the global client variable on the serverside instead that will be available within every event handler.

Read the warning here: https://wiki.multitheftauto.com/wiki/TriggerServerEvent

Edited by Tails
Posted
Element.TriggerEvent = function ( self, sName, ... )
 return triggerServerEvent( sName, self, ... );
end;
localPlayer:TriggerEvent( "onPlayerCatchAdvertise", "goverment" );

Maybe it will work. 

Posted
11 hours ago, OrionTH1 said:

I don't understand, have or no a way to do a triggerServerEvent in OOP?

Just use triggerServerEvent. It's not player related that's why it's not a player method.

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