errors 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: errors help! +rep (
/showthread.php?tid=539067)
errors help! +rep -
KillerStrike23 - 26.09.2014
hello i tried to open the file i need with dini and i got some errors
my code
pawn Код:
stock Paccountid()
{
new count[26];
new plusone[26];
new strings[128];
foreach (Player, i)
{
new count = dini_Get("count.sav", "lastaccountid")
new plusone = strval(count) + 1;
PlayerInfo[i][Accountid] = plusone;
format(strings, sizeof(strings),"%d", plusone);
dini_Set("count.sav", "lastaccountid", strings);
}
return 1;
}
the errors
PHP код:
D:\3x-Rc1-2 Server\Gamemodes\SFTDM.pwn(2156) : warning 219: local variable "count" shadows a variable at a preceding level
D:\3x-Rc1-2 Server\Gamemodes\SFTDM.pwn(2156 -- 2157) : error 033: array must be indexed (variable "-unknown-")
D:\3x-Rc1-2 Server\Gamemodes\SFTDM.pwn(2157) : warning 219: local variable "plusone" shadows a variable at a preceding level
D:\3x-Rc1-2 Server\Gamemodes\SFTDM.pwn(2157) : error 035: argument type mismatch (argument 1)
D:\3x-Rc1-2 Server\Gamemodes\SFTDM.pwn(2157) : warning 204: symbol is assigned a value that is never used: "count"
D:\3x-Rc1-2 Server\Gamemodes\SFTDM.pwn(2152) : warning 204: symbol is assigned a value that is never used: "plusone"
D:\3x-Rc1-2 Server\Gamemodes\SFTDM.pwn(2151) : warning 204: symbol is assigned a value that is never used: "count"
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Errors.
P.S : Dont Tell ME To Use YINI Cause That Won't Fix My Code !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!
Re: errors help! +rep -
amirab - 26.09.2014
PHP код:
stock Paccountid()
{
new count[26];
new strings[128];
foreach (Player, i)
{
count = dini_Get("count.sav", "lastaccountid");
new plusone = strval(count) + 1;
PlayerInfo[i][Accountid] = plusone;
format(strings, sizeof(strings),"%d", plusone);
dini_Set("count.sav", "lastaccountid", strings);
}
return 1;
}
Try this