[Ajuda] invalid function call, not a valid address
#1

Estou com esse problema ao tentar colocar o comando dentro do gm

Код:
C:\Users\William\Desktop\teste\gamemodes\teste.pwn(11270) : error 012: invalid function call, not a valid address
C:\Users\William\Desktop\teste\gamemodes\teste.pwn(11270) : warning 215: expression has no effect
C:\Users\William\Desktop\teste\gamemodes\teste.pwn(11270) : error 001: expected token: ";", but found ")"
C:\Users\William\Desktop\teste\gamemodes\teste.pwn(11270) : error 029: invalid expression, assumed zero
C:\Users\William\Desktop\teste\gamemodes\teste.pwn(11270) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
PHP код:
CMD:ban(playerid,params[]) {
            new 
strdate[128],strtime[128], tmp[256], tmp2[256], Index;        tmp strtok(params,Index), tmp2 strtok(params,Index);
            if(!
strlen(params)) return SendClientMessage(playerid0xDC143CAA"USAGE: /ban [playerid] [reason]");
            if(!
strlen(tmp2)) return SendClientMessage(playerid0xDC143CAA"ERROR: You must give a reason");
              new 
player1ip[128], string[128];
            
player1 strval(tmp);
             if(
IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && !IsPlayerAdmin(player1)) {
                
GetPlayerIp(player1,ip,sizeof(ip));
                new 
ano,mes,dia,hora,minuto,segundogetdate(anomesdia); gettime(hora,minuto,segundo); 
    
/*linha do erro*/ format(string,sizeof(string),"|- %s foi banido pelo Administrador %s [Motivo: %s] [Data: %d/%d/%d] [Hora: %d:%d] -|",pName(player1),pName(playerid),params[2],dia,mes,ano,hora,minuto);
                
SendClientMessageToAll(COLOR_Silver,string);
                print(string);
                
format(strdatesizeof(strdate), "%d-%d-%d ",year,month,day);
                
format(strtime,sizeof(strtime),"%d:%d:%d",hour,minuite,second);
                new 
Query[250];
                
format(Querysizeof(Query), "UPDATE `banneds` SET `ip` = '%s', `date` = '%s', `time` = '%s', `bannedby` = '%s', `banned` = '%d', `reason` = '%s' WHERE `name` = '%s'"ip,strdate,strtime,pName(playerid),1,params[2],pName(player1));
                
mysql_tquery(mysqlQuery""""); totalbans ++;
                
format(Querysizeof(Query),"INSERT INTO `bannedips`(`ip`) VALUES ('%s')",ip);
                
mysql_tquery(mysqlQuery""""); totalip ++;
                return 
SetTimerEx("kickplayer"500false"i"player1);
             } else return 
SendClientMessage(playerid0xDC143CAA"Player is not connected or is yourself or is the highest level admin");

Reply
#2

pawn Код:
CMD:ban(playerid,params[]) {
            new strdate[128],strtime[128], tmp[256], tmp2[256], Index;        tmp = strtok(params,Index), tmp2 = strtok(params,Index);
            if(!strlen(params)) return SendClientMessage(playerid, 0xDC143CAA, "USAGE: /ban [playerid] [reason]");
            if(!strlen(tmp2)) return SendClientMessage(playerid, 0xDC143CAA, "ERROR: You must give a reason");
              new player1, ip[128], string[128];
            player1 = strval(tmp);

             if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && !IsPlayerAdmin(player1)) {
                GetPlayerIp(player1,ip,sizeof(ip));
                new ano,mes,dia,hora,minuto,segundo; getdate(ano, mes, dia); gettime(hora,minuto,segundo);
                format(string,sizeof(string),"|- %s foi banido pelo Administrador %s [Motivo: %s] [Data: %d/%d/%d] [Hora: %d:%d] -|",pName(player1),pName(playerid),params[2],dia,mes,ano,hora,minuto));
                SendClientMessageToAll(COLOR_Silver,string);

                print(string);
                format(strdate, sizeof(strdate), "%d-%d-%d ",year,month,day);
                format(strtime,sizeof(strtime),"%d:%d:%d",hour,minuite,second);

                new Query[250];
                format(Query, sizeof(Query), "UPDATE `banneds` SET `ip` = '%s', `date` = '%s', `time` = '%s', `bannedby` = '%s', `banned` = '%d', `reason` = '%s' WHERE `name` = '%s'", ip,strdate,strtime,pName(playerid),1,params[2],pName(player1));
                mysql_tquery(mysql, Query, "", ""); totalbans ++;
                format(Query, sizeof(Query),"INSERT INTO `bannedips`(`ip`) VALUES ('%s')",ip);
                mysql_tquery(mysql, Query, "", ""); totalip ++;
                return SetTimerEx("kickplayer", 500, false, "i", player1);
             } else return SendClientMessage(playerid, 0xDC143CAA, "Player is not connected or is yourself or is the highest level admin");
}
Tenta ai.
Reply
#3

