PDA

View Full Version : How is this possible?


Lajko1
15/04/2014, 01:37 PM
This is working:
PInfo[playerid][Bwarns] = dUserINT(PlayerName2(playerid)).("Bwarns");

And this is not working:
Weed[playerid] = dUserINT(PlayerName(playerid)).("Weed");

error:
error 001: expected token: ";", but found ")"

iBanner
15/04/2014, 01:39 PM
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");

Macronix
15/04/2014, 01:41 PM
Weed[playerid] = dUserINT(PlayerName2(playerid)).("Weed");

BlueBaron
15/04/2014, 01:43 PM
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.

Lajko1
15/04/2014, 01:46 PM
Okay look:

working:
Weed[playerid] = dUserINT(formatZ2).("Weed");

Not working:
Weed[playerid] = dUserINT(PlayerName2(playerid)).("Weed");

- same error

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

EDIT:

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");

Macronix
15/04/2014, 01:48 PM
Mmh, can you show me your PlayerName2(playerid) function?

Konstantinos
15/04/2014, 01:49 PM
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.

iBanner
15/04/2014, 01:52 PM
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! :D Just noticed that the error should be what konstantino said.

Lajko1
15/04/2014, 01:54 PM
stock PlayerName2(playerid)
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
return name;
}

Lajko1
15/04/2014, 01:58 PM
Okay fixed errors right now..

But why it doesn't want to save that?

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

Macronix
15/04/2014, 05:54 PM
Why do you even "load" the variables in OnPlayerDISconnect? I don't get it... i think you want to save them in OnPlayerDISconnect?