OnPlayerText doesnt work help -
Threshold - 03.12.2012
Guys,
I made a VIP tag for VIP players so when they chat its known that they are VIP. But it doesnt work. The only way to make it work is when i log into RCON and unload then load the script. But then it works, BUT, Then the vip commands dont. Something weird help.
pawn Код:
public OnPlayerText(playerid,text[])
{
if(PlayerInfo[playerid][pVIPLevel] < 1) {
new string[128], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "{00FFFF}[VIP] {FFFF00}- %s[%d]: {00FF40}- ( {FF00FF}%s {00FF40})",playername, playerid, text);
SendClientMessageToAll(0xFF0000C8, string);
return 0;
}else if(muted[playerid] == 1){
SendClientMessage(playerid,-1,"ERROR:Your muted.");
return 0;
}
return 1;
}
Re: OnPlayerText doesnt work help -
WoodPecker - 03.12.2012
Try this one:
pawn Код:
public OnPlayerText(playerid,text[])
{
if(PlayerInfo[playerid][pVIPLevel] > 1)
{
new string[128], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "{00FFFF}[VIP] {FFFF00}- %s[%d]: {00FF40}- ( {FF00FF}%s {00FF40})",playername, playerid, text);
SendClientMessageToAll(0xFF0000C8, string);
return 0;
}
else if(muted[playerid] == 1)
{
SendClientMessage(playerid,-1,"ERROR:Your muted.");
return 0;
}
return 1;
}
Re: OnPlayerText doesnt work help -
zSuYaNw - 03.12.2012
Test it:
pawn Код:
public OnPlayerText(playerid,text[])
{
if(muted[playerid] == 1)
return SendClientMessage(playerid,-1,"ERROR:Your muted."), false;
if(PlayerInfo[playerid][pVIPLevel] < 1)
{
static
string[128], playername[24]
;
format(string, sizeof(string), "{00FFFF}[VIP] {FFFF00}- %s[%d]: {00FF40}- ( {FF00FF}%s {00FF40})",(GetPlayerName(playerid, playername, 24), playername), playerid, text);
SendClientMessageToAll(0xFF0000C8, string);
return 0;
}
return 1;
}
Re: OnPlayerText doesnt work help -
Threshold - 03.12.2012
None worked
Re: OnPlayerText doesnt work help -
WoodPecker - 03.12.2012
What VIP level are you on your server?
Re: OnPlayerText doesnt work help -
zSuYaNw - 03.12.2012
pawn Код:
public OnPlayerText(playerid,text[])
{
if(muted[playerid] == 1)
return SendClientMessage(playerid,-1,"ERROR:Your muted."), false;
static
string[200], playername[24]
;
if(PlayerInfo[playerid][pVIPLevel] < 1)
{
format(string, sizeof(string), "{00FFFF}[VIP] {FFFF00}- %s[%d]: {00FF40}- ( {FF00FF}%s {00FF40})",(GetPlayerName(playerid, playername, 24), playername), playerid, text);
SendClientMessageToAll(0xFF0000C8, string);
return 0;
}
format(string, 200, "%s[ID:%i]: %s",(GetPlayerName(playerid, playername, 24), playername), playerid, text);
SendClientMessageToAll(0xFF0000C8, string);
return false;
}
Re: OnPlayerText doesnt work help -
Threshold - 03.12.2012
Theres only 1 VIP level. But! If i unload then reload the vipscript. Then it works.
Re: OnPlayerText doesnt work help -
Threshold - 03.12.2012
That didnt work.
Re: OnPlayerText doesnt work help -
WoodPecker - 04.12.2012
Try this one:
pawn Код:
public OnPlayerText(playerid,text[])
{
if(PlayerInfo[playerid][pVIPLevel] == 1)
{
new string[128], playername[MAX_PLAYER_NAME];
GetPlayerName(playerid, playername, sizeof(playername));
format(string, sizeof(string), "{00FFFF}[VIP] {FFFF00}- %s[%d]: {00FF40}- ( {FF00FF}%s {00FF40})",playername, playerid, text);
SendClientMessageToAll(0xFF0000C8, string);
return 0;
}
else if(muted[playerid] == 1)
{
SendClientMessage(playerid,-1,"ERROR:Your muted.");
return 0;
}
return 1;
}
Re: OnPlayerText doesnt work help -
Threshold - 04.12.2012
Yes! It worked! All day ive been trying to solve this! +REP 2x