team(s) ??
#1

Hello everyone. I'm having a bit of problem, Hope if someone knows a fix.
My problem is that i have 2 teams, But in the game it dosen't load team 2 (team_hunter)
While team_prop works fine :/

Edit: Debug says team_hunter positions are loaded correctly, but ingame i can't change to team_hunter
pawn Код:
new team_prop;
new team_hunter;
pawn Код:
#define Spawn_Path "/Maps/Spawns/%s.ini"
0 for prop and 1 for hunter

pawn Код:
format(Processing, sizeof(Processing), Spawn_Path, Maps[Map]); //Reads the spawns file
    Pointer = fopen(Processing, filemode:io_read);
    if(!Pointer) return 0;

Count = 0; // Now being used as a Hunter or Prop specifier.

    while(fread(Pointer, Length, 256) > 0)
    {
        new Index = 0;
        Index = FindValue(Length, Processing, ',', Index);
        if(Index == -1) continue;
        Count = strval(Processing);

        if(Count == 0) // Team Prop Spawn
        {
            Index = FindValue(Length, Processing, ',', Index+1);
            if(Index == -1) continue;
            PropSpawns[PropSpawnCount][Pos][0] = floatstr(Processing);
            #if defined DEBUG_BUILD
            printf("%f", floatstr(Processing));
            #endif

            Index = FindValue(Length, Processing, ',', Index+1);
            if(Index == -1) continue;
            PropSpawns[PropSpawnCount][Pos][1] = floatstr(Processing);

            Index = FindValue(Length, Processing, ',', Index+1);
            if(Index == -1) continue;
            PropSpawns[PropSpawnCount][Pos][2] = floatstr(Processing);

            Index = FindValue(Length, Processing, ';', Index+1);
            if(Index == -1) continue;
            PropSpawns[PropSpawnCount][Pos][3] = floatstr(Processing);
            PropSpawnCount++;
        }
        else if (Count == 1) //Hunter Spawns
        {
            Index = FindValue(Length, Processing, ',', Index+1);
            if(Index == -1) continue;
            HunterSpawns[HunterSpawnCount][Pos][0] = floatstr(Processing);

            Index = FindValue(Length, Processing, ',', Index+1);
            if(Index == -1) continue;
            HunterSpawns[HunterSpawnCount][Pos][1] = floatstr(Processing);

            Index = FindValue(Length, Processing, ',', Index+1);
            if(Index == -1) continue;
            HunterSpawns[HunterSpawnCount][Pos][2] = floatstr(Processing);

            Index = FindValue(Length, Processing, ';', Index+1);
            if(Index == -1) continue;
            HunterSpawns[HunterSpawnCount][Pos][3] = floatstr(Processing);
            HunterSpawnCount++;
        }
    }
    fclose(Pointer);
    print("Spawn Positions Loaded!");
    return 1;
}
waiting for help :/
Reply
#2

You're not increasing the count.
Reply
#3

Count = strval(Processing);
No as this line here deicates weather its a hunter or prop spawn? 0 prop & 1 hunter... In the save file.
Reply
#4

bump? :/
Just found out by debug that the spawn positions of Hunter '1' loads correct, But ingame if i try to change team with Class selection There is only Team_Prop on RequestClass (Team selection) and using /hunter to setplayerteam to team_hunter still spawn's you as Prop.


Spawn path/file Crappy.ini
Код:
0, 665.1231, -2456.0330, 17.7866, 184.2183;
0, 662.3574, -2456.3440, 17.7866, 181.3983;
0, 662.9776, -2463.4939, 17.7866, 2.6516;
0, 667.3328, -2463.3879, 17.7866, 5.9532;
0, 660.2363, -2461.0400, 17.7866, 266.6256;
1, 532.2843, -2458.7529, 17.7866, 182.0249;
1, 536.8811, -2458.3608, 17.7866, 182.3382;
1, 537.4020, -2467.8252, 17.7866, 2.7965;
1, 532.4365, -2467.5544, 17.7866, 359.3499;
1, 538.9688, -2462.9395, 17.7866, 90.5307;
The 0,0,0,0,0 is prop random spawns which works. And 1,1,1,1,1 is hunter which only loads but there is no team_hunter ingame
Reply
#5

