Jump to content

What is the diference of; type"server/client" in a resource?


HITMANzz

Recommended Posts

Do you ment that a client side script cause no server lagg?

Client side scripts will use the player's resources (because they're run on their comp) which does makes the server's job easier in some cases. Will that cause 'no server lag'? I'm not entirely sure what you mean but that mostly depends on how well scripts are written, of course they can make you 'lag' if they're heavy.

And Will Clientside scripts get visible to all players?

Client side scripts get downloaded to all clients, you can't communicate with other clients directly though, you will need the server for that. That's why changes made client side are usually only visible to that player.

Link to comment
ok, i thought that client was only visible for my and server for all. But ok. So replaced cars and characters on client will be visible for all ;)

THANKS!! :D

Uhrm not really.. Changes made client side are only visible for the client (with very few exceptions), it's your job to sync those changes if you want all players to see them. A couple ways you can do this is by triggering a client side event from the server for all players or by doing those changes onClientResourceStart. In some cases however you don't want to share the info between players (for example displaying your stats on the screen).

NOTE: If you want all players to see the changes you make, it's probably more advised to stick with server side scripts (where possible) as you won't need to bother with the syncronization at all.

Link to comment

Choosing client/server (in those cases where it really is optional) is a matter of security vs. reliability and bandwidth. Server scripts stay on the server (durr) and so the client has no way to see it, change it or modify it. Client scripts are sent to each connecting client which, if they know where to look, they can see them in clear text. (Whatever rudimentary protection you can get is piss poor, but that's another issue.)

In addition, client-side scripts by themselves only work on their own game on their own computer. That's essentially the clue here. You can't replace one client's models from another client's script, that'd be insane. In the case of setting weather, time, etc., those functions interact directly with the client game. In the case of replacing models, they usually apply to all clients. Why, you ask? Because even though the individual script only works on one game each, they are still sent to all connecting players and therefore, they will work for everybody. (Assuming the script doesn't have its own system for deciding this.)

Client functions require little or no interaction with the server. So, by making things client-side you will get faster execution and less bandwidth usage. The tradeoff is that people can see the script (if they have the knowledge and will) and they'll have to download more when connecting. In the case of script files this added size is usually negligible.

Link to comment

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