On/off triggering of a player blip on radar
#2

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;
}
Reply


Messages In This Thread
On/off triggering of a player blip on radar - by HighFlyer - 07.12.2011, 18:16
Respuesta: On/off triggering of a player blip on radar - by OPremium - 07.12.2011, 18:49
Re: On/off triggering of a player blip on radar - by HighFlyer - 10.12.2011, 13:19
Re: On/off triggering of a player blip on radar - by BleverCastard - 10.12.2011, 13:20
Re: On/off triggering of a player blip on radar - by HighFlyer - 10.12.2011, 13:23

Forum Jump:


Users browsing this thread: 1 Guest(s)