Your OnPlayerRequestClass code? Or wherever, - you are processing the spawning/team changing/selection code.
Reply
#6

There is no, Because i have a map changing system, So if Map 1(in scriptfiles map.ini) loads it will load the Spawn positions (map.ini ( spawn file name must be the same as map name) in scriptfiles) , So if Map1.ini is started, it will load spawn file with name Map1.ini and there are 0,x,y,z (0 for prop ) and 1,x,y,z (1 for hunter), and when it's all loaded then Under OnPlayerSpawn i getplayer team and set their skin skin, positions on the basis of their teams etc.
Reply
#7

Show the OnPlayerSpawn code please.
Reply
#8

Sure
Edit: Ignore the //, it was changed.
pawn Код:
public OnPlayerSpawn(playerid)
{
    #if defined DEBUG_BUILD
    printf("%i", ObjectSpawns[0][ModelID]);
    #endif
    //SetTimerEx("deleteobject1", 3000, 0, "i", playerid);
    new Random = random(MAX_SPAWNS-1);
    TogglePlayerControllable(playerid, 0);
    control[playerid] = SetTimerEx("Controll", 2000, 0, "i", playerid);
    if(GetPlayerTeam(playerid) == team_prop)
    {
        SendClientMessage(playerid, COLOR_AQUA ,"You are TEAM_PROP");
        SendClientMessage(playerid, COLOR_AQUA, "Your Objective is to Hide using Fire Key (LMB) near Objects");
        SetPlayerSkin(playerid,0);
        //#define Random 1
        //Vehicle[playerid] = CreateVehicle(564, PropSpawns[Random][Pos][0], PropSpawns[Random][Pos][1], PropSpawns[Random][Pos][2], PropSpawns[Random][Pos][3], -1, -1, -1);
        SetPlayerPos(playerid, PropSpawns[Random][Pos][0], PropSpawns[Random][Pos][1], PropSpawns[Random][Pos][2]);
        SetPlayerFacingAngle(playerid, PropSpawns[Random][Pos][3]);
        //PutPlayerInVehicle(playerid, Vehicle[playerid], 0);
        #if defined DEBUG_BUILD
        printf("%f, %f, %f, %f", PropSpawns[Random][Pos][0], PropSpawns[Random][Pos][1], PropSpawns[Random][Pos][2], PropSpawns[Random][Pos][3]);
        #endif
    }
    else if(GetPlayerTeam(playerid) == team_hunter)
    {
        SendClientMessage(playerid, COLOR_AQUA ,"You are TEAM_HUNTER");
        SendClientMessage(playerid, COLOR_AQUA, "Your Objective is to Find Props by shooting objects");
        SetPlayerSkin(playerid, 285);
        GivePlayerWeapon(playerid, 24, 100);
        //#define Random 0 //This still need to be fixed :D.
        SetPlayerPos(playerid, HunterSpawns[Random][Pos][0], HunterSpawns[Random][Pos][1], HunterSpawns[Random][Pos][2]);
        SetPlayerFacingAngle(playerid, HunterSpawns[Random][Pos][3]);
        #if defined DEBUG_BUILD
        printf("%f, %f, %f, %f",HunterSpawns[Random][Pos][0], HunterSpawns[Random][Pos][1], HunterSpawns[Random][Pos][2], HunterSpawns[Random][Pos][3]);
        #endif
    }
    else
    {
        SendClientMessage(playerid, -1, "Data Manipulation, kicked!");
        Kick(playerid);
    }
    return 1;
}
Reply
#9

I think I see what's wrong. The team ID's are the same, where as they should be different. Change,
pawn Код:
new team_hunter
to
pawn Код:
new team_hunter = 1
This should work.
Reply
#10

holy O_O fixed
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)