[HELP] My Classes Wont Spawn With Its Specific Colour Anymore???
#1

Ok this is weird and have tried everything :S

The problem is TEAM_COPS are not showing as blue markers anymore and TEAM_AGENT skin 287 is not showing green after i added more classes (CLASS_MEDIC || CLASS_KIDNAP || CLASS_RAPIST)

Before i added these new classes they all showed there specific colors.

Now not event Army shows green they all show white

Here are the callbacks used and everything else so u can see:

pawn Код:
#define TEAM_CIVILIAN 0
#define TEAM_COPS 1
#define TEAM_AGENT 2

#define CLASS_MEDIC 3
#define CLASS_KIDNAP 4
#define CLASS_RAPIST 5

public SetPlayerTeamFromClass(playerid, classid)
{
    switch(classid)
    {
        case 0..10:
        {
            gTeam[playerid] = TEAM_COPS;
            GameTextForPlayer(playerid, "~b~Cops", 2000, 5);
        }
        case 11..14:
        {
            gTeam[playerid] = TEAM_AGENT;
            GameTextForPlayer(playerid, "~w~CIA", 2000, 5);
        }
        case 15:
        {
            gTeam[playerid] = TEAM_AGENT;
            GameTextForPlayer(playerid, "~g~Army", 2000, 5);
        }
        case 16..104:
        {
            gTeam[playerid] = TEAM_CIVILIAN;
            GameTextForPlayer(playerid, "~r~Civilians", 2000, 5);
        }
        case 105..107:
        {
            gTeam[playerid] = CLASS_MEDIC;
            GameTextForPlayer(playerid, "~w~Medic", 2000, 5);
        }
        case 108:
        {
            gTeam[playerid] = CLASS_KIDNAP;
            GameTextForPlayer(playerid, "~r~Kidnapper", 2000, 5);
        }
        case 109:
        {
            gTeam[playerid] = CLASS_RAPIST;
            GameTextForPlayer(playerid, "~r~Rapist", 2000, 5);
        }
    }
}


public OnPlayerUpdate(playerid)
{
    if(gTeam[playerid] == TEAM_CIVILIAN || CLASS_KIDNAP || CLASS_RAPIST)
    {
        if(GetPlayerWantedLevel(playerid) == 0)
        {
            SetPlayerColor(playerid,WHITE);
        }
        else if(GetPlayerWantedLevel(playerid) >= 1 && GetPlayerWantedLevel(playerid) <= 3)
        {
            SetPlayerColor(playerid,0xFFFF00FF);
        }
        else if(GetPlayerWantedLevel(playerid) >= 4 && GetPlayerWantedLevel(playerid) <= 8)
        {
            SetPlayerColor(playerid,0xFF8000FF);
        }
        else if(GetPlayerWantedLevel(playerid) >= 9)
        {
            SetPlayerColor(playerid,0xFF0000FF);
        }
    }
    return 1;
}

