13.10.2016, 01:41
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(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);
/*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(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");
}