CMD track bug
#1

Hello, when i type /track it doesnt show the marker where player is, here is the cmd:

pawn Код:
CMD:track(playerid, params[])
{
    new playerb, string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsACop(playerid) && !IsAHitman(playerid) && !IsASoldier(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an PCSD Oficer.");
    if(IsACop(playerid) && !PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
    if(Tracking[playerid] != -1)
    {
        playerb = Tracking[playerid];
        Tracking[playerid] = -1;
        SetPlayerMarkerForPlayer(playerid, playerb, GetPlayerColor(playerb));
        SendClientMessage(playerid, COLOR_LIGHTBLUE, " You shut your tracker down.");
        return 1;
    }
    if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /track [playerid]");
    if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
    if(!PlayerInfo[playerb][pCellphone]) return SendClientMessage(playerid, COLOR_GREY, "Player has no cellphone.");
    if(PhoneOff[playerb]) return SendClientMessage(playerid, COLOR_GREY, "Player has their phone turned off.");
    if(GetPlayerInterior(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Player is in an interior.");
    if(GetPlayerVirtualWorld(playerb) != GetPlayerVirtualWorld(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Player is in another virtual world.");
    // Tracking
    Tracking[playerid] = playerb;
    format(string, sizeof(string), " You turned your tracker on. (Tracking: %s)", RPN(playerb));
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    SetPlayerMarkerForPlayer(playerid, playerb, MARKER_LIGHTBLUE);
    return 1;
}
Reply
#2

Well i played in your server,and i know that it doesn't work,i saw your code but i can't still figure it out. Anyways i made a second way that you can track a player :

pawn Код:
CMD:track(playerid, params[])
{
    new playerb, string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
    if(!IsACop(playerid) && !IsAHitman(playerid) && !IsASoldier(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an PCSD Oficer.");
    if(IsACop(playerid) && !PlayerInfo[playerid][pFacDuty]) return SendClientMessage(playerid, COLOR_GREY, "You are not on duty.");
    if(Tracking[playerid] != -1)
    {
        DisablePlayerCheckpoint(playerid); //If tracking,disables player checkpoint
        SendClientMessage(playerid, COLOR_LIGHTBLUE, " You shut your tracker down.");
        return 1;
    }
    if(sscanf(params, "u", playerb)) return SendClientMessage(playerid, COLOR_WHITE, "USAGE: /track [playerid]");
    if(!IsPlayerLoggedIn(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Invalid player id.");
    if(!PlayerInfo[playerb][pCellphone]) return SendClientMessage(playerid, COLOR_GREY, "Player has no cellphone.");
    if(PhoneOff[playerb]) return SendClientMessage(playerid, COLOR_GREY, "Player has their phone turned off.");
    if(GetPlayerInterior(playerb)) return SendClientMessage(playerid, COLOR_GREY, "Player is in an interior.");
    if(GetPlayerVirtualWorld(playerb) != GetPlayerVirtualWorld(playerid)) return SendClientMessage(playerid, COLOR_GREY, "Player is in another virtual world.");
    // Tracking
    Tracking[playerid] = playerb;
    format(string, sizeof(string), " You turned your tracker on. (Tracking: %s)", RPN(playerb));
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    {
        new Float:X,Float:Y,Float:Z; //Float variables, in which to store the X,Y,Z coordinates
        GetPlayerPos(playerb, X,Y,Z); //Gets the player coordinates
        SetPlayerCheckpoint(playerid, X, Y, Z, 3.0); //Shows it to the one that used /track
    }
    return 1;
}
The checkpoint will stay at the last position that the player was.
Reply
#3

How is your 'MARKER_LIGHTBLUE' defined? If the alpha part is set to 00 it will be invisible on the map.

Also the same here
Quote:

GetPlayerColor(playerb)

Did you set the color of the player to an invisible color?
Reply
#4

The MARKER_LIGHTBLUE on his server should be defined to "0x33CCFFFF", unless he changed it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)