Posted By: NeoNeper
Sections for various scenarios in mulplayer. Can Help-me? - 06/07/12 20:00
I have many doubts about the "mulplayers" using sections.
I do not know where or when I use "session_open", and the "session_connect."
Do not know if any of them call on the server, or all of the client.
I've tried several different ways, but am not having success.
> In a "dataBase" I signed a few names that are references to scenarios which players can connect.
> Each of these names is amount to a "WMB"
> When a player enters, he can choose one of these scenarios in a list, and when selected this scenario "WMB" is loaded into it.
If another player to choose this same scenario, both will be connectados in the same scenario, and will be able to interact with each other.
My problem is just load these scenarios.
I saw in the documentation that using A8 Litec "seession_connect" and "session_open", I could connect the players in different scenarios, but there is no better example for full understanding.
All the ways I tried here were frustrated and so I come to ask help from the community.
Can Help-me?
I'll post my last attempt, so you can evaluate where I am wrong, and so can help me better!
In this example , he Connect the world and create my player, but does not perform the function of the player.
But my doubts persist as to whether this really is the correct way, I come to ask for your help.
I do not know where or when I use "session_open", and the "session_connect."
Do not know if any of them call on the server, or all of the client.
I've tried several different ways, but am not having success.
> In a "dataBase" I signed a few names that are references to scenarios which players can connect.
> Each of these names is amount to a "WMB"
> When a player enters, he can choose one of these scenarios in a list, and when selected this scenario "WMB" is loaded into it.
If another player to choose this same scenario, both will be connectados in the same scenario, and will be able to interact with each other.
My problem is just load these scenarios.
I saw in the documentation that using A8 Litec "seession_connect" and "session_open", I could connect the players in different scenarios, but there is no better example for full understanding.
All the ways I tried here were frustrated and so I come to ask help from the community.
Can Help-me?
I'll post my last attempt, so you can evaluate where I am wrong, and so can help me better!
Code:
function main(){
if (!connection)
{
str_cpy(messages_str, "Can't find any server. Please try again later.");
wait (-4);
sys_exit(NULL);
}
if (connection == 1) //Server
{
if (session_open("city_demo"))
{
level_load("ignia.wmb"); // load level anew
while (dplay_status < 8) wait(1);
dplay_localfunction = 2;
}
}
if (connection == 2) //Client Connection
{
if (session_connect("city_demo","localhost"))
{
dplay_localfunction = 2;
level_load("ignia.wmb"); // load level anew
while (dplay_status < 4) wait(1); // wait until the level state is received from the server
player = ent_create("warlock.mdl",vector(0,0,100),moveplayer);
wait(1);//wait util a function
while(!player){wait(1);}
ent_createlocal("target_ring.mdl",_vec(player.x,player.y,player.z),func_seletor);
camera.arc=90;
camera.x = player.x-50;
camera.y = player.y-50;
camera.z = player.z + 120;
camera.tilt = -27;
}
}
}
In this example , he Connect the world and create my player, but does not perform the function of the player.
But my doubts persist as to whether this really is the correct way, I come to ask for your help.