Error(creating gamemode). - 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(creating gamemode). (
/showthread.php?tid=499223)
Error(creating gamemode). -
RyanPetersons - 07.03.2014
Код:
stock LoadOrgCash()
{
new part3[250];
new part2[40];
if (!dini_Exists(SAVE_CASH_TO))
{
for (new i=1;i<OrgsCount+1;i++)
{
dini_Create(SAVE_CASH_TO);
format(part3,sizeof(part3),"%d");
Organization[i][cash] = part3;
SaveOrgCash();
}
}
for (new i=1;i<OrgsCount+1;i++)
{
format(part2,sizeof(part2),"%d", i);
format(part3,sizeof(part3),dini_Get(SAVE_CASH_TO,part2));
if (strcmp(part3," ", false) == 0)
{
part3 = "%d";
}
Organization[i][cash] = part3;
}
return 1;
}
ERROR is in this line: Organization[i][cash] = part3;
Error: "Must be assigned to an array".
AW: Error(creating gamemode). -
WhiteKinG - 07.03.2014
You have forgotten i
Код:
for (new i=1;i<OrgsCount+1;i++)
{
dini_Create(SAVE_CASH_TO);
format(part3,sizeof(part3),"%d",i);
Organization[i][cash] = part3;
SaveOrgCash();
}
Re: Error(creating gamemode). -
RyanPetersons - 07.03.2014
In both these lines "Organization[i][cash] = part3;" there is same error
of
Must be assigned to an array.
Re: Error(creating gamemode). -
RyanPetersons - 07.03.2014
Answer please. being late..
Re: Error(creating gamemode). -
BoBiTzaa - 07.03.2014
try :
PHP код:
enum porg {
cash,
};
new Organization[MAX_PLAYERS][porg];
Re: Error(creating gamemode). -
RyanPetersons - 07.03.2014
its already added.
Re: Error(creating gamemode). -
BoBiTzaa - 07.03.2014
Replace
PHP код:
Organization[i][cash] = part3;
WITH
PHP код:
memcpy(Organization[i][cash], cash3, 0, MAX_PLAYER_NAME*4, MAX_PLAYER_NAME*4);