please help
#1

I have a problem with this base system, when someone types /base when they get teleported they cant see anything

pawn Код:
COMMAND:base(playerid, params[])
{
    if(BaseOn == 0) return SendClientMessage(playerid, Red, "There is no base in progress, or the base has already started");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            SetPlayerInterior(i, 15);
            SetSpawnInfo(i, T_ATT, 46, 2221.2100,-1148.9974,1025.7969,3.0111, 24, 500, 31, 500, 34, 500);
            SetSpawnInfo(i, T_DEF, 46, 2193.1692,-1143.9407,1029.7969,180.0461, 24, 500, 31, 500, 34, 500);
            GivePlayerWeapon(i, 24, 500);
            GivePlayerWeapon(i, 31, 500);
            GivePlayerWeapon(i, 34, 500);
        }
    }
    return 1;
}
And I think the problem is T_ATT, T_DEF, because they dont spawn as those. They spawn with other ranks, but it should set their team to that, how can I do it?

I also wanna the spawns random, so its 50 chance to join ATT/DEF. It should change their team and give their weapon when they type /base, please help, I am gettign tired of this now -.-
Reply
#2

By "can't see anything" you mean your character fall from the sky or just see grayish stuff?.

It's probably caused by wrong virtual world/interior/coordinates.
Reply
#3

Just grayish stuff.

Hm the interior should be right, so should the coordinates.

It is Jefferson Motel
Reply
#4

Try this

pawn Код:
COMMAND:base(playerid, params[])
{
    if(BaseOn == 0) return SendClientMessage(playerid, Red, "There is no base in progress, or the base has already started");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            SetPlayerInterior(i, 15);
            SetPlayerPos(i,2215.454833, -1147.475585, 1025.796875);
            //SetSpawnInfo(i, T_ATT, 46, 2221.2100,-1148.9974,1025.7969,3.0111, 24, 500, 31, 500, 34, 500);
            //SetSpawnInfo(i, T_DEF, 46, 2193.1692,-1143.9407,1029.7969,180.0461, 24, 500, 31, 500, 34, 500);
            GivePlayerWeapon(i, 24, 500);
            GivePlayerWeapon(i, 31, 500);
            GivePlayerWeapon(i, 34, 500);
        }
    }
    return 1;
}
Reply
#5

I've done it like this now

pawn Код:
COMMAND:base(playerid, params[])
{
    if(BaseOn == 0) return SendClientMessage(playerid, Red, "There is no base in progress, or the base has already started");
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            new rand = random(sizeof(RandomSpawn));
            SetPlayerInterior(i, 15);
            SetPlayerPos(playerid, RandomSpawn[rand][0], RandomSpawn[rand][1],RandomSpawn[rand][2]);
            SetPlayerFacingAngle(playerid, RandomSpawn[rand][3]);
            GivePlayerWeapon(i, 24, 500);
            GivePlayerWeapon(i, 31, 500);
            GivePlayerWeapon(i, 34, 500);
        }
    }
    return 1;
}
And it works.
Can anyone make me a code, when a player types /base, he will randomly set to a team with

SetPlayerTeam(i, ...)

I've done some ways and I failed
Reply
#6

Please, help me, please
Reply
#7

Random ?

pawn Код:
SetPlayerTeam(playerid, random(2));
Reply
#8

Yeah

So I just need to put that in the cmd? Or some more code required?
Reply
#9

just that line and than the guy will be in team 0 or in team 1 because random(2) return values from 0 till 2 (also 0, 1)
Reply
#10

You said from 0 till 2? Then also 2? I just need 2 teams?

Also, can you make this work too?

pawn Код:
stock GetLowestCountTeam()
{
    new c0, c1;
    for (new i = 0; i < MAX_PLAYERS; i ++)
    {
           if (Team[i] == Team0) { c0 += 1; }
           else if (Team[i] == Team1) { c1 += 1; }
     }
     if (c0 < c1) return Team0;
     else if (c0 > c1) return Team1;
}
?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)