[Help] Colour Problem
#1

in my gamemode i want the cops names to be blue and the criminal names to be red, but the problem is everyone has a different color, can anyone provide me with something that will fix this problem?
Reply
#2

add under onPlayerSpawn add SetPlayerColor(playerid,Color); under each team with the color of course
Reply
#3

EDIT: Too late ^

pawn Код:
public OnPlayerSpawn(playerid)
{
    if(gTeam[playerid] == TEAM_COP)
    {
        SetPlayerColor(playerid, COLOR_BLUE);
    }
    else if(gTeam[playerid] == TEAM_CRIMINAL)
    {
        SetPlayerColor(playerid, COLOR_RED);
    }
    return 1;
}
Reply
#4

Quote:
Originally Posted by xkirill
Посмотреть сообщение
add under onPlayerSpawn add SetPlayerColor(playerid,Color); under each team with the color of course
i did. there is gCopplayerspawns and gRandomplayerspawns, but even with the cop skin 285, it spawns on the random players spawn location, can you help?
Reply
#5

here is my spawn code :

pawn Код:
new Float:gRandomPlayerSpawns[23][3] = {
{2493.0972,-1666.5704,13.3438}
};

new Float:gCopPlayerSpawns[2][3] = {
{2533.7241,2092.1035,10.8203}
};
and onplayerspawn here
pawn Код:
public OnPlayerSpawn(playerid)
{
    GivePlayerMoney(playerid, PocketMoney);
    SetPlayerInterior(playerid,0);
    SetPlayerRandomSpawn(playerid);
    TogglePlayerClock(playerid,1);
    TextDrawShowForPlayer(playerid,Textdraw2);
    TextDrawShowForPlayer(playerid,Textdraw3);
    return 1;
}
public SetPlayerRandomSpawn(playerid)
{
    if (iSpawnSet[playerid] == 1)
    {
        new rand = random(sizeof(gCopPlayerSpawns));
        SetPlayerPos(playerid, gCopPlayerSpawns[rand][0], gCopPlayerSpawns[rand][1], gCopPlayerSpawns[rand][2]); // Warp the player
        SetPlayerFacingAngle(playerid, 270.0);
    }
    else if (iSpawnSet[playerid] == 0)
    {
        new rand = random(sizeof(gRandomPlayerSpawns));
        SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]); // Warp the player
    }
    return 1;
}
Reply
#6

try this
pawn Код:
public OnPlayerSpawn(playerid)
{
    GivePlayerMoney(playerid, PocketMoney);
    SetPlayerInterior(playerid,0);
    SetPlayerRandomSpawn(playerid);
    TogglePlayerClock(playerid,1);
    TextDrawShowForPlayer(playerid,Textdraw2);
    TextDrawShowForPlayer(playerid,Textdraw3);
    return 1;
}
public SetPlayerRandomSpawn(playerid)
{
    if (iSpawnSet[playerid] == 1)
    {
        new rand = random(sizeof(gCopPlayerSpawns));
        SetPlayerPos(playerid, gCopPlayerSpawns[rand][0], gCopPlayerSpawns[rand][1], gCopPlayerSpawns[rand][2]); // Warp the player
        SetPlayerFacingAngle(playerid, 270.0);
        SetPlayerColor(playerid, COLOR_BLUE);
    }
    else if (iSpawnSet[playerid] == 0)
    {
        new rand = random(sizeof(gRandomPlayerSpawns));
        SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]); // Warp the player
        SetPlayerColor(playerid,COLOR_RED);
    }
    return 1;
}
Reply
#7

Doesn't Spawn a cop skin 285 to other location + its color is red, Help?
Quote:
Originally Posted by xkirill
Посмотреть сообщение
try this
pawn Код:
public OnPlayerSpawn(playerid)
{
    GivePlayerMoney(playerid, PocketMoney);
    SetPlayerInterior(playerid,0);
    SetPlayerRandomSpawn(playerid);
    TogglePlayerClock(playerid,1);
    TextDrawShowForPlayer(playerid,Textdraw2);
    TextDrawShowForPlayer(playerid,Textdraw3);
    return 1;
}
public SetPlayerRandomSpawn(playerid)
{
    if (iSpawnSet[playerid] == 1)
    {
        new rand = random(sizeof(gCopPlayerSpawns));
        SetPlayerPos(playerid, gCopPlayerSpawns[rand][0], gCopPlayerSpawns[rand][1], gCopPlayerSpawns[rand][2]); // Warp the player
        SetPlayerFacingAngle(playerid, 270.0);
        SetPlayerColor(playerid, COLOR_BLUE);
    }
    else if (iSpawnSet[playerid] == 0)
    {
        new rand = random(sizeof(gRandomPlayerSpawns));
        SetPlayerPos(playerid, gRandomPlayerSpawns[rand][0], gRandomPlayerSpawns[rand][1], gRandomPlayerSpawns[rand][2]); // Warp the player
        SetPlayerColor(playerid,COLOR_RED);
    }
    return 1;
}
Doesn't Spawn a cop skin 285 to other location + its color is red, Help?
Reply
#8

Help please
Reply
#9

add more cords to your script:
pawn Код:
new Float:gRandomPlayerSpawns[23][3] = {
{2493.0972,-1666.5704,13.3438},//remember to put ',' in the end of the line if you want to add more cords/lines like this
{0.00,0.00,0.00}//and add more like this if you want more...(change 0.00 to your cordinate
};

new Float:gCopPlayerSpawns[2][3] = {
{2533.7241,2092.1035,10.8203}//the same here
};
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)