SendClientMessage spam. - 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: SendClientMessage spam. (
/showthread.php?tid=243307)
SendClientMessage spam. -
sekol - 22.03.2011
pawn Код:
if(PlayerInfo[playerid][pMember] !=0 && GetPlayerTeam(playerid) != PlayerInfo[playerid][pMember])
{
SendClientMessage(playerid, COLOR_WHITE, "You do not belong to this gang!");
return 0;
}
This checks if player is in any gang, if he is, then it will send him a message, the prob is, that it spams it x3.
What's wrong?
Re: SendClientMessage spam. -
Zh3r0 - 22.03.2011
Probably you are using a loop?
Re: SendClientMessage spam. -
Ironboy500[TW] - 22.03.2011
Is this code placed under OnPlayerUpdate?
Re: SendClientMessage spam. -
sekol - 22.03.2011
It's not on player update and it's not a loop.
Re: SendClientMessage spam. -
Zh3r0 - 22.03.2011
Quote:
Originally Posted by sekol
It's not on player update and it's not a loop.
|
Where is it situated then? Timer? Some public?
Re: SendClientMessage spam. -
-Rebel Son- - 22.03.2011
show us the whole callback.
Re: SendClientMessage spam. -
alpha500delta - 22.03.2011
Does it use a timer or a pickup?
Re: SendClientMessage spam. -
sekol - 22.03.2011
pawn Код:
public OnPlayerRequestSpawn(playerid)
{
new skin, name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
skin = GetPlayerSkin(playerid);
if(SkinInfo[skin][sOwned] == 1 && strcmp(SkinInfo[skin][sOwner],name, false))
{
SendClientMessage(playerid, COLOR_WHITE, "This skin is reserved!");
return 0;
}
if(PlayerInfo[playerid][pMember] !=0 && GetPlayerTeam(playerid) != PlayerInfo[playerid][pMember])
{
SendClientMessage(playerid, COLOR_WHITE, "You do not belong to this gang!");
return 0;
}
return 1;
}
Re: SendClientMessage spam. -
Ironboy500[TW] - 22.03.2011
OnPlayerRequestSpawn is called everytime player press 'Spawn' button.
If player press Spawn multiple times, yes it will spam.
Re: SendClientMessage spam. -
sekol - 22.03.2011
Yeah, im clicking it only one time.