Message only shown once. - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Message only shown once. (
/showthread.php?tid=479179)
Message only shown once. -
zClaw - 03.12.2013
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;
}
Re: Message only shown once. -
Kyance - 03.12.2013
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)