Must be assigned to an array, help! - 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, help! (
/showthread.php?tid=640989)
[SOLVED]Must be assigned to an array, help! -
AmarPlayer - 09.09.2017
Hi! I need help with this:
Код:
CMD:specijalnoime(playerid, params[], help)
{
JeliLogovan
if(PlayerInfo[playerid][pAdmin] < 6) return NematePravo
if(AdminDuznost[playerid] == 0) return NisteAD
new id, ime[MAX_PLAYER_NAME], msg1[128], msg2[128], msg3[128];
if(sscanf(params, "us[16]", id, ime)) return SCM, "[ E ] | {FFFFFF}Koristenje: /promjeniime {ffdf2d}[ID] [IME].");
else
{
if(id == INVALID_PLAYER_ID) return NemaIgraca
PlayerInfo[id][pSIme] = ime;
SetPlayerName(id, ime);
format(msg1, sizeof(msg1), "[ E ] | {FFFFFF}Igracu {ffdf2d}%s {ffffff}ste postavili specijalno ime na {ffdf2d}%s.", ImeIgraca(id), ime);
format(msg2, sizeof(msg2), "[ E ] | {FFFFFF}Vlasnik {ffdf2d}%s {ffffff}vam je postavio specijalno ime na {ffdf2d}%s.", ImeIgraca(playerid), ime);
format(msg3, sizeof(msg3), "[ E ] | {FFFFFF}Svaki put kada ulazite na server, koristite ime {ffdf2d}%s, {ffffff}server ce vam automatski postaviti specijalno ime.", ImeIgraca(id));
SendClientMessage(playerid, ZUTA, msg1);
SendClientMessage(id, ZUTA, msg2);
SendClientMessage(id, ZUTA, msg3);
}
return 1;
}
I get an error at the line "PlayerInfo[id][pSIme] = ime;" saying
must be assigned to an array.
Any help will be appreciated.
Re: Must be assigned to an array, help! -
n00blek - 09.09.2017
can you show meyour enum
Re: Must be assigned to an array, help! -
AmarPlayer - 09.09.2017
Код:
enum pInfo
{
pSifra,
pNovac,
pAdmin,
pSmrti,
pUbistva,
pBankaNovac,
pKikovan,
pPosao,
pDroga,
pPrivatnoImanje,
pLevel,
pSIme
}
new PlayerInfo[MAX_PLAYERS][pInfo];
EDIT: I just added max_player_name to pSIme, and it gives me no errors, i think it works
2nd EDIT: It works