Teams problem
#7

Here's a better way.

pawn Код:
#define TEAM_COP 0
#define TEAM_MECHANIC 1

public OnGameModeInit()
{
   
    AddPlayerClass(0,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1); // ClassID 0 Aka Cop
    AddPlayerClass(0,1958.3783,1343.1572,15.3746,270.1425,0,0,24,300,-1,-1); // ClassID 1 Aka Mechanic
    return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
    switch(classid)
    {
        case 0: // ClassID 0 aka Cop
        {
            GameTextForPlayer(playerid, "~b~Police", 4000, 3);
            SetPlayerTeam(playerid,TEAM_COP); // Dosent matter that it goes here, it stops a variable like gTeam and its going to change if you switch classes.
        }
        case 1: // ClassID 1 aka Mech
        {
            GameTextForPlayer(playerid, "~r~Mechanic", 4000, 3);
            SetPlayerTeam(playerid,TEAM_MECHANIC);
        }
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
    switch(GetPlayerTeam(playerid))
    {
        case TEAM_COP:
        {
            // Code here for when cops spawn
        }
        case TEAM_MECHANIC:
        {
            // Code here for when Mechanics spawn
        }
    }
    return 1;
}
Reply


Messages In This Thread
Teams problem - by MWF2 - 11.07.2010, 01:44
Re: Teams problem - by cessil - 11.07.2010, 02:51
Re: Teams problem - by MWF2 - 11.07.2010, 03:16
Re: Teams problem - by MWF2 - 11.07.2010, 21:45
Re: Teams problem - by DJDhan - 12.07.2010, 00:39
Re: Teams problem - by MWF2 - 12.07.2010, 03:52
Re: Teams problem - by FreshKilla - 12.07.2010, 07:59

Forum Jump:


Users browsing this thread: 1 Guest(s)