07.12.2011, 18:49
If you want to change it for ALL players, then you can use SetPlayerColor instead. You will also need a variable to know if the player is showing his location or not.
pawn Код:
//Top of script
bool:location[MAX_PLAYERS]; //Stores if the players is showing his location or not
//OnPlayerConnect
public OnPlayerConnect(playerid)
{
location = false; //Location will be HIDDEN by default
SetPlayerColor(playerid, 0xFF000000); //^
//Rest of your code
}
//Command
dcmd_showlocation(playerid, params[])
#pragma unused params
{
if(!location[playerid]) //If location is hidden...
{
location[playerid] = true;
SetPlayerColor(playerid, 0xFF0000FF); //Sets the player's marker to RED
//Here you can add more code, like sending a message to the player that typed the command, etc.
}
else
{
location[playerid] = false;
SetPlayerColor(playerid, 0xFF000000); //Sets the player's marker to RED with 100% of transparency = HIDDEN
//Here you can add more code, like sending a message to the player that typed the command, etc.
}
return 1;
}