Bug sistema vip -
SkolPlay - 18.05.2020
Bom eu criei um sistema, onde o VIP tem privilegio de uma mensagem de outra cor ao falar no chat global, mas se ele escrever uma mensagem muito grande nгo fica com a cor que botei, fica somente a metade da mensagem
pawn Code:
if(Vip[playerid] != 0) format(string,sizeof(string), "{FFFFFF}[%d] [{FF0000}VIP{FFFFFF}] {0080FF}%s", playerid, text);
Re: Bug sistema vip -
XStormiest - 18.05.2020
Firstly, please use the correct section of this forum as this is the English section.
Por favor, use a seзгo correta deste fуrum, pois esta й a seзгo em inglкs.
Uma mensagem pode aceitar atй 256 caracteres
Re: Bug sistema vip -
SkolPlay - 18.05.2020
Quote:
Originally Posted by XStormiest
Firstly, please use the correct section of this forum as this is the English section.
Por favor, use a seзгo correta deste fуrum, pois esta й a seзгo em inglкs.
Uma mensagem pode aceitar atй 256 caracteres
|
Sorry, I didn't know you had it here.
But you know how to solve this problem, the person can speak up to 60 characters
Re: Bug sistema vip -
XStormiest - 18.05.2020
The maximum characters that OnPlayerText allows are 256.
ID cannot be more than 1000 which means 4 characters at max.
Your text length is about 49 characters.
I'm assuming you want to create so that when a player speaks as a VIP, a message is send that notes he's a vip.
the below code is an example of how to create a chat for VIPs.
So you need to do something like this:
Code:
public OnPlayerText(playerid, text[])
{
if(Vip[playerid] > 0)
{
if(strcmp(text[0], "#", false) == 0) // the sign to use to text, example # I'm a V.I.P
{
new message[307];
new name[24];
GetPlayerName(playerid, name, sizeof(name));
format(message, sizeof(message), "{FFFFFF}[%d] [{FF0000}VIP{FFFFFF}] {0080FF}%s", playerid, text[1]);
for(new player = 0; player < MAX_PLAYERS; player++)
{
if(IsPlayerConnected(player) && Vip[player] == 1) SendClientMessage(player, color, message);
}
return 0;
}
}
return 1;
}
If however, you want so that all players are able to see his message, you need to do something like this
Code:
public OnPlayerText(playerid, text[])
{
if(Vip[playerid] > 0)
{
new message[307];
new name[24];
GetPlayerName(playerid, name, sizeof(name));
format(message, sizeof(message), "{FFFFFF}[%d] [{FF0000}VIP{FFFFFF}] {0080FF}%s", playerid, text[1]);
SendClientMessageToAll(color, message);
return 0;
}
return 1;
}