SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 18/05/2020, 05:27 PM   #1
SkolPlay
Big Clucker
 
Join Date: Aug 2016
Posts: 154
Reputation: 0
Default Bug sistema vip

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);
SkolPlay is offline   Reply With Quote
Old 18/05/2020, 05:40 PM   #2
XStormiest
Gangsta
 
Join Date: Jun 2012
Location: Continent: Europe, Country: Romania, City: Buzau
Posts: 558
Reputation: 46
Default Re: Bug sistema vip

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
__________________
XStormiest is offline   Reply With Quote
Old 18/05/2020, 06:12 PM   #3
SkolPlay
Big Clucker
 
Join Date: Aug 2016
Posts: 154
Reputation: 0
Default Re: Bug sistema vip

Quote:
Originally Posted by XStormiest View Post
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
SkolPlay is offline   Reply With Quote
Old 18/05/2020, 07:04 PM   #4
XStormiest
Gangsta
 
Join Date: Jun 2012
Location: Continent: Europe, Country: Romania, City: Buzau
Posts: 558
Reputation: 46
Default Re: Bug sistema vip

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;
}
__________________
XStormiest is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
[FilterScript] Sistema de Login/Registro com recuperação pelo email Sistema feito em mysql Marllun Lançamentos/Releases 15 11/11/2018 11:09 PM
[Pedido] Procuro um sistema de TDM (sistema de equipas SEM BUGS) SuperJesterPT Português/Portuguese 8 29/04/2015 05:43 PM
[Ajuda] Substituição sistema Regular para sistema VIP DexterBR Português/Portuguese 3 29/11/2012 10:56 PM
[Tutorial] Sistema de Registro + Profissão + Sistema de Administração Nake01 Lançamentos/Releases 19 02/03/2012 09:30 PM


All times are GMT. The time now is 03:19 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.