[Suggestion] Client-side scripts - Printable Version + open.mp forum (https://forum.open.mp) -- Forum: open.mp (https://forum.open.mp/forumdisplay.php?fid=40) --- Forum: Questions and Suggestions (https://forum.open.mp/forumdisplay.php?fid=42) --- Thread: [Suggestion] Client-side scripts (/showthread.php?tid=2468) |
Client-side scripts - Username - 2023-10-12 Hi, it would be good if there were client-side scripts that servers could load and unload into the players' clients, which would allow scripters to control things that cannot be controlled from a server only script. For example, you could make it so returning 0 in a callback in the client-side script prevented that event from happening, so for example returning 0 in OnPlayerTakeDamage would cancel the damage before it even happens. This way, imagine you want a server where players can fly Hydras because of their speed and aerobatic capabilities but you don't want their rockets to hurt players on foot: you could write a script for the client that returns 0 in OnPlayerTakeDamage if the player is hit by an explossion and the issuer is in a Hydra, and the receiver would take no damage from it. This is only one example of something that currently cannot be done from a server script (I already tried returning 0 in OnPlayerTakeDamage in the server script years ago and it didn't work) but I'm sure there would be many other examples of how good an addition this would be. RE: Client-side scripts - zBreno - 2023-10-12 https://github.com/BigETI/SAMPLauncherNET/issues https://github.com/Pycckue-Bnepeg/samp-cef/releases https://github.com/Hual/SA-MP-Plus |