30.07.2015, 13:19
Hello, thats my track command, and when its executed, it must show a player marker on the minimap, but it doesnt?! Where's the problem, or is it in -
although I dont want the player markers to be seen on the minimap always, thats why I've set it to 0.
PHP код:
ShowPlayerMarkers(0);
PHP код:
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)) return SendClientMessage(playerid, COLOR_GREY, "You are not authorized to use that command.");
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, 0xFF0000FF);
return 1;
}