must be assigned to an array
#1

Hello, when i complied it shows that:
(3625) : error 006: must be assigned to an array

(3625) -> PlayerInfo[targetid][pBannedFor] = reason;
Quote:

CMD:ban(playerid, params[])
{
if(Logged[playerid] == 1)
{
new string[128], targetid, reason[60];
if(PlayerInfo[playerid][pAdmin] < 2) return SendClientMessage(playerid, blanco, "{FF0000}ERROR:{FFFFFF} Usted no esta autorizado para usar este comando");
if(sscanf(params,"us[60]", targetid, reason)) return SendClientMessage(playerid, blanco, "Use:{FFFFFF} /ban [playerid] [RAZON]");
if(!IsPlayerConnected(targetid)) return SendClientMessage(playerid, blanco, "{FF0000}ERROR:{FFFFFF} El jugador no esta conectado.");
if(PlayerInfo[targetid][pAdmin] > PlayerInfo[playerid][pAdmin]) return SendClientMessage(playerid, blanco, "{FF0000}ERROR:{FFFFFF} El jugador tiene un rango administrativo.");
PlayerInfo[targetid][pBanned] = 1;
format( PlayerInfo[targetid][pBannedFor], 20, "%s", reason );
PlayerInfo[targetid][pBannedFor] = reason;
new Day, Month, Year;
getdate(Year, Month, Day);
format(string, sizeof(string), "BAN:{FFFFFF} %s ha sido baneado por %s", GetName(targetid), GetName(playerid));
SendClientMessageToAll(COLOR_RED, string);
format(string, sizeof(string), "%s Banned - %04d/%02d/%02d", GetName(targetid), Year, Month, Day);
Log("/CSW/Logs/ban.txt", string);
GetPlayerIp(targetid, IP[playerid], 16);
format(string, sizeof(string), "Player's IP:{FFFFFF} %s (/banip to ban it)", IP[playerid]);
SendClientMessage(playerid, COLOR_RED, string);
KickWithMessage(targetid, reason);
}
return 1;
}

Please help me!!
Reply
#2

pawn Код:
format(PlayerInfo[targetid][pBannedFor], 128, reason);
Reply
#3

Quote:
Originally Posted by SickAttack
Посмотреть сообщение
pawn Код:
format(PlayerInfo[targetid][pBannedFor], 128, reason);
Humm yes, but in my Db the reason is "71" and i dont put it.
Reply
#4

Then change it to 128.
Reply
#5

Quote:
Originally Posted by Ox1gEN
Посмотреть сообщение
Then change it to 128.
What? where i must put 128?
Reply
#6

here
PHP код:
new string[128], targetidreason[60]; 
change it like this:
PHP код:
new string[128], targetidreason[128]; 
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)