SA-MP Forums Archive
Whats wrong with this? - 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: Whats wrong with this? (/showthread.php?tid=147944)



Whats wrong with this? - hardstop - 15.05.2010

suitsud[playerid] = +1;

Код:
 error 029: invalid expression, assumed zero

warning 215: expression has no effect



Re: Whats wrong with this? - Torran - 15.05.2010

pawn Код:
suitsud[playerid] = ++;



Re: Whats wrong with this? - hardstop - 15.05.2010

error 022: must be lvalue (non-constant)

error029: invalid expression, assumed zero

when i add your thing


Re: Whats wrong with this? - Torran - 15.05.2010

Show me everywhere suitsud is used


Re: Whats wrong with this? - hardstop - 15.05.2010

this is under onplayerdisconnect: dini_IntSet(udb_encode(playername), "suitsud", suitsud[playerid]);




this is under onplayerregister: dini_IntSet(udb_encode(playername), "suitsud", 0);


Re: Whats wrong with this? - s0nic - 15.05.2010

Just try it like this:
pawn Код:
suitsud[playerid]++;



Re: Whats wrong with this? - hardstop - 15.05.2010

works thnx


Re: Whats wrong with this? - Westie - 15.05.2010

Quote:
Originally Posted by hardstop
suitsud[playerid] = +1;

Код:
 error 029: invalid expression, assumed zero

warning 215: expression has no effect
There are two (and a half) ways to increment a value. You could do it how you wanted to originally:

Код:
iVar += 1
The other way is the increment modifier:

Код:
++iVar
iVar++
Both achieve the same result - but differently.