Jump to content
  • 0

Am o mica problema


Mark.W

Question

Salut, am o mica problema cu scriptul la care lucrez. Incerc sa fac in asa fel incat sa se salveze datele cand se deconecteaza si sa incarce valorile enum-ului la conectare.

Code:

public OnPlayerConnect(playerid)
{
	new pname[MAX_PLAYER_NAME], string[256];
	GetPlayerName(playerid, pname, sizeof(pname));
	format(string, sizeof(string), "/accounts/%s.ini", pname);
	if(dini_Exists(pname))
	{
		ShowPlayerDialog(playerid, LOGIN, 1, "Sign In", "Account registered - Sign In:", "Quit", "Sign In");
		pData[playerid][pName] = pname;
		pData[playerid][pKey] = dini_Get(string, pKey);
		pData[playerid][pSecKey] = dini_Get(string, pSecKey);
		pData[playerid][pMoney] = dini_Get(string, pMoney);
		pData[playerid][pScore] = dini_Get(string, pScore);
		pData[playerid][pLevel] = dini_Get(string, pLevel);
		pData[playerid][pAdminLevel] = dini_Get(string, pAdminLevel);
		pData[playerid][pPosX] = dini_Get(string, pPosX);
		pData[playerid][pPosY] = dini_Get(string, pPosY);
		pData[playerid][pPosZ] = dini_Get(string, pPosZ);
		pData[playerid][pSkin] = dini_Get(string, pSkin);
		return 1;
	}
	else
	{
	    ShowPlayerDialog(playerid, REGISTER, 1, "Register", "Please type in a password to register:[min. 6 chars.]", "Quit", "Register");
		return 1;
	}
	return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
	new pname[MAX_PLAYER_NAME], string[256];
	GetPlayerName(playerid, pname, sizeof(pname));
	format(string, sizeof(string), "/accounts/%s.ini", pname);
	if(dini_Exists(pname))
	{
		dini_Set(string, pName, pData[playerid][pName]);
		dini_Set(string, pKey, pData[playerid][pKey]);
		dini_Set(string, pSecKey, pData[playerid][pSecKey]);
		dini_FloatSet(string, pMoney, pData[playerid][pMoney]);
		dini_IntSet(string, pScore, pData[playerid][pScore]);
		dini_IntSet(string, pLevel, pData[playerid][pLevel]);
		dini_IntSet(string, pAdminLevel, pData[playerid][pAdminLevel]);
		dini_FloatSet(string, pPosX, pData[playerid][pPosX]);
		dini_FloatSet(string, pPosY, pData[playerid][pPosY]);
		dini_FloatSet(string, pPosZ, pData[playerid][pPosZ]);
		dini_IntSet(string, pSkin, pData[playerid][pSkin]);
		return 1;
	}
	return 1;
}
Errors:
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(132) : error 035: argument type mismatch (argument 2)
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(132) : error 047: array sizes do not match, or destination array is too small
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(133) : error 035: argument type mismatch (argument 2)
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(133) : error 047: array sizes do not match, or destination array is too small
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(134) : error 035: argument type mismatch (argument 2)
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(134) : error 006: must be assigned to an array
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(135) : error 035: argument type mismatch (argument 2)
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(135) : error 006: must be assigned to an array
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(136) : error 035: argument type mismatch (argument 2)
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(136) : error 006: must be assigned to an array
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(137) : error 035: argument type mismatch (argument 2)
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(137) : error 006: must be assigned to an array
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(138) : error 035: argument type mismatch (argument 2)
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(138) : error 006: must be assigned to an array
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(139) : error 035: argument type mismatch (argument 2)
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(139) : error 006: must be assigned to an array
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(140) : error 035: argument type mismatch (argument 2)
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(140) : error 006: must be assigned to an array
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(141) : error 035: argument type mismatch (argument 2)
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(141) : error 006: must be assigned to an array
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(149) : warning 225: unreachable code
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(159) : error 035: argument type mismatch (argument 2)
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(160) : error 035: argument type mismatch (argument 2)
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(161) : error 035: argument type mismatch (argument 2)
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(162) : error 035: argument type mismatch (argument 2)
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(163) : error 035: argument type mismatch (argument 2)
C:\Users\Anthony\Desktop\scripting\gamemodes\lvtdm.pwn(164) : error 035: argument type mismatch (argument 2)

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


26 Errors.

Nu este o problema ca lipseste o paranteza. Imi da erori la toate liniile cu dini. Putin ajutor va rog?

Link to comment
Share on other sites

0 answers to this question

Recommended Posts

There have been no answers to this question yet

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.