SA-MP Forums Archive
How is this possible? - 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)
+--- Thread: How is this possible? (/showthread.php?tid=506964)



How is this possible? - Lajko1 - 15.04.2014

This is working:
pawn Код:
PInfo[playerid][Bwarns] = dUserINT(PlayerName2(playerid)).("Bwarns");
And this is not working:
pawn Код:
Weed[playerid] = dUserINT(PlayerName(playerid)).("Weed");
error:
pawn Код:
error 001: expected token: ";", but found ")"



Re: How is this possible? - iBanner - 15.04.2014

Check the upper part of

Код:
Weed[playerid] = dUserINT(PlayerName(playerid)).("Weed");
Maybe you are missing the ;

Код:
Cigar[playerid] = dUserINT(PlayerName(playerid)).("Cigar");
Dildo[playerid] = dUserINT(PlayerName(playerid)).("Dildo") <====== This one
Weed[playerid] = dUserINT(PlayerName(playerid)).("Weed");



AW: How is this possible? - Macronix - 15.04.2014

Код:
Weed[playerid] = dUserINT(PlayerName2(playerid)).("Weed");



Re: AW: How is this possible? - BlueBaron - 15.04.2014

Quote:
Originally Posted by Macronix
Посмотреть сообщение
Код:
Weed[playerid] = dUserINT(PlayerName2(playerid)).("Weed");
It has nothing to do with that, as iBanner said its probably due to a misshap on the code above that line.


Re: How is this possible? - Lajko1 - 15.04.2014

Okay look:

working:
pawn Код:
Weed[playerid] = dUserINT(formatZ2).("Weed");
Not working:
pawn Код:
Weed[playerid] = dUserINT(PlayerName2(playerid)).("Weed");
- same error

I'm learning.. but what the hell is point here?

EDIT:

pawn Код:
public OnPlayerDisconnect(playerid, reason)
{
    new formatZ2[256];
    new PlayerName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, PlayerName, sizeof(PlayerName));
    format(formatZ2, sizeof(formatZ2), "Drugs/%s.ini", PlayerName);

    if(fexist(formatZ2))
    {
        Weed[playerid] = dUserINT(formatZ2).("Weed");
        Cocaine[playerid] = dUserINT(formatZ2).("Cocaine");



AW: How is this possible? - Macronix - 15.04.2014

Mmh, can you show me your PlayerName2(playerid) function?


Re: AW: How is this possible? - Konstantinos - 15.04.2014

Quote:
Originally Posted by bluebaron
Посмотреть сообщение
It has nothing to do with that, as iBanner said its probably due to a misshap on the code above that line.
That would give -> error 1: expected token: ";", but found "-identifier-" instead.

---

Posting PlayerName2 would be helpful but if you cannot get it fixed, use the one that works.


Re: AW: How is this possible? - iBanner - 15.04.2014

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
That would give -> error 1: expected token: ";", but found "-identifier-" instead.

---

Posting PlayerName2 would be helpful but if you cannot get it fixed, use the one that works.
Ha! Nice! Just noticed that the error should be what konstantino said.


Re: How is this possible? - Lajko1 - 15.04.2014

pawn Код:
stock PlayerName2(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    return name;
}



Re: How is this possible? - Lajko1 - 15.04.2014

Okay fixed errors right now..

But why it doesn't want to save that?

pawn Код:
dcmd_test(playerid, params[])
{
#pragma unused params
    Weed[playerid] ++;
    return 1;
}
When I disconnect there isn't "Weed (number here)" saved it's still 0 it doesn't rise :/ this saving system is strange