public OnPlayerSpawn(playerid)
{
    if(gTeam[playerid] == TEAM_COPS)
    {
        SetPlayerWantedLevel(playerid, 0);
        SetPlayerTeam(playerid, 0);
        SendClientMessage(playerid, COLOR_LIGHTGREEN, "You Are A Cop You Job Is To /ar Oranges And Reds And /tk Yellows!");
        SendClientMessage(playerid, COLOR_LIGHTGREEN, "Use /cmds And Read /rules Before Playing! Use /co For Cop Radio");
        GivePlayerWeapon(playerid, 32, 400);
        SetPlayerColor(playerid,BLUE);
        new rand = random(sizeof(copPlayerSpawns));
        SetPlayerPos(playerid, copPlayerSpawns[rand][0], copPlayerSpawns[rand][1], copPlayerSpawns[rand][2]);
        SetPlayerFacingAngle(playerid, copPlayerSpawns[rand][3]);
        SetPlayerArmour(playerid, 100);
    }
    else if(gTeam[playerid] == TEAM_AGENT)
    {
        SetPlayerWantedLevel(playerid, 0);
        SetPlayerTeam(playerid, 0);
        SendClientMessage(playerid, COLOR_LIGHTGREEN, "You Are A Cop You Job Is To /ar Oranges And Reds And /tk Yellows!");
        SendClientMessage(playerid, COLOR_LIGHTGREEN, "Use /cmds And Read /rules Before Playing! Use /ac For Agent Radio");
        GivePlayerWeapon(playerid, 32, 400);
        if(GetPlayerSkin(playerid) == 287)
        {
            SetPlayerPos(playerid, 267.3403, 1941.5496, 17.6406);
            SetPlayerColor(playerid, GREEN);
        }
        else if(GetPlayerSkin(playerid) == 163 || 164 || 165 || 166)
        {
            SetPlayerPos(playerid, 962.3979, 1802.8895, 8.8516);
            SetPlayerColor(playerid, WHITE);
        }
    }
    else if(gTeam[playerid] == TEAM_CIVILIAN)
    {
        SendClientMessage(playerid, COLOR_LIGHTGREEN, "You Are A Robber Your Job Is To Rob Stores And Casinos! Use /rob To Rob Players!");
        SendClientMessage(playerid, COLOR_LIGHTGREEN, "Don't Get Caught! You Will Be Sent To Jail!");
        SendClientMessage(playerid, COLOR_LIGHTGREEN, "Use /cmds And Read /rules Before Playing! Use /rc For Robber Chat!");
        SetPlayerColor(playerid,WHITE);
        new rand = random(sizeof(civilianPlayerSpawns));
        SetPlayerPos(playerid, civilianPlayerSpawns[rand][0], civilianPlayerSpawns[rand][1], civilianPlayerSpawns[rand][2]);
        SetPlayerFacingAngle(playerid, civilianPlayerSpawns[rand][3]);
    }
    else if(gTeam[playerid] == CLASS_MEDIC)
    {
        SetPlayerWantedLevel(playerid, 0);
        SetPlayerTeam(playerid, 3);
        SendClientMessage(playerid, COLOR_LIGHTGREEN, "You Are A Medic Your Job Is To Heal Wounded Players! Use /healme To Heal Yourself!");
        SendClientMessage(playerid, COLOR_LIGHTGREEN, "Use /cmds And Read /rules Before Playing! Use /mc For Medic Radio!");
        SetPlayerColor(playerid,WHITE);
        SetPlayerPos(playerid,1607.3618,1820.2750,10.8280);
    }
    else if(gTeam[playerid] == CLASS_KIDNAP)
    {
        SendClientMessage(playerid, COLOR_LIGHTGREEN, "You Are A Kidnapper! You Job Is To Kidnap Players! Use /tie In A Car To Kidnap Someone!");
        SendClientMessage(playerid, COLOR_LIGHTGREEN, "Use /cmds And Read /rules Before Playing! Use /rc For Robber Chat!");
        SetPlayerColor(playerid,WHITE);
        new rand = random(sizeof(civilianPlayerSpawns));
        SetPlayerPos(playerid, civilianPlayerSpawns[rand][0], civilianPlayerSpawns[rand][1], civilianPlayerSpawns[rand][2]);
        SetPlayerFacingAngle(playerid, civilianPlayerSpawns[rand][3]);
    }
    else if(gTeam[playerid] == CLASS_RAPIST)
    {
        SendClientMessage(playerid, COLOR_LIGHTGREEN, "You Are A Rapist Your Job Is To Rape Players! Use /rape To Rape Somebody!");
        SendClientMessage(playerid, COLOR_LIGHTGREEN, "Use /cmds And Read /rules Before Playing! Use /rc For Robber Chat!");
        SetPlayerColor(playerid,WHITE);
        new rand = random(sizeof(civilianPlayerSpawns));
        SetPlayerPos(playerid, civilianPlayerSpawns[rand][0], civilianPlayerSpawns[rand][1], civilianPlayerSpawns[rand][2]);
        SetPlayerFacingAngle(playerid, civilianPlayerSpawns[rand][3]);
    }
        return 1;
}

public SetPlayerToTeamColor(playerid)
{
    if(gTeam[playerid] == TEAM_COPS)
    {
        SetPlayerColor(playerid, BLUE);
    }
    else if(gTeam[playerid] == TEAM_CIVILIAN)
    {
        SetPlayerColor(playerid, WHITE);
    }
    else if(gTeam[playerid] == CLASS_MEDIC)
    {
        SetPlayerColor(playerid, WHITE);
    }
    else if(gTeam[playerid] == CLASS_KIDNAP)
    {
        SetPlayerColor(playerid, WHITE);
    }
    else if(gTeam[playerid] == CLASS_RAPIST)
    {
        SetPlayerColor(playerid, WHITE);
    }
}
Thanks in advanced!
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)