OnPlayerText VIP tag error
#1

Guys,
Im having a problem with the OnPlayerText. Im trying to add, If player is VIP. So he gets this tag and etc. But im getting this error. Im blanking a bit. If somebody can kindly help me please.

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), "[VIP]%s[%d]: [V.I.P] - ( %s )",playername, playerid, text);
    SendClientMessageToAll(-1, string);
    return 0;
   
    }
        else
    {
   
    if(muted[playerid] == 1)
    {
        SendClientMessage(playerid,-1,"ERROR:Your muted.");
        return 0;
    }
    return 1;
}
Reply
#2

PHP код:
public OnPlayerText(playerid,text[])
{
    if(
PlayerInfo[playerid][pVIPLevel] > 0)
    {
        new 
string[128], playername[MAX_PLAYER_NAME];
        
GetPlayerName(playeridplayernamesizeof(playername));
        
format(stringsizeof(string), "[VIP]%s[%d]: [V.I.P] - ( %s )",playernameplayeridtext);
        
SendClientMessageToAll(-1string);
        return 
0;
    }
    if(
muted[playerid] == 1)
    {
        
SendClientMessage(playerid,-1,"ERROR:Your muted.");
        return 
0;
    }
    return 
1;

Reply
#3

You missed a bracket to close the if statmen but just do this
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), "[VIP]%s[%d]: [V.I.P] - ( %s )",playername, playerid, text);
    SendClientMessageToAll(-1, string);
    return 0;
    }else if(muted[playerid] == 1){
        SendClientMessage(playerid,-1,"ERROR:Your muted.");
        return 0;
    }
    return 1;
}
Reply
#4

Thanks bro! +REP
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)