SA-MP Forums Archive
savingg - 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: savingg (/showthread.php?tid=112197)



savingg - armyoftwo - 06.12.2009

i made this
Код:
enum qinfo
{
	quest1,
}
new qInfo[MAX_PLAYERS][qinfo];
Код:
public OnPlayerConnect(playerid)
{
	quest1[playerid] = 0; // ERROR LINE
Код:
  new PName[MAX_PLAYER_NAME];
	new file[128];
	GetPlayerName(playerid, PName, MAX_PLAYER_NAME);
	format(file, sizeof(file), PLAYERFILE, udb_encode(PName));
	if(!dini_Exists(file))
	{
	  dini_Create(file);
		dini_IntSet(file, "quest1", 0);

	}

		 	qInfo[playerid][quest1] = dini_Int(file, "quest1");


		}
	}
Onplayerdisconnect
Код:
		dini_IntSet(file, "quest1", PInfo[playerid][quest1]);

	

	qInfo[playerid][quest1] = 0;
NOTE: i have commented line where those errors are


Код:
C:\Documents and Settings\ED\Desktop\Jauna mape\servaks 2\samp03svr_RC10-1_win32\gamemodes\AlienInvasion.pwn(161) : error 028: invalid subscript (not an array or too many subscripts): "quest1"
C:\Documents and Settings\ED\Desktop\Jauna mape\servaks 2\samp03svr_RC10-1_win32\gamemodes\AlienInvasion.pwn(161) : warning 215: expression has no effect
C:\Documents and Settings\ED\Desktop\Jauna mape\servaks 2\samp03svr_RC10-1_win32\gamemodes\AlienInvasion.pwn(161) : error 001: expected token: ";", but found "]"
C:\Documents and Settings\ED\Desktop\Jauna mape\servaks 2\samp03svr_RC10-1_win32\gamemodes\AlienInvasion.pwn(161) : error 029: invalid expression, assumed zero
C:\Documents and Settings\ED\Desktop\Jauna mape\servaks 2\samp03svr_RC10-1_win32\gamemodes\AlienInvasion.pwn(161) : fatal error 107: too many error messages on one line
Can someone help me?


Re: savingg - dice7 - 06.12.2009

pawn Код:
qInfo[playerid][quest1] = 0;



Re: savingg - armyoftwo - 06.12.2009

same errors


Re: savingg - dice7 - 06.12.2009

If your code is like this
pawn Код:
enum qinfo
{
    quest1,
}
new qInfo[MAX_PLAYERS][qinfo];
public OnPlayerConnect(playerid)
{
  qInfo[playerid][quest1] = 0;
  return 1;
}
then you can't have the same errors as in the first post


Re: savingg - armyoftwo - 06.12.2009

Quote:
Originally Posted by dice7
If your code is like this
pawn Код:
enum qinfo
{
    quest1,
}
new qInfo[MAX_PLAYERS][qinfo];
public OnPlayerConnect(playerid)
{
  qInfo[playerid][quest1] = 0;
  return 1;
}
then you can't have the same errors as in the first post
yes


Re: savingg - armyoftwo - 06.12.2009

Okay now i have this:

Код:
savequest(playerid)
{
  new PName[MAX_PLAYER_NAME];
	new file[128];
	GetPlayerName(playerid, PName, MAX_PLAYER_NAME);
	format(file, sizeof(file), PLAYERFILE, udb_encode(PName));
	if(!dini_Exists(file))
	{
	  dini_Create(file);
		dini_IntSet(file, "quest1", 0);

	}

		  	qInfo[playerid][quest1] = dini_Int(file, "quest1");





return 1;
}
onplayerconnect
Код:
	qInfo[playerid][quest1] = 0;
Onplayerdisconnect
Код:
	dini_IntSet(file, "quest1", PInfo[playerid][quest1]);//error
	qInfo[playerid][quest1] = 0;
Код:
0-1_win32\gamemodes\AlienInvasion.pwn(707) : error 017: undefined symbol "file"
commented that line where is error!
please help me.


Re: savingg - dice7 - 06.12.2009

PInfo doesn't exist '-.-
Change to qInfo


Re: savingg - armyoftwo - 07.12.2009

Thanks i learned the saving from GF