Help SetPlayerMarkerForPlayer
#1

Hi guys, i need help with a cmd..when i use this command in my server the mark is visible for all players, not only for cops..can you help me ?


pawn Код:
CMD:c(playerid, params[])
{
    new string[170], giveplayerid;
    new cargos[MAX_PLAYER_NAME];
    new cargos2[MAX_PLAYER_NAME];
    if(!IsACop(playerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "No puedes usar este comando.");
    if(OnDuty[playerid] == 0 && IsACop(playerid)) return  SendClientMessageEx(playerid, COLOR_WHITE, "No estas en servicio!");
    if(!sscanf(params,"ii", params[0], params[1]))
    {
        GetPlayerName(params[0], cargos, sizeof(cargos));
        GetPlayerName(playerid, cargos2, sizeof(cargos2));
        switch(params[1])
        {
        case 0:
        {
            format(string, sizeof(string), "Oficial {FFFFFF}%s No tiene nada Ilegal lo dejo Libre", GetPlayerNameEx(playerid));
            SendRadioMessage(params[0], TEAM_BLUE_COLOR, string);
            Info[params[0]][pWantedLevel] = 0;
            SetPlayerWantedLevel(params[0], 0);
            for(new i = 0; i < GetMaxPlayers(); i++)
            if(IsACop(playerid))
            SetPlayerMarkerForPlayer(i, params[0], c0_color);
            format(string, sizeof(string), "[Radio] {FFFFFF}Oficial %s dice: {00D2CF}%s {FFFFFF}no presenta ningъn delito lo dejo continuar", cargos2, cargos);
            SendRadioMessage(1, TEAM_BLUE_COLOR, string);
            SendRadioMessage(2, TEAM_RADIO_COLOR3, string);
        }
        case 1:
        {
            format(string, sizeof(string), "La policia quiere hablar contigo, no intentes escapar.", GetPlayerNameEx(playerid));
            SendClientMessageEx(params[0], COLOR_WHITE, string);
            Info[params[0]][pWantedLevel] = 1;
            SetPlayerWantedLevel(params[0], 1);
            for(new i = 0; i < GetMaxPlayers(); i++)
            if(IsACop(playerid))
            SetPlayerMarkerForPlayer(i, params[0], c1_color);
            format(string, sizeof(string), "[Radio] {FFFFFF}(Oficial %s) dice: {00D2CF}%s {FFFFFF}parece sospechoso, voy a interrogarlo.", cargos2, cargos);
            SendRadioMessage(1, TEAM_BLUE_COLOR, string);
            SendRadioMessage(2, TEAM_RADIO_COLOR3, string);
        }
        case 2:
        {
            format(string, sizeof(string), "Te escapaste, ahora toda la policia te buscarб.", GetPlayerNameEx(playerid));
            SendClientMessageEx(giveplayerid, COLOR_WHITE, string);
            Info[params[0]][pWantedLevel] = 2;
            SetPlayerWantedLevel(params[0], 2);
            for(new i = 0; i < GetMaxPlayers(); i++)
            if(IsACop(playerid))
            SetPlayerMarkerForPlayer(i, params[0], c2_color);
            format(string, sizeof(string), "[Radio] {FFFFFF}Oficial %s dice: {00D2CF}%s {FFFFFF}se resistiу al arresto, procedemos a su persecuciуn.", cargos2, cargos);
            SendRadioMessage(1, TEAM_BLUE_COLOR, string);
            SendRadioMessage(2, TEAM_RADIO_COLOR3, string);
        }
        case 3:
        {
            Info[params[0]][pWantedLevel] = 3;
            SetPlayerWantedLevel(params[0], 3);
            for(new i = 0; i < GetMaxPlayers(); i++)
            if(IsACop(playerid))
            SetPlayerMarkerForPlayer(i, params[0], c3_color);
            format(string, sizeof(string), "[Radio] {FFFFFF}Oficial %s dice: {00D2CF}%s {FFFFFF}se encuentra armado, procedan con precauciуn.", cargos2, cargos);
            SendRadioMessage(1, TEAM_BLUE_COLOR, string);
            SendRadioMessage(2, TEAM_RADIO_COLOR3, string);
        }
        case 4:
        {
            Info[params[0]][pWantedLevel] = 4;
            SetPlayerWantedLevel(params[0], 4);
            for(new i = 0; i < GetMaxPlayers(); i++)
            if(IsACop(playerid))
            SetPlayerMarkerForPlayer(i, params[0], c4_color);
            format(string, sizeof(string), "[Radio] {FFFFFF}Oficial %s dice: {00D2CF}%s {FFFFFF}abriу fuego, necesito refuerzos.", cargos2, cargos);
            SendRadioMessage(1, TEAM_BLUE_COLOR, string);
            SendRadioMessage(2, TEAM_RADIO_COLOR3, string);
        }
        case 5:
        {
            Info[params[0]][pWantedLevel] = 5;
            SetPlayerWantedLevel(params[0], 5);
            for(new i = 0; i < GetMaxPlayers(); i++)
            if(IsACop(playerid))
            SetPlayerMarkerForPlayer(i, params[0], c5_color);
            format(string, sizeof(string), "[Radio] {FFFFFF}Oficial %s dice: {00D2CF}%s {FFFFFF}asesinу, detener vivo o muerto.", cargos2, cargos);
            SendRadioMessage(1, TEAM_BLUE_COLOR, string);
            SendRadioMessage(2, TEAM_RADIO_COLOR3, string);
        }
        case 6:
        {
            Info[params[0]][pWantedLevel] = 6;
            SetPlayerWantedLevel(params[0], 6);
            for(new i = 0; i < GetMaxPlayers(); i++)
            if(IsACop(playerid))
            SetPlayerMarkerForPlayer(i, params[0], c6_color);
            format(string, sizeof(string), "[Radio] {FFFFFF}Oficial %s dice: {00D2CF}%s {FFFFFF}es extremadamente peligroso, disparen a matar.", cargos2, cargos);
            SendRadioMessage(1, TEAM_BLUE_COLOR, string);
            SendRadioMessage(2, TEAM_RADIO_COLOR3, string);
        }
    }
    else SendClientMessage(playerid, -1, "Utiliza: {6E9AFF}/c{FFFFFF} [ID] [0-6]");
    return 1;
}
forward Policia(member, color, string[]);
public Policia(member, color, string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i))
        {
            if(IsACop(i))
            {
                SendClientMessage(i, color, string);
            }
        }
    }
}
Reply
#2

pawn Код:
case 0:
        {
            format(string, sizeof(string), "Oficial {FFFFFF}%s No tiene nada Ilegal lo dejo Libre", GetPlayerNameEx(playerid));
            SendRadioMessage(params[0], TEAM_BLUE_COLOR, string);
            Info[params[0]][pWantedLevel] = 0;
            SetPlayerWantedLevel(params[0], 0);
            for(new i = 0; i < GetMaxPlayers(); i++)
            if(IsACop(playerid))
            SetPlayerMarkerForPlayer(i, params[0], c0_color);
            format(string, sizeof(string), "[Radio] {FFFFFF}Oficial %s dice: {00D2CF}%s {FFFFFF}no presenta ningъn delito lo dejo continuar", cargos2, cargos);
            SendRadioMessage(1, TEAM_BLUE_COLOR, string);
            SendRadioMessage(2, TEAM_RADIO_COLOR3, string);
        }
In Up ! You Write SetPlayerMarkerForPlayer(i, params[0], c0_color);
Changed To SetPlayerMarkerForPlayer(playerid, params[0], c0_color);
I Think This IS Your Problem
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)