SA-MP Forums Archive
Error Help. [+REP] - 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: Error Help. [+REP] (/showthread.php?tid=336057)



Error Help. [+REP] - Joshb93 - 21.04.2012

This is the code:

pawn Код:
new cc = random(9999);
new ccs[64];
format(ccs, sizeof(ccs), "CC%d%d", cc, level);
PlayerInfo[giveplayerid][pCC] = ccs; // this line has the error
Here's the error:

pawn Код:
must be assigned to an array
I dont see anything wrong with that.. can anyone help me?


Re: Error Help. [+REP] - ViniBorn - 21.04.2012

You can't make this with strings. Use format.
pawn Код:
PlayerInfo[giveplayerid][pCC] = ccs;
pawn Код:
new cc = random(9999);
format(PlayerInfo[giveplayerid][pCC], sizeof(PlayerInfo[giveplayerid][pCC]), "CC%d%d", cc, level);



Re: Error Help. [+REP] - Face9000 - 21.04.2012

pawn Код:
PlayerInfo[giveplayerid][pCC] = level;
..?


Re: Error Help. [+REP] - Joshb93 - 21.04.2012

Quote:
Originally Posted by Viniborn
Посмотреть сообщение
You can't make this with strings. Use format.
pawn Код:
PlayerInfo[giveplayerid][pCC] = ccs;
pawn Код:
new cc = random(9999);
format(PlayerInfo[giveplayerid][pCC], sizeof(PlayerInfo[giveplayerid][pCC]), "CC%d%d", cc, level);
Fail... Only caused more errors, you sure you know what your talking about?