SA-MP Forums Archive
Vip chat - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: Vip chat (/showthread.php?tid=428704)



Vip chat - DerickClark - 06.04.2013

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;




Re: Vip chat - HurtLocker - 06.04.2013

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;
}



Re: Vip chat - Edvin - 06.04.2013

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



Re: Vip chat - DerickClark - 06.04.2013

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;




Re: Vip chat - HurtLocker - 06.04.2013

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.


Re: Vip chat - DerickClark - 06.04.2013

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




Re: Vip chat - HurtLocker - 06.04.2013

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


Re: Vip chat - DerickClark - 06.04.2013

Dude,i got it Read dis....

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


Re: Vip chat - HurtLocker - 06.04.2013

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


Re: Vip chat - DerickClark - 06.04.2013

-.-
i got foreach...