SA-MP Forums Archive
must be assigned to an array - 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: must be assigned to an array (/showthread.php?tid=539235)



must be assigned to an array - CoR3 - 27.09.2014

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!!


Re: must be assigned to an array - SickAttack - 27.09.2014

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



Re: must be assigned to an array - CoR3 - 27.09.2014

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.


Re: must be assigned to an array - Ox1gEN - 27.09.2014

Then change it to 128.


Re: must be assigned to an array - CoR3 - 28.09.2014

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


Re: must be assigned to an array - Alpha000 - 25.03.2016

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