pvar problem
#1

Код:
stock GivePlayerCash(playerid, money)
{
	SetPVarInt(playerid, "Moneyp", +=money);  // 346 line
	ResetMoneyBar(playerid);
	UpdateMoneyBar(playerid,GetPVarInt(playerid, "Moneyp"));
	return GetPVarInt(playerid, "Moneyp");
}
when i compile i get this

(346) : error 029: invalid expression, assumed zero
(346) : warning 215: expression has no effect
(346) : error 001: expected token: ";", but found ")"
(346) : error 029: invalid expression, assumed zero
(346) : fatal error 107: too many error messages on one line
Reply
#2

That won't work, as the function does not know what to add the "money" value on to. You can do the following instead:

pawn Код:
stock GivePlayerCash(playerid, money)
{
    SetPVarInt(playerid, "Moneyp", GetPVarInt(playerid,"Moneyp") + money);  // 346 line
    ResetMoneyBar(playerid);
    UpdateMoneyBar(playerid,GetPVarInt(playerid, "Moneyp"));
    return GetPVarInt(playerid, "Moneyp");
}
Reply
#3

NICE works thanks alot!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)