SendClientMessage spam.
#1

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?
Reply
#2

Probably you are using a loop?
Reply
#3

Is this code placed under OnPlayerUpdate?
Reply
#4

It's not on player update and it's not a loop.
Reply
#5

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?
Reply
#6

show us the whole callback.
Reply
#7

Does it use a timer or a pickup?
Reply
#8

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

OnPlayerRequestSpawn is called everytime player press 'Spawn' button.
If player press Spawn multiple times, yes it will spam.
Reply
#10

Yeah, im clicking it only one time.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)