Ok I am confused again. if I do this:
Code:
player = ent_createlocal (str_model, vecto, setup_character);
player_ghost = ent_create (str_model, player.x, null);
player_ghost.invisible = on;
then later when I send_skill (player_ghost.x, send_vec);
it goes to the server. Now once the server gets the event, that triggers the on_server = function; correct?
this is my question. when that function is ran ( the on_server = function;)
I always frst start with ifdef server; just to be safe and everything. But I then want to check to see if the skill that was sent was a specific skill or not. ( making sure we are exicuting the correct code for the right skill that was sent) How do I do this?
what is actually sent to the server? player_ghost? or the vector of player ghost. when I am on the server end what do I use? a pointer? or my? or you? I am lost in this area. If anyone could point me in the right direction and also help me to understand what goes on, I would greatly appreciate it.
What I am trying to do btw is this:
when a new player connects to the server ( creating the player localy and also using the player_ghost pointer thing that Michael talked about in a different thread) and is actually now in the world. I want to += 1 to a variable that keeps track of the number of people.
so after I create the entity localy, and create the global entity, I want the Server to update the new number of players in the actual world ( not just connected to the server). But I am not sure what to use on the server side...my? you? what is it once you create the global entity..to the server what is it?
I know I talked about sending a skill, and at the end am talking about sending a variable...which uses send_var, but if I used a send_skill to send a skill, how does the server see the entity that just sent it's skill...the global entity....I don't "get it" yet...but am trying to understand it...thank you if you can help
also about the send_var. On the server how would I check to see if the variable that was sent was a specific variable? if (variable_recieved == this variable)?