Sending a proximity Message to players around the player on a command.
#6

Quote:
Originally Posted by Deal-or-die
Посмотреть сообщение
wouldn't the 'You have taken off your seatbelt' and the 'Deal Ordie has taken off his seatbelt' be displayed to the player that sent the command?
This Command will do all that just fine. you can edit the messages according to your needs

pawn Код:
command(seatbelt,playerid,params[])
{
    #pragma unused params
    new string[60];
    new playername[24];
    GetPlayerName(playerid,playername,24);
    if(WearingSeatbelt[playerid])
    {
        WearingSeatbelt[playerid] = 0;
        SendClientMessage(playerid, COLOR_GREY, "You have taken off your seatbelt.");
        format(string, sizeof(string), "* %s twists the holder and takes off their seatbelt.",playername);
        ProxDetector(20.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
    }
    else if(!WearingSeatbelt[playerid])
    {
        WearingSeatbelt[playerid] = 1;
        SendClientMessage(playerid, COLOR_GREY, "You put your seatbelt on.");
        format(string, sizeof(string), "* %s tucks the holder and puts on their seatbelt.",playername);
        ProxDetector(20.0, playerid, string,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
//ProxDetector shows the message to the players within the range of 20.0 with the COLOR_PURPLE
    }
    return 1;
}
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)