[Help Needed] Positions Spawn [Map Change]
#1

Hi , i have Map change system , the problem is whene Player X , connect to the server and he is in Round 2 , me Player Y whene i connect i be in Round 1 ! how to make the system check if the Players are in Round X and spawn me to this one ?
Reply
#2

When saying round, do you mean ROUND as MAP location?
Reply
#3

yes i mean Round or like "Map" so my Gamemod has Map Change system 2 round (2 maps )...
Reply
#4

You need to set a variable so once the there is a public which changes the current "MAP", it will store the number of the map in this variable. Then when a player joins to your server, you could check what is the current "MAP" and send him over there.
Reply
#5

i have this :
pawn Код:
forward NextMap(playerid,maps);
public NextMap(playerid,maps)
{
Cmaps++;
if(Cmaps>= maps) Cmaps=0;
switch(Cmaps)
{
    case 0:
    {
            if(gTeam[playerid] == TEAM_CT) SetPlayerPos(playerid,2533.8667,2753.3320,10.8203);
            if(gTeam[playerid] == TEAM_CT) SetPlayerFacingAngle(playerid,90.5278);
            if(gTeam[playerid] == TEAM_T) SetPlayerPos(playerid,2667.8340,2717.2986,10.8203);
            if(gTeam[playerid] == TEAM_T) SetPlayerFacingAngle(playerid,31.6018);
    }
    case 1:
    {
         if(gTeam[playerid] == TEAM_CT) SetPlayerPos(playerid,1801.1047,-2991.1992,6.1988);
         if(gTeam[playerid] == TEAM_CT) SetPlayerFacingAngle(playerid,183.9618);
         if(gTeam[playerid] == TEAM_T) SetPlayerPos(playerid,1846.0448,-3083.0525,6.6550);
         if(gTeam[playerid] == TEAM_T) SetPlayerFacingAngle(playerid,44.1783);
    }
}
}
Reply
#6

pawn Код:
new CurrentMap;

forward NextMap(playerid, maps);
public NextMap(playerid, maps) {
    Cmaps++;
    if(Cmaps >= maps) Cmaps = 0;
    switch(Cmaps) {
        case 0: {
            if(gTeam[playerid] == TEAM_CT) {
                SetPlayerPos(playerid,2533.8667,2753.3320,10.8203);
                SetPlayerFacingAngle(playerid,90.5278);
            } else if(gTeam[playerid] == TEAM_T) {
                SetPlayerPos(playerid,2667.8340,2717.2986,10.8203);
                SetPlayerFacingAngle(playerid,31.6018);
            }
            CurrentMap = 0;
        } case 1: {
            if(gTeam[playerid] == TEAM_CT) {
                SetPlayerPos(playerid,1801.1047,-2991.1992,6.1988);
                SetPlayerFacingAngle(playerid,183.9618);
            } else if(gTeam[playerid] == TEAM_T) {
                SetPlayerPos(playerid,1846.0448,-3083.0525,6.6550);
                SetPlayerFacingAngle(playerid,44.1783);
            }
            CurrentMap = 1;
        }
    }
}
Now, give me the code where it sets the player his position once he connects your server.
Reply
#7

ok i have this under onplayerlogin :
pawn Код:
MapTimer[playerid] = SetTimerEx("NextMap", 20000, true, "ii",playerid, 2);//as soon as the player logsin!
         //NOTE: see the "2" at the end that is for the maximum maps you have
         //these are positions of the first map
         if(gTeam[playerid] == TEAM_CT) SetPlayerPos(playerid,2533.8667,2753.3320,10.8203);
         if(gTeam[playerid] == TEAM_CT) SetPlayerFacingAngle(playerid,90.5278);
         if(gTeam[playerid] == TEAM_T) SetPlayerPos(playerid,2667.8340,2717.2986,10.8203);
         if(gTeam[playerid] == TEAM_T) SetPlayerFacingAngle(playerid,31.6018);
Reply
#8

I think you're wrong, 2 refers as MAP, not the maximum maps. What I mean is whenever someone logs in, he will automatically pointed to the second map, in that case, try changing "2" to "CurrentMap".
Reply
#9

i have changed :
pawn Код:
MapTimer[playerid] = SetTimerEx("NextMap", 20000, true, "ii",playerid, 2);
with :
pawn Код:
MapTimer[playerid] = SetTimerEx("NextMap", 20000, true, "ii",playerid, CurrentMap);
what else ? thanks
Reply
#10

Now, you should try it, until then I can't help you. You must try it first and tell me what it does now.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)