[AJUDA] Onplayertext
#1

Boa noite,
Gostaria de colocar neste Onplayertext do meu FS, um "[VIP]" antes do nick ou antes da mensagem do jogador VIP.
E que isso funcione sem nenhum comando antes, apenas ao digitar a mensagem sugiria:

[VIP] Player: texto
ou
Player [VIP]: texto

public OnPlayerText(playerid, text[]){
if(text[0] == '@') {
new string[256];
new name[24];
GetPlayerName(playerid, name, 24);
format(string, sizeof(string), "[VIP CHAT] [%d] %s: %s", playerid, name, text[1]);
for(new i = 0; i < MAX_PLAYERS; i++) {
if(IsPlayerConnected(i)) {
if(vip[i] == vip[playerid])
SendClientMessage(i, GetPlayerColor(playerid), string);

format(string, sizeof(string), "[VIP] %s", text);
SendPlayerMessageToAll(playerid,string);
return false;
}
}
return 0;
}

return 1;
}


Para mais informaзхes do FS que estou querendo colocar, abaixo estб o link dele:

http://pastebin.com/YPTjGd5Q


Grato.
Reply
#2

Em OnPlayerText.
pawn Код:
if(vip(playerid) >= 1)//Aqui se ele for Vip.
{
new str[10];
format(str, 256, "[VIP]: %s", text);
SendPlayerMessageToAll(playerid,str);
}
else//E se ele nгo for...
{
new str[10];
format(str, 256, ": %s", playerid, text);
SendPlayerMessageToAll(playerid,str);
return 0;//Deixe 0 Para nгo aparecer 2 mensagens no Chat.
}
espero ter ajudado
Reply
#3

Valeu moзo =D
Reply
#4

: error 012: invalid function call, not a valid address
: warning 215: expression has no effect
: error 001: expected token: ";", but found ")"
: error 029: invalid expression, assumed zero
: fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.


omg
Reply
#5

posta a linha anterior а linha que aparece no erro
Reply
#6

Em toda parte do comando ONPLAYERTEXT que eu tento colocar, o erro da na linha anterior do comando que me passaram:

if(vip(playerid) >= 1)//Aqui se ele for Vip.
Reply
#7

Corrigindo: O erro da na propria linha "if(vip(playerid) >= 1)//Aqui se ele for Vip."
Reply
#8

Alguem ajuda ?
Reply
#9

troca por

pawn Код:
if (PlayerInfo[playerid][vip] >= 1)
Reply
#10

Ow
pawn Код:
if(vip[playerid] >= 1)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)