Quote:
Originally Posted by Jorgeeee
Посмотреть сообщение
pawn Код:
CMD:ban(playerid,params[]) {
            new strdate[128],strtime[128], tmp[256], tmp2[256], Index;        tmp = strtok(params,Index), tmp2 = strtok(params,Index);
            if(!strlen(params)) return SendClientMessage(playerid, 0xDC143CAA, "USAGE: /ban [playerid] [reason]");
            if(!strlen(tmp2)) return SendClientMessage(playerid, 0xDC143CAA, "ERROR: You must give a reason");
              new player1, ip[128], string[128];
            player1 = strval(tmp);

             if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && !IsPlayerAdmin(player1)) {
                GetPlayerIp(player1,ip,sizeof(ip));
                new ano,mes,dia,hora,minuto,segundo; getdate(ano, mes, dia); gettime(hora,minuto,segundo);
                format(string,sizeof(string),"|- %s foi banido pelo Administrador %s [Motivo: %s] [Data: %d/%d/%d] [Hora: %d:%d] -|",pName(player1),pName(playerid),params[2],dia,mes,ano,hora,minuto));
                SendClientMessageToAll(COLOR_Silver,string);

                print(string);
                format(strdate, sizeof(strdate), "%d-%d-%d ",year,month,day);
                format(strtime,sizeof(strtime),"%d:%d:%d",hour,minuite,second);

                new Query[250];
                format(Query, sizeof(Query), "UPDATE `banneds` SET `ip` = '%s', `date` = '%s', `time` = '%s', `bannedby` = '%s', `banned` = '%d', `reason` = '%s' WHERE `name` = '%s'", ip,strdate,strtime,pName(playerid),1,params[2],pName(player1));
                mysql_tquery(mysql, Query, "", ""); totalbans ++;
                format(Query, sizeof(Query),"INSERT INTO `bannedips`(`ip`) VALUES ('%s')",ip);
                mysql_tquery(mysql, Query, "", ""); totalip ++;
                return SetTimerEx("kickplayer", 500, false, "i", player1);
             } else return SendClientMessage(playerid, 0xDC143CAA, "Player is not connected or is yourself or is the highest level admin");
}
Tenta ai.
Deu na mesma.
Reply
#4

Nгo testei mais ve se pega

