public OnPlayerText(playerid, text[])
{
if (APlayerData[playerid][PlayerLevel] >= 1)
{
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]{FFFF00}[ADM]{FFFFFF}diz: %s", pname, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
if (APlayerData[playerid][PlayerLevel] <= 0)
{
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]diz: %s", pname, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
return 0;
}
new text[50];
if(APlayerData[playerid][PlayerLevel] == 1) text = "Moderador";
if(APlayerData[playerid][PlayerLevel] == 2) text = "Cargo;
ai vai indo
pawn Код:
ai vc adiciona %s no format e poe texto no final '-' Grato |
public OnPlayerText(playerid, text[])
{
if (APlayerData[playerid][PlayerLevel] >= 1)
{
new texto[20];
if (APlayerData[playerid][PlayerLevel] == 1) texto= "Moderador";
if (APlayerData[playerid][PlayerLevel] == 2) texto = "Auxiliar";
if (APlayerData[playerid][PlayerLevel] == 3) texto= "Nome";
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]{FFFF00}Cargo[%s]{FFFFFF}diz: %s", pname, playerid,texto, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
if (APlayerData[playerid][PlayerLevel] <= 0)
{
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]diz: %s", pname, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
return 0;
}
public OnPlayerText(playerid, text[])
{
if (APlayerData[playerid][PlayerLevel] >= 1)
{
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]{FFFF00}[ADM-%d]{FFFFFF}diz: %s", pname, playerid, APlayerData[playerid][PlayerLevel],text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
if (APlayerData[playerid][PlayerLevel] <= 0)
{
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]diz: %s", pname, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
return 0;
}
public OnPlayerText(playerid, text[]) {
static
string[128],
name[24];
GetPlayerName(playerid, name, sizeof name);
if(APlayerData[playerid][PlayerLevel] < 1)
format(string, sizeof(string), "%s [ID: %i] diz: %s", name, playerid, text);
else
format(string, sizeof(string), "%s [ID: %i] [ADM - %i] diz: %s", name, playerid, APlayerData[playerid][PlayerLevel], text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
return 0;
}
if (APlayerData[playerid][PlayerLevel] >= 1)
{
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]{FFFF00}[ADM-%d]{FFFFFF}diz: %s", pname, playerid,APlayerData[playerid][PlayerLevel], text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
if (APlayerData[playerid][PlayerLevel] <= 0)
{
new string[256], pname[MAX_PLAYER_NAME];
GetPlayerName(playerid, pname, sizeof(pname));
format(string, sizeof(string), "%s[ID:%d]diz: %s", pname, playerid, text);
SendClientMessageToAll(GetPlayerColor(playerid), string);
}
return 0;
}
Obrigado a todos que ajudaram, acabei vendo os cуdigos e pensei em uma forma melhor de usa-lo:
Atualizando a minha variбvel de acordo com meu sv pawn Код:
|
if (APlayerData[playerid][PlayerLevel] == 0)
SetPlayerChatBubble(playerid, text, Vermelho, 50.0, 10000);
if(dini_Int(file,"Admin") == 1)
{
new stringv[128];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
format(stringv, sizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}MOD{00FF00}]{00FFFF} %s",pname,playerid,text);
SendClientMessageToAll(GetPlayerColor(playerid),stringv);
return 0;
}
if(dini_Int(file,"Admin") == 2)
{
new stringv[128];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
format(stringv, sizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}SUPERMOD{00FF00}]{00FFFF} %s",pname,playerid,text);
SendClientMessageToAll(GetPlayerColor(playerid),stringv);
return 0;
}
if(dini_Int(file,"Admin") == 3)
{
new stringv[128];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
format(stringv, sizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}ADM{00FF00}]{00FFFF} %s",pname,playerid,text);
SendClientMessageToAll(GetPlayerColor(playerid),stringv);
return 0;
}
if(dini_Int(file,"Admin") == 4)
{
new stringv[128];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
format(stringv, sizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}SUBDONO{00FF00}]{00FFFF} %s",pname,playerid,text);
SendClientMessageToAll(GetPlayerColor(playerid),stringv);
return 0;
}
if(dini_Int(file,"Admin") == 5)
{
new stringv[128];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
format(stringv, sizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}DONO{00FF00}]{00FFFF} %s",pname,playerid,text);
SendClientMessageToAll(GetPlayerColor(playerid),stringv);
return 0;
}
if(dini_Int(file,"VIP") == 1)
{
new stringv[128];
new pname[MAX_PLAYER_NAME];
GetPlayerName(playerid,pname,sizeof(pname));
format(stringv, sizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}VIP{00FF00}]{00FFFF} %s",pname,playerid,text);
SendClientMessageToAll(GetPlayerColor(playerid),stringv);
return 0;
}
if(Chatlb == 1)
{
format(string, sizeof(string), "[ID: %d] {00FF00}[{FF0000}JOGADOR{00FF00}]{00FFFF} %s", playerid, text);
SendPlayerMessageToAll(playerid, string);
}
else
{
ChatProximo(playerid, text);
}
return 0;
}
SetPlayerChatBubble(playerid, text, Vermelho, 50.0, 10000); if(dini_Int(file,"pAdmin") == 1) { new stringv[128]; new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid,pname,sizeof(pname)); format(stringv, sizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}MOD{00FF00}]{00FFFF} %s",pname,playerid,text); SendClientMessageToAll(GetPlayerColor(playerid),stringv); return 0; } if(dini_Int(file,"pAdmin") == 2) { new stringv[128]; new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid,pname,sizeof(pname)); format(stringv, sizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}SUPERMOD{00FF00}]{00FFFF} %s",pname,playerid,text); SendClientMessageToAll(GetPlayerColor(playerid),stringv); return 0; } if(dini_Int(file,"pAdmin") == 3) { new stringv[128]; new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid,pname,sizeof(pname)); format(stringv, sizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}ADM{00FF00}]{00FFFF} %s",pname,playerid,text); SendClientMessageToAll(GetPlayerColor(playerid),stringv); return 0; } if(dini_Int(file,"pAdmin") == 4) { new stringv[128]; new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid,pname,sizeof(pname)); format(stringv, sizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}SUBDONO{00FF00}]{00FFFF} %s",pname,playerid,text); SendClientMessageToAll(GetPlayerColor(playerid),stringv); return 0; } if(dini_Int(file,"pAdmin") == 5) { new stringv[128]; new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid,pname,sizeof(pname)); format(stringv, sizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}DONO{00FF00}]{00FFFF} %s",pname,playerid,text); SendClientMessageToAll(GetPlayerColor(playerid),stringv); return 0; } if(dini_Int(file,"VIP") == 1) { new stringv[128]; new pname[MAX_PLAYER_NAME]; GetPlayerName(playerid,pname,sizeof(pname)); format(stringv, sizeof(stringv), "%s [ID: %d] {00FF00}[{FF0000}VIP{00FF00}]{00FFFF} %s",pname,playerid,text); SendClientMessageToAll(GetPlayerColor(playerid),stringv); return 0; } if(Chatlb == 1) { format(string, sizeof(string), "[ID: %d] {00FF00}[{FF0000}JOGADOR{00FF00}]{00FFFF} %s", playerid, text); SendPlayerMessageToAll(playerid, string); } else { ChatProximo(playerid, text); } return 0; }