Message only shown once.
#1

Hey, I made a duty point for officers to get on/off duty, but when they walk into the icon the SendClientMessage keeps spamming, anyone knows how to avoid this and let it be shown once?

pawn Код:
CMD:duty(playerid, params[])
{
    if(IsPlayerInRangeOfPoint(playerid, 2.0, 254.9634, 76.6764, 1003.6406))
    {
        if(PlayerInfo[playerid][pJob] == 1)
        {
            ShowPlayerDialog(playerid, DIALOG_DUTYLSPD, DIALOG_STYLE_LIST, "Uniform Selection.", "Male LSPD Uniform.\nMale LSPD Uniform 2.\nFemale LSPD Uniform 1.\nFemale LSPD Uniform 2.", "Select", "Return");
        }
        else if(PlayerInfo[playerid][pJob] == 2)
        {
            SetPlayerSkin(playerid, 71);
            SetPlayerColor(playerid, COLOR_LIGHTBLUE);
            SendClientMessage(playerid, COLOR_LIME, "You are now on duty as a volunteer officer.");
            GivePlayerWeapon(playerid, 24, 75);
            GivePlayerWeapon(playerid, 41, 100);
            GivePlayerWeapon(playerid, 3, 1);
        }
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "You are not near any duty point!");
    }
    return 1;
}
Reply
#2

Try changing it into a checkpoint, and at the "PlayerInfo[playerid][pJob] == 2" use "DisablePlayerCheckpoint(playerid);"
That should avoid spam(Unless they keep going back inside it...)
(That's the only thing i thought of xd)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)