dini_Get 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)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: dini_Get help? (
/showthread.php?tid=187828)
dini_Get help? -
Luis- - 04.11.2010
Well I am getting this error with this code?
pawn Код:
public OnPlayerSpawn(playerid)
{
new file[128];
if (dini_Get(file, "Accounts/%s.ini"))
{
SetPlayerSkin(playerid, NoobSkin);
SetPlayerPos(playerid, 1298.1400,220.3873,19.5547);
}
return 1;
}
Error;
Код:
C:\Users\BooNii3\Foxx RP\Foxx Role Play\Server\gamemodes\foxxrp.pwn(92) : error 033: array must be indexed (variable "dini_Get")
Re: dini_Get help? -
Toni - 04.11.2010
You can't do a format operator (%) without using the actual "format".
You will need to make a string array or something:
pawn Код:
new str[80];
format(str, sizeof(str), "Accounts/%s.ini", playername);
if(dini_Get(file, str))
etc
Re: dini_Get help? -
Luis- - 04.11.2010
Still getting the Error, I don't understand how it is meant to be, I am never used dini_Get before..
AW: dini_Get help? -
Littl3j0hNy - 04.11.2010
Quote:
Originally Posted by -Luis
Well I am getting this error with this code?
pawn Код:
public OnPlayerSpawn(playerid) { new file[128]; if (dini_Get(file, "Accounts/%s.ini")) { SetPlayerSkin(playerid, NoobSkin); SetPlayerPos(playerid, 1298.1400,220.3873,19.5547); } return 1; }
Error;
Код:
C:\Users\BooNii3\Foxx RP\Foxx Role Play\Server\gamemodes\foxxrp.pwn(92) : error 033: array must be indexed (variable "dini_Get")
|
pawn Код:
public OnPlayerSpawn(playerid)
{
new file[128];
format(file, sizeof(file), "Accounts/%s.ini", NameOfThePlayer);
if (dini_Isset(file, "Skin"))
{
SetPlayerSkin(playerid, dini_Int(file, "Skin")); // set the skin to the saved skin ID
SetPlayerPos(playerid, 1298.1400,220.3873,19.5547);
}
return 1;
}
I think this should be go.