Two chat lines, how to avoid this ? -
Kethrios - 24.01.2013
Hey guys !
I have a little question about this :
pawn Код:
public newbie_sendMsg(color,const string[])
{
for(new i = MIN_PLAYERID; i < MAX_PLAYERS_CURRENT+1; i++)
{
if(IsPlayerConnected(i))
{
if (pack_isAdmin(i,1) || PlayerVip[i][VipLevel] == 4 || PlayerInfo[i][pLevel] <= 18)
{SendClientMessage(i, color, string);}
}
}
return 1;
}
According to this, players with admin pack 1, vip level 4 and players with a level <=18 will receive the messages from the newbie chat.
The problem is that, if the player is an admin (pack 1 for example) and is under or equal level 18, he'll see 2 messages in the chatbox when he speak, but the others will see only one.
Example :
The admin name is XYZ, he'll see :
[19:38:22] [Admin] XYZ : Hi !
[19:38:22] [Admin] XYZ : Hi !
And the others people who have an access to this chat will see :
[19:38:22] [Admin] XYZ : Hi !
How may I avoid this ?
Thanks.
Re: Two chat lines, how to avoid this ? -
DaRk_RaiN - 24.01.2013
pawn Код:
public newbie_sendMsg(color,const string[])
{
for(new i = MIN_PLAYERID; i < MAX_PLAYERS_CURRENT+1; i++)
{
if(IsPlayerConnected(i))
{
if (pack_isAdmin(i,1) && PlayerVip[i][VipLevel] == 4 && PlayerInfo[i][pLevel] <= 18)
return SendClientMessage(i, color, string);
SendClientMessage(i, color, string);
if (pack_isAdmin(i,1) && PlayerVip[i][VipLevel] == 4)
return SendClientMessage(i, color, string);
if (PlayerVip[i][VipLevel] == 4 && PlayerInfo[i][pLevel] <= 18)
return SendClientMessage(i, color, string);
if (pack_isAdmin(i,1) && PlayerInfo[i][pLevel] <= 18)
return
if (pack_isAdmin(i,1) || PlayerVip[i][VipLevel] == 4 || PlayerInfo[i][pLevel] <= 18)
{SendClientMessage(i, color, string);}
}
}
return 1;
}
Re: Two chat lines, how to avoid this ? -
LarzI - 24.01.2013
Show us how you use it
Re : Two chat lines, how to avoid this ? -
Kethrios - 24.01.2013
@Dark_Rain : Thanks for trying, but it's even worse now o_o the person who'll talk will see 3 messages, and the others will see 2 messages from him.
@LarzI: I use it with this :
http://forum.sa-mp.com/showpost.php?...9&postcount=25
Re: Two chat lines, how to avoid this ? -
LarzI - 24.01.2013
Yeah okay, you use it "with that", but I want to see how, and where, you've put your function in the OP. I want to see how YOUR command is built up.
Re: Two chat lines, how to avoid this ? -
DaRk_RaiN - 24.01.2013
I forgot i piece of code, try now
pawn Код:
public newbie_sendMsg(color,const string[])
{
for(new i = MIN_PLAYERID; i < MAX_PLAYERS_CURRENT+1; i++)
{
if(IsPlayerConnected(i))
{
if (pack_isAdmin(i,1) && PlayerVip[i][VipLevel] == 4 && PlayerInfo[i][pLevel] <= 18)
return SendClientMessage(i, color, string);
SendClientMessage(i, color, string);
else if (pack_isAdmin(i,1) && PlayerVip[i][VipLevel] == 4)
return SendClientMessage(i, color, string);
else if (PlayerVip[i][VipLevel] == 4 && PlayerInfo[i][pLevel] <= 18)
return SendClientMessage(i, color, string);
else if (pack_isAdmin(i,1) && PlayerInfo[i][pLevel] <= 18)
return SendClientMessage(i, color, string);
if (pack_isAdmin(i,1) || PlayerVip[i][VipLevel] == 4 || PlayerInfo[i][pLevel] <= 18)
{SendClientMessage(i, color, string);}
}
}
return 1;
}
Re : Re: Two chat lines, how to avoid this ? -
Kethrios - 24.01.2013
Quote:
Originally Posted by LarzI
Yeah okay, you use it "with that", but I want to see how, and where, you've put your function in the OP. I want to see how YOUR command is built up.
|
Actually the "With that" is my code, which I use for this public ^^
Re: Re : Re: Two chat lines, how to avoid this ? -
LarzI - 24.01.2013
Quote:
Originally Posted by Kethrios
Actually the "With that" is my code, which I use for this public ^^
|
... *sigh* Okay let me try again: You have a function in the OP, called newbie_sendMsg. This function is not used in the code you linked me to, thus making the function unused. I want to see the command USING the newbie_sendMsg function.
Re : Two chat lines, how to avoid this ? -
Kethrios - 24.01.2013
Oh ok :
pawn Код:
forward newbie_sendMsg(color,const string[]);
Re : Two chat lines, how to avoid this ? -
Kethrios - 25.01.2013
I tried some things, still have the same result, I really don't know what is wrong.