Et-win Posted June 29, 2014 Posted June 29, 2014 I was wondering what the difference is between: triggerClientEvent(source, "OnStuff", getRootElement(), arguments...) and: triggerClientEvent(source, "OnStuff", source, arguments...) ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
xXMADEXx Posted June 29, 2014 Posted June 29, 2014 The 3rd argument is for the source. So, in the top code, the source on the client code will be getRootElement() and on the bottom code, the source on the client code will be whatever the source is on the server-side. https://wiki.multitheftauto.com/wiki/TriggerClientEvent The Ultimate Lua Tutorial! | MTA PHP SDK
codeluaeveryday Posted June 29, 2014 Posted June 29, 2014 No XxMadexX... You're stating the obvious. getRootElement() returns a lot of data and is not recommended to trigger the root element. Using source or something small is much better. Tutorials: => getOnlineAdmins() => [TUT] Better Join Country => [TUT] Updating admin countries => [TUT] Updating admin flags Server: K@N Zombies / Freeroam
Et-win Posted June 29, 2014 Author Posted June 29, 2014 So if I use the second one (Double source), then nothing important what has to happen will change in the function? ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
Max+ Posted June 29, 2014 Posted June 29, 2014 well, i think the first one , trigger for all players , and second one , for 1 player witch is source , just like if you want to play sound for the killer only , triggerClientEvent ( killer, 'PlaySound', killer ) - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
Et-win Posted June 29, 2014 Author Posted June 29, 2014 well, i think the first one , trigger for all players , and second one , for 1 player witch is source No, they are both for 1 person, because the 'sendTo' argument (Argument 1) is source. I'm just wondering what changes if I use source instead of getRootElement() on the third argument ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
aintaro Posted June 29, 2014 Posted June 29, 2014 well, i think the first one , trigger for all players , and second one , for 1 player witch is source No, they are both for 1 person, because the 'sendTo' argument (Argument 1) is source. I'm just wondering what changes if I use source instead of getRootElement() on the third argument triggerClientEvent First argument is the root (to all the player) by default, if you set this to for example : source, then you will specify a single player to this event, thats why you should always use the sendTo argument if you can. third paramater = The element that is the source of the event. root = all players on the server source = a specific player on the server None of us is as smart as all of us.
Max+ Posted June 30, 2014 Posted June 30, 2014 See, as i told you same as aintaro post , - New , Kill System - New, GameMode Intro - Leve / Exp System - New nametag showing style - New , Hud For Players - Skin Selection from SA-MP - Money System / Buy Weapons - Drop Weapons - New, Flood System - New , Group Assign - Gun license For Weapons - Random Rule System For Money
Et-win Posted June 30, 2014 Author Posted June 30, 2014 Well, I understood his explantion much better... Anyway, thanks all ~Scripts~ Clan War System V1.2.0 ~Maps~ [DM]Et-win - The Run [FUN]Et-win - Drift Rocket [FUN]Et-win - Drift Rocket // [DD]Et-win - Cross 3xC
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