PHP код:
CMD:ban(playerid,params[]) {
            new 
strdate[128],strtime[128], tmp[256], tmp2[256], Index;        tmp strtok(params,Index), tmp2 strtok(params,Index);
            if(!
strlen(params)) return SendClientMessage(playerid0xDC143CAA"USAGE: /ban [playerid] [reason]");
            if(!
strlen(tmp2)) return SendClientMessage(playerid0xDC143CAA"ERROR: You must give a reason");
              new 
player1ip[128], string[128];
            
player1 strval(tmp);

             if(
IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && !IsPlayerAdmin(player1)) {
                
GetPlayerIp(player1,ip,sizeof(ip));
                new 
ano,mes,dia,hora,minuto,segundogetdate(anomesdia); gettime(hora,minuto,segundo);
                
format(string,sizeof(string),"|- %s foi banido pelo Administrador %s [Motivo: %s] [Data: %d/%d/%d] [Hora: %d:%d] -|",pName(player1),pName(playerid),tmp2,dia,mes,ano,hora,minuto);
                
SendClientMessageToAll(COLOR_Silver,string);

                print(string);
                
format(strdatesizeof(strdate), "%d-%d-%d ",year,month,day);
                
format(strtime,sizeof(strtime),"%d:%d:%d",hour,minuite,second);

                new 
Query[250];
                
format(Querysizeof(Query), "UPDATE `banneds` SET `ip` = '%s', `date` = '%s', `time` = '%s', `bannedby` = '%s', `banned` = '%d', `reason` = '%s' WHERE `name` = '%s'"ip,strdate,strtime,pName(playerid),1,params[2],pName(player1));
                
mysql_tquery(mysqlQuery""""); totalbans ++;
                
format(Querysizeof(Query),"INSERT INTO `bannedips`(`ip`) VALUES ('%s')",ip);
                
mysql_tquery(mysqlQuery""""); totalip ++;
                return 
SetTimerEx("kickplayer"500false"i"player1);
             } else return 
SendClientMessage(playerid0xDC143CAA"Player is not connected or is yourself or is the highest level admin");

Reply
#5

Quote:
Originally Posted by RedMF
Посмотреть сообщение
Nгo testei mais ve se pega

PHP код:
CMD:ban(playerid,params[]) {
            new 
strdate[128],strtime[128], tmp[256], tmp2[256], Index;        tmp strtok(params,Index), tmp2 strtok(params,Index);
            if(!
strlen(params)) return SendClientMessage(playerid0xDC143CAA"USAGE: /ban [playerid] [reason]");
            if(!
strlen(tmp2)) return SendClientMessage(playerid0xDC143CAA"ERROR: You must give a reason");
              new 
player1ip[128], string[128];
            
player1 strval(tmp);
             if(
IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && !IsPlayerAdmin(player1)) {
                
GetPlayerIp(player1,ip,sizeof(ip));
                new 
ano,mes,dia,hora,minuto,segundogetdate(anomesdia); gettime(hora,minuto,segundo);
                
format(string,sizeof(string),"|- %s foi banido pelo Administrador %s [Motivo: %s] [Data: %d/%d/%d] [Hora: %d:%d] -|",pName(player1),pName(playerid),tmp2,dia,mes,ano,hora,minuto);
                
SendClientMessageToAll(COLOR_Silver,string);
                print(string);
                
format(strdatesizeof(strdate), "%d-%d-%d ",year,month,day);
                
format(strtime,sizeof(strtime),"%d:%d:%d",hour,minuite,second);
                new 
Query[250];
                
format(Querysizeof(Query), "UPDATE `banneds` SET `ip` = '%s', `date` = '%s', `time` = '%s', `bannedby` = '%s', `banned` = '%d', `reason` = '%s' WHERE `name` = '%s'"ip,strdate,strtime,pName(playerid),1,params[2],pName(player1));
                
mysql_tquery(mysqlQuery""""); totalbans ++;
                
format(Querysizeof(Query),"INSERT INTO `bannedips`(`ip`) VALUES ('%s')",ip);
                
mysql_tquery(mysqlQuery""""); totalip ++;
                return 
SetTimerEx("kickplayer"500false"i"player1);
             } else return 
SendClientMessage(playerid0xDC143CAA"Player is not connected or is yourself or is the highest level admin");

Deu os mesmos erros, eu acho que nгo й ali o erro, mas eu nгo entendo, nгo acho o que esteja errado..
Reply
#6

Acho que isso aqui deve resolver seu problema

PHP код:
CMD:ban(playerid,params[])
{
    new 
strdate[128],strtime[128], tmp[256], tmp2[256], Index;        tmp strtok(params,Index), tmp2 strtok(params,Index);
    if(!
strlen(params)) return SendClientMessage(playerid0xDC143CAA"USAGE: /ban [playerid] [reason]");
    if(!
strlen(tmp2)) return SendClientMessage(playerid0xDC143CAA"ERROR: You must give a reason");
    new 
player1ip[128], string[128];
    
player1 strval(tmp);
    if(
IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && !IsPlayerAdmin(player1))
    {
        
GetPlayerIp(player1,ip,sizeof(ip));
        new 
ano,mes,dia,hora,minuto,segundo,PlayerNome[24],PlayerNome2[24]; getdate(anomesdia); gettime(hora,minuto,segundo);
        
GetPlayerName(player1PlayerNome24); GetPlayerName(playeridPlayerNome224);
        
format(string,sizeof(string),"|- %s foi banido pelo Administrador %s [Motivo: %s] [Data: %d/%d/%d] [Hora: %d:%d] -|",PlayerNome,PlayerNome2,tmp2,dia,mes,ano,hora,minuto);
        
SendClientMessageToAll(COLOR_Silver,string);
        print(string);
        
format(strdatesizeof(strdate), "%d-%d-%d ",year,month,day);
        
format(strtime,sizeof(strtime),"%d:%d:%d",hour,minuite,second);
        new 
Query[250];
        
format(Querysizeof(Query), "UPDATE `banneds` SET `ip` = '%s', `date` = '%s', `time` = '%s', `bannedby` = '%s', `banned` = '%d', `reason` = '%s' WHERE `name` = '%s'"ip,strdate,strtime,pName(playerid),1,params[2],pName(player1));
        
mysql_tquery(mysqlQuery""""); totalbans ++;
        
format(Querysizeof(Query),"INSERT INTO `bannedips`(`ip`) VALUES ('%s')",ip);
        
mysql_tquery(mysqlQuery""""); totalip ++;
        
SetTimerEx("kickplayer"500false"i"player1);
    }
    else
    {
    
SendClientMessage(playerid0xDC143CAA"Player is not connected or is yourself or is the highest level admin");
    }
    return 
1;

Reply
#7

Infelizmente nada resolve..
Reply
#8

PHP код:
CMD:ban(playerid,params[])
{
    new 
strdate[128],strtime[128], tmp[256], tmp2[256], Index;        tmp strtok(params,Index), tmp2 strtok(params,Index);
    if(!
strlen(params)) return SendClientMessage(playerid0xDC143CAA"USAGE: /ban [playerid] [reason]");
    if(!
strlen(tmp2)) return SendClientMessage(playerid0xDC143CAA"ERROR: You must give a reason");
    new 
player1ip[128], string[128];
    
player1 strval(tmp);
    if(
IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID && player1 != playerid && !IsPlayerAdmin(player1))
    {
        
GetPlayerIp(player1,ip,sizeof(ip));
        new 
ano,mes,dia,hora,minuto,segundo,PlayerNome[24],PlayerNome2[24];
        
getdate(anomesdia);
        
gettime(hora,minuto,segundo);
        
GetPlayerName(player1PlayerNome24); GetPlayerName(playeridPlayerNome224);
        
format(string,sizeof(string),"|- %s foi banido pelo Administrador %s [Motivo: %s] [Data: %d/%d/%d] [Hora: %d:%d] -|",PlayerNome,PlayerNome2,tmp2,dia,mes,ano,hora,minuto);
        
SendClientMessageToAll(COLOR_Silver,string);
        print(string);
        
format(strdatesizeof(strdate), "%d-%d-%d ",year,month,day);
        
format(strtime,sizeof(strtime),"%d:%d:%d",hour,minuite,second);
        new 
Query[250];
        
format(Querysizeof(Query), "UPDATE `banneds` SET `ip` = '%s', `date` = '%s', `time` = '%s', `bannedby` = '%s', `banned` = '%d', `reason` = '%s' WHERE `name` = '%s'"ip,strdate,strtime,pName(playerid),1,params[2],pName(player1));
        
mysql_tquery(mysqlQuery""""); totalbans ++;
        
format(Querysizeof(Query),"INSERT INTO `bannedips`(`ip`) VALUES ('%s')",ip);
        
mysql_tquery(mysqlQuery""""); totalip ++;
        
SetTimerEx("kickplayer"500false"i"player1);
    }
    else
    {
    
SendClientMessage(playerid0xDC143CAA"Player is not connected or is yourself or is the highest level admin");
    }
    return 
1;

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)