V.I.P Chat Problem
#1

pawn Код:
// I dont post the full code..
public OnPlayerConnect(playerid)
{
    VipLogged[playerid]=0;

    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    VipLogged[playerid]=0;
    return 1;
}

public OnPlayerText(playerid, text[])
{
    if(text[0] == '$' && VipLogged[playerid] == 1 {
        new string[128]; GetPlayerName(playerid,string,sizeof(string));
        format(string,sizeof(string),"V.I.P Chat: %s: %s",string,text[1]); MessageToVips(green,string);
        return 0;
    }

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(vlogin,6,cmdtext);
    dcmd(vtune,5,cmdtext);
    dcmd(vmyip,5,cmdtext);
    dcmd(vinterior,9,cmdtext);
    dcmd(vfight,6,cmdtext);
    if (strcmp("/night", cmdtext, true, 10) == 0)
    if(VipLogged[playerid] == 1)
    {
        SetPlayerTime(playerid, 0,0);
        SendClientMessage(playerid, COLOR_RED, "Your Time Has Been Succesfully changed.");
        return 1;
    }
    if (strcmp("/morning", cmdtext, true, 10) == 0)
    if(VipLogged[playerid] == 1)
    {
        SetPlayerTime(playerid, 7,1);
        SendClientMessage(playerid, COLOR_RED, "Your time has been succesfully changed.");
        return 1;
}

and

public MessageToVips(color,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1) VipLogged[playerid] == 1) SendClientMessage(i, color, string);
    }
    return 1;
}
And im getting those errors
pawn Код:
C:\Users\Matthew\Desktop\vip.pwn(67) : warning 212: possibly unintended bitwise operation
C:\Users\Matthew\Desktop\vip.pwn(67) : error 029: invalid expression, assumed zero
C:\Users\Matthew\Desktop\vip.pwn(69) : error 004: function "MessageToVips" is not implemented
C:\Users\Matthew\Desktop\vip.pwn(73) : error 029: invalid expression, assumed zero
C:\Users\Matthew\Desktop\vip.pwn(73) : error 004: function "OnPlayerCommandText" is not implemented
C:\Users\Matthew\Desktop\vip.pwn(75) : error 017: undefined symbol "cmdtext"
C:\Users\Matthew\Desktop\vip.pwn(75) : error 029: invalid expression, assumed zero
C:\Users\Matthew\Desktop\vip.pwn(75) : warning 215: expression has no effect
C:\Users\Matthew\Desktop\vip.pwn(75) : error 001: expected token: ";", but found "]"
C:\Users\Matthew\Desktop\vip.pwn(75) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


8 Errors.
Edit : The Commands Working fine, But i'll try to add a VIP chat but i got that errors
Reply
#2

Anyone Please?
Reply
#3

please someone help...

I dont wanna spam but please answer my problem
Reply
#4

--->Bump<---
Reply
#5

This should work.


pawn Код:
// I dont post the full code..
public OnPlayerConnect(playerid)
{
    VipLogged[playerid]=0;

    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    VipLogged[playerid]=0;
    return 1;
}

public OnPlayerText(playerid, text[])
{
        if(text[0] == '$' && VipLogged[playerid] == 1
       {
        new string[128],pName[MAX_PLAYER_NAME];  GetPlayerName(playerid,pName,sizeof(pName));
        format(string,sizeof(string),"V.I.P Chat: %s: %s",pName,text[1]); MessageToVips(green,string);
       }
        return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(vlogin,6,cmdtext);
    dcmd(vtune,5,cmdtext);
    dcmd(vmyip,5,cmdtext);
    dcmd(vinterior,9,cmdtext);
    dcmd(vfight,6,cmdtext);
    if (strcmp("/night", cmdtext, true, 10) == 0)
   {
    if(VipLogged[playerid] == 1)
    {
        SetPlayerTime(playerid, 0,0);
        SendClientMessage(playerid, COLOR_RED, "Your Time Has Been Succesfully changed.");
        return 1;
    }
   }
    if (strcmp("/morning", cmdtext, true, 10) == 0)
    {
    if(VipLogged[playerid] == 1)
    {
        SetPlayerTime(playerid, 7,1);
        SendClientMessage(playerid, COLOR_RED, "Your time has been succesfully changed.");
        return 1;
     }
}

and

public MessageToVips(color,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1) VipLogged[playerid] == 1) SendClientMessage(i, color, string);
    }
    return 1;
}
Reply
#6

Quote:
Originally Posted by Mystique
Посмотреть сообщение
This should work.


pawn Код:
// I dont post the full code..
public OnPlayerConnect(playerid)
{
    VipLogged[playerid]=0;

    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    VipLogged[playerid]=0;
    return 1;
}

public OnPlayerText(playerid, text[])
{
        if(text[0] == '$' && VipLogged[playerid] == 1
       {
        new string[128],pName[MAX_PLAYER_NAME];  GetPlayerName(playerid,pName,sizeof(pName));
        format(string,sizeof(string),"V.I.P Chat: %s: %s",pName,text[1]); MessageToVips(green,string);
       }
        return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(vlogin,6,cmdtext);
    dcmd(vtune,5,cmdtext);
    dcmd(vmyip,5,cmdtext);
    dcmd(vinterior,9,cmdtext);
    dcmd(vfight,6,cmdtext);
    if (strcmp("/night", cmdtext, true, 10) == 0)
   {
    if(VipLogged[playerid] == 1)
    {
        SetPlayerTime(playerid, 0,0);
        SendClientMessage(playerid, COLOR_RED, "Your Time Has Been Succesfully changed.");
        return 1;
    }
   }
    if (strcmp("/morning", cmdtext, true, 10) == 0)
    {
    if(VipLogged[playerid] == 1)
    {
        SetPlayerTime(playerid, 7,1);
        SendClientMessage(playerid, COLOR_RED, "Your time has been succesfully changed.");
        return 1;
     }
}

and

public MessageToVips(color,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1) VipLogged[playerid] == 1) SendClientMessage(i, color, string);
    }
    return 1;
}
pawn Код:
C:\Users\Matthew\Desktop\vip.pwn(68) : error 029: invalid expression, assumed zero
C:\Users\Matthew\Desktop\vip.pwn(321) : error 017: undefined symbol "playerid"
C:\Users\Matthew\Desktop\vip.pwn(321) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


3 Errors.
The line 68 is { under If[Text...
And The line 321 is this if(IsPlayerConnected(i) == 1) VipLogged[playerid] == 1) SendClientMessage(i, color, string);
Reply
#7

pawn Код:
// I dont post the full code..
public OnPlayerConnect(playerid)
{
    VipLogged[playerid]=0;

    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    VipLogged[playerid]=0;
    return 1;
}

public OnPlayerText(playerid, text[])
{
        if(text[0] == '$' && VipLogged[playerid] == 1 )
       {
        new string[128],pName[MAX_PLAYER_NAME];  GetPlayerName(playerid,pName,sizeof(pName));
        format(string,sizeof(string),"V.I.P Chat: %s: %s",pName,text[1]); MessageToVips(green,string);
       }
        return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(vlogin,6,cmdtext);
    dcmd(vtune,5,cmdtext);
    dcmd(vmyip,5,cmdtext);
    dcmd(vinterior,9,cmdtext);
    dcmd(vfight,6,cmdtext);
    if (strcmp("/night", cmdtext, true, 10) == 0)
   {
    if(VipLogged[playerid] == 1)
    {
        SetPlayerTime(playerid, 0,0);
        SendClientMessage(playerid, COLOR_RED, "Your Time Has Been Succesfully changed.");
        return 1;
    }
   }
    if (strcmp("/morning", cmdtext, true, 10) == 0)
    {
    if(VipLogged[playerid] == 1)
    {
        SetPlayerTime(playerid, 7,1);
        SendClientMessage(playerid, COLOR_RED, "Your time has been succesfully changed.");
        return 1;
     }
}

and

public MessageToVips(color,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1) && VipLogged[i] == 1)
        {
        SendClientMessage(i, color, string);
        return true;
        }
    }
    return 1;
}
Reply
#8

There is missing a bracket. Before the "and":
Код:
return 0; }
would fix this problem.
Like this:
Код:
public OnPlayerConnect(playerid)
{
    VipLogged[playerid]=0;

    return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
    VipLogged[playerid]=0;
    return 1;
}

public OnPlayerText(playerid, text[])
{
        if(text[0] == '$' && VipLogged[playerid] == 1 )
       {
        new string[128];  GetPlayerName(playerid,string,sizeof string);
        format(string,sizeof(string),"V.I.P Chat: %s: %s",string,text[1]); MessageToVips(green,string);
       }
        return 0;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
    dcmd(vlogin,6,cmdtext);
    dcmd(vtune,5,cmdtext);
    dcmd(vmyip,5,cmdtext);
    dcmd(vinterior,9,cmdtext);
    dcmd(vfight,6,cmdtext);
    if (strcmp("/night", cmdtext, true, 10) == 0)
   {
    if(VipLogged[playerid] == 1)
    {
        SetPlayerTime(playerid, 0,0);
        SendClientMessage(playerid, COLOR_RED, "Your Time Has Been Succesfully changed.");
        return 1;
    }
   }
    if (strcmp("/morning", cmdtext, true, 10) == 0)
    {
    if(VipLogged[playerid] == 1)
    {
        SetPlayerTime(playerid, 7,1);
        SendClientMessage(playerid, COLOR_RED, "Your time has been succesfully changed.");
        return 1; 
     }
}
return 0;
}

public MessageToVips(color,const string[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) == 1) && VipLogged[i] == 1)
        {
        SendClientMessage(i, color, string);
        return true;
        }
    }
    return 1;
}
Reply
#9

Also you dont need to set VipLogged to 0 at OnPlayerDisconnect, because you already set it at OnPlayerConnect.
Reply
#10

pawn Код:
C:\Users\Matthew\Desktop\vip.pwn(322) : error 029: invalid expression, assumed zero
C:\Users\Matthew\Desktop\vip.pwn(322) : warning 215: expression has no effect
C:\Users\Matthew\Desktop\vip.pwn(322) : error 001: expected token: ";", but found ")"
C:\Users\Matthew\Desktop\vip.pwn(322) : error 029: invalid expression, assumed zero
C:\Users\Matthew\Desktop\vip.pwn(322) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase
4 Errors.
pawn Код:
Line 322         if(IsPlayerConnected(i) == 1) && VipLogged[i] == 1)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)