savingg
#1

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?
Reply
#2

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

same errors
Reply
#4

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
Reply
#5

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
Reply
#6

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.
Reply
#7

PInfo doesn't exist '-.-
Change to qInfo
Reply
#8

Thanks i learned the saving from GF
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)