OrionTH1 Posted July 14, 2022 Posted July 14, 2022 I checked and i see that the triggerServerEvent don't have a method OOP but the triggerClientEvent have a method OOP. Someone know how a do um triggerServerEvent in MTA OOP, because i tried this in client-side but doesn't work. player:triggerEvent("warpToLastVehicle", root, localPlayer)
Vampire Posted July 14, 2022 Posted July 14, 2022 Hello @OrionTH1 I've moved your topic to the Scripting section so you can get better assistance.
Tails Posted July 15, 2022 Posted July 15, 2022 (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 July 15, 2022 by Tails
OrionTH1 Posted July 16, 2022 Author Posted July 16, 2022 I don't understand, have or no a way to do a triggerServerEvent in OOP?
XaskeL Posted July 16, 2022 Posted July 16, 2022 Element.TriggerEvent = function ( self, sName, ... ) return triggerServerEvent( sName, self, ... ); end; localPlayer:TriggerEvent( "onPlayerCatchAdvertise", "goverment" ); Maybe it will work.
Tails Posted July 16, 2022 Posted July 16, 2022 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.
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now