Problem declaring/calling a function
#1

Hello all, i wanted to make a function which sends a message to admins aka
PlayerInfo[playerid][pAdmin]>0
but error messages kept appearing.
ERROR MSG:
Quote:

C:\Users\moka\Desktop\PROG\03z\gamemodes\test.pwn( 364) : error 029: invalid expression, assumed zero
C:\Users\moka\Desktop\PROG\03z\gamemodes\test.pwn( 364) : warning 215: expression has no effect
C:\Users\moka\Desktop\PROG\03z\gamemodes\test.pwn( 364) : error 001: expected token: ";", but found ")"
C:\Users\moka\Desktop\PROG\03z\gamemodes\test.pwn( 364) : error 029: invalid expression, assumed zero
C:\Users\moka\Desktop\PROG\03z\gamemodes\test.pwn( 364) : fatal error 107: too many error messages on one line

This is a function, above OnGameModeInIt and under main()
PHP код:
forward SendAdminsMessage(playerid,string);
public 
SendAdminsMessage(playerid,string)
{
    foreach (new 
iPlayer)
    {
        if(
PlayerInfo[i][pAdmin])>0)
        
SendClientMessage(i,RED,chaine);
    }
    return 
1;

I tried the same thing with changing it from public to stock.
And Thanks.
Reply
#2

You got a bracket ')' too many.
pawn Код:
if(PlayerInfo[i][pAdmin]>0)
Reply
#3

Quote:

C:\Users\moka\Desktop\PROG\03z\gamemodes\test.pwn( 208) : error 035: argument type mismatch (argument 3)
C:\Users\moka\Desktop\PROG\03z\gamemodes\test.pwn( 548) : error 035: argument type mismatch (argument 1)
C:\Users\moka\Desktop\PROG\03z\gamemodes\test.pwn( 550) : error 017: undefined symbol "ServerInfo"
C:\Users\moka\Desktop\PROG\03z\gamemodes\test.pwn( 550) : warning 215: expression has no effect
C:\Users\moka\Desktop\PROG\03z\gamemodes\test.pwn( 550) : error 001: expected token: ";", but found "]"
C:\Users\moka\Desktop\PROG\03z\gamemodes\test.pwn( 550) : error 029: invalid expression, assumed zero
C:\Users\moka\Desktop\PROG\03z\gamemodes\test.pwn( 550) : fatal error 107: too many error messages on one line

PHP код:
forward SendAdminsMessage(playerid,string);
public 
SendAdminsMessage(playerid,string)
{
    foreach (new 
iPlayer)
    {
        if(
PlayerInfo[i][pAdmin]>0)
        
SendClientMessage(i,RED,string);
    }
    return 
1;

Reply
#4

pawn Код:
forward SendAdminsMessage(playerid,string[]);
public SendAdminsMessage(playerid,string[])
{
    foreach (new i: Player)
    {
        if(PlayerInfo[i][pAdmin]>0)
        SendClientMessage(i,RED,string);
    }
    return 1;
}
Reply
#5

Thank you very much Schneider.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)