Vip chat
#1

i got a VIP chat give me the error i,
Код:
VIP.pwn(135) : error 017: undefined symbol "i"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
PHP код:
// This command is Vip Chat
COMMAND:v(playeridparams[])
{
    if(
Pinfo[i][VipLevel] >= 1)
    {
         new 
result[128];
         if(
sscanf(params,"s[128]",result))
         {
              
SendClientMessage(playerid0xFFFFFFFF"Usage: /a [message]");
         }
         else
         {
              new 
string[128],Name[MAX_PLAYER_NAME];
              
GetPlayerName(playerid,Name,sizeof(Name));
              
format(string,sizeof(string),"VIP-CHAT:%s (%d): %s",Name,playerid,result);
              foreach(
Player,i) if(Pinfo[i][VipLevel] >= 1SendClientMessage(i,0x00FF00FF,string);
         }
    }
    
// Let the server know that this was a valid command
    
return 1;

Reply
#2

pawn Код:
COMMAND:v(playerid, params[])
{
    if(Pinfo[playerid][VipLevel] >= 1)
    {
         new result[128];
         if(sscanf(params,"s[128]",result))
         {
              SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /a [message]");
         }
         else
         {
              new string[128],Name[MAX_PLAYER_NAME];
              GetPlayerName(playerid,Name,sizeof(Name));
              format(string,sizeof(string),"VIP-CHAT:%s (%d): %s",Name,playerid,result);
              foreach(Player,i) if(Pinfo[i][VipLevel] >= 1) SendClientMessage(i,0x00FF00FF,string);
         }
    }
    // Let the server know that this was a valid command
    return 1;
}
Reply
#3

Replace:
Код:
if(Pinfo[i][VipLevel] >= 1)
with
Код:
if(Pinfo[playerid][VipLevel] >= 1)
Reply
#4

For the vip chat don't work keep saying.
PHP код:
SendClientMessage(playerid0xFFFFFFFF"Usage: /v [message]"); 
full commmand


PHP код:
// This command is Vip Chat
COMMAND:v(playeridparams[])
{
    if(
Pinfo[playerid][VipLevel] >= 1)
    {
         new 
result[128];
         if(
sscanf(params,"s[128]",result))
         {
              
SendClientMessage(playerid0xFFFFFFFF"Usage: /v [message]");
         }
         else
         {
              new 
string[128],Name[MAX_PLAYER_NAME];
              
GetPlayerName(playerid,Name,sizeof(Name));
              
format(string,sizeof(string),"VIP-CHAT:%s (%d): %s",Name,playerid,result);
              foreach(
Player,i) if(Pinfo[playerid][VipLevel] >= 1SendClientMessage(i,0x00FF00FF,string);
         }
    }
    
// Let the server know that this was a valid command
    
return 1;

Reply
#5

Try this:
pawn Код:
COMMAND:v(playerid, params[])
{
    if(Pinfo[playerid][VipLevel] >= 1)
    {
        new result[128];
        if(!sscanf(params,"s[128]",result))
        {
            new string[128],Name[MAX_PLAYER_NAME];
            GetPlayerName(playerid,Name,sizeof(Name));
            format(string,sizeof(string),"VIP-CHAT:%s (%d): %s",Name,playerid,result);
            foreach (new i : Player)    
            {
                if(Pinfo[playerid][VipLevel] >= 1) SendClientMessage(i,0x00FF00FF,string);
            }
        }
        else SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /v [message]");
    }
    return 1;
}
EDIT: I changed something, try it AGAIN NOW.
Reply
#6

i got the foreach

PHP код:
#include <foreach> 
PHP код:
VIP.pwn(142) : error 017undefined symbol "foreach"
VIP.pwn(142) : error 029invalid expressionassumed zero
VIP
.pwn(142) : error 017undefined symbol "i"
(142) : fatal error 107too many error messages on one line
Compilation aborted
.Pawn compiler 3.2.3664              Copyright (c1997-2006ITB CompuPhase
4 Errors

Reply
#7

pawn Код:
COMMAND:v(playerid, params[])
{
    if(Pinfo[playerid][VipLevel] >= 1)
    {
        new result[128];
        if(!sscanf(params,"s[128]",result))
        {
            new string[128],Name[MAX_PLAYER_NAME];
            GetPlayerName(playerid,Name,sizeof(Name));
            format(string,sizeof(string),"VIP-CHAT:%s (%d): %s",Name,playerid,result);
            foreach (new i : Player)    
            {
                if(Pinfo[playerid][VipLevel] >= 1) SendClientMessage(i,0x00FF00FF,string);
            }
        }
        else SendClientMessage(playerid, 0xFFFFFFFF, "Usage: /v [message]");
    }
    return 1;
}
Enter this code and download foreach indlude and place the foreach.inc file in \pawno\include folder
Reply
#8

Dude,i got it Read dis....

http://forum.sa-mp.com/showpost.php?...27&postcount=6
Reply
#9

You obviously didn't placed the foreach.inc in the correct folder: \pawno\include
Reply
#10

-.-
i got foreach...
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)