SA-MP Forums Archive
4 Errors in one line. - 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: 4 Errors in one line. (/showthread.php?tid=266550)



4 Errors in one line. - DarthXela - 05.07.2011

Hey guys,
firstly : Sorry for my bad english.
Now that what i want to know from you :
I have some errors in the same line and i don't know, what's wrong with it.
The Errors are :
dxtdm.pwn(157) : error 029: invalid expression, assumed zero
dxtdm.pwn(157) : error 029: invalid expression, assumed zero
dxtdm.pwn(157) : warning 215: expression has no effect
dxtdm.pwn(157) : error 001: expected token: ";", but found "]"
dxtdm.pwn(157) : fatal error 107: too many error messages on one line

The line is in OnPlayerDisconnect :
public OnPlayerDisconnect(playerid, reason)
{
new pname[MAX_PLAYERS],accFormat[128];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"%s.user",pname);
if(fexist(accFormat) && Player[playerid][loggedin] == 1) //<-- The Error line
{
dini_IntSet(accFormat,"wanted",Player[playerid][wanted]);
dini_IntSet(accFormat,"skin",Player[playerid][skin]);
dini_IntSet(accFormat,"money",GetPlayerMoney(playe rid));
dini_IntSet(accFormat,"score",GetPlayerScore(playe rid));
dini_FloatSet(accFormat,"lastx",Player[playerid][lastx]);
dini_FloatSet(accFormat,"lasty",Player[playerid][lasty]);
dini_FloatSet(accFormat,"lastz",Player[playerid][lastz]);
}

Player[playerid][loggedin] = 0;
Player[playerid][wanted] = 0;
Player[playerid][skin] = 0;
Player[playerid][lastx] = (0.0);
Player[playerid][lasty] = (0.0);
Player[playerid][lastz] = (0.0);
return 1;
}


I hope you can help me.
I already asked in the german board, but they're all sleeping i think .


Re: 4 Errors in one line. - Mr.1337 - 05.07.2011

Quote:
Originally Posted by DarthXela
Посмотреть сообщение
Hey guys,
firstly : Sorry for my bad english.
Now that what i want to know from you :
I have some errors in the same line and i don't know, what's wrong with it.
The Errors are :
dxtdm.pwn(157) : error 029: invalid expression, assumed zero
dxtdm.pwn(157) : error 029: invalid expression, assumed zero
dxtdm.pwn(157) : warning 215: expression has no effect
dxtdm.pwn(157) : error 001: expected token: ";", but found "]"
dxtdm.pwn(157) : fatal error 107: too many error messages on one line

The line is in OnPlayerDisconnect :
public OnPlayerDisconnect(playerid, reason)
{
new pname[MAX_PLAYERS],accFormat[128];
GetPlayerName(playerid,pname,sizeof pname);
format(accFormat,sizeof accFormat,"%s.user",pname);
Код:
	if(fexist(accFormat) && Player[playerid][loggedin] == 1) //<-- The Error line
	{
dini_IntSet(accFormat,"wanted",Player[playerid][wanted]);
dini_IntSet(accFormat,"skin",Player[playerid][skin]);
dini_IntSet(accFormat,"money",GetPlayerMoney(playe rid));
dini_IntSet(accFormat,"score",GetPlayerScore(playe rid));
dini_FloatSet(accFormat,"lastx",Player[playerid][lastx]);
dini_FloatSet(accFormat,"lasty",Player[playerid][lasty]);
dini_FloatSet(accFormat,"lastz",Player[playerid][lastz]);
}

Player[playerid][loggedin] = 0;
Player[playerid][wanted] = 0;
Player[playerid][skin] = 0;
Player[playerid][lastx] = (0.0);
Player[playerid][lasty] = (0.0);
Player[playerid][lastz] = (0.0);
return 1;
}


I hope you can help me.
I already asked in the german board, but they're all sleeping i think .
Replace this, with the error line: and tell me if works, or not:
Код:
if(fexist(accFormat) &&! Player[playerid][loggedin] == 1) //added (!)
{



Re: 4 Errors in one line. - Skaizo - 05.07.2011

if(fexist(accFormat) && Player[playerid][loggedin] == 1))
or
if(fexist(accFormat) && Player[playerid][loggedin] == 1);


AW: 4 Errors in one line. - DarthXela - 05.07.2011

No, they both do not work. Always the same errors.


Re: 4 Errors in one line. - Shadoww5 - 05.07.2011

Try this:

PHP код:
if(fexist(accFormat) && Player[playerid][loggedin] == true



AW: 4 Errors in one line. - DarthXela - 05.07.2011

Same Errors.


Re: 4 Errors in one line. - Markx - 05.07.2011

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new pname[MAX_PLAYERS], accFormat[128];
    GetPlayerName(playerid,pname,sizeof pname);
    format(accFormat,sizeof(accFormat),"%s.user",pname);
    if(fexist(accFormat) && Player[playerid][loggedin] == 1)
    {
        dini_IntSet(accFormat,"wanted",Player[playerid][wanted]);
        dini_IntSet(accFormat,"skin",Player[playerid][skin]);
        dini_IntSet(accFormat,"money",GetPlayerMoney(playerid));
        dini_IntSet(accFormat,"score",GetPlayerScore(playerid));
        dini_FloatSet(accFormat,"lastx",Player[playerid][lastx]);
        dini_FloatSet(accFormat,"lasty",Player[playerid][lasty]);
        dini_FloatSet(accFormat,"lastz",Player[playerid][lastz]);
    }
    else
    {
        Player[playerid][loggedin] = 0;
        Player[playerid][wanted] = 0;
        Player[playerid][skin] = 0;
        Player[playerid][lastx] = (0.0);
        Player[playerid][lasty] = (0.0);
        Player[playerid][lastz] = (0.0);
    }
    return 1;
}
Maybe that?

Edit:

Why:

dini_IntSet(accFormat,"money",GetPlayerMoney(playe rid));
dini_IntSet(accFormat,"score",GetPlayerScore(playe rid));

Its playerid