21.07.2009, 00:28
I can't seem to get this to work correctly,
[code=pawn]#include <a_samp>
stock Something
perator--(Something
per)
return Something
_
per - 1);
stock Something
perator++(Something
per)
return Something
_
per + 1);
public OnFilterScriptInit()
{
new Something:a = Something:5, Something:b = Something:5;
a++;
b--;
printf("a = %i, b = %i", _:a, _:b);
return 1;
}[/code]
gives
but if I just have the decrement operator and not the increment operator it gives the expected value. Am I doing something wrong or is this a compiler problem?
[code=pawn]#include <a_samp>
stock Something
![Shocked](images/smilies/surprised.gif)
![Shocked](images/smilies/surprised.gif)
return Something
![Sad](images/smilies/sad.gif)
![Shocked](images/smilies/surprised.gif)
stock Something
![Shocked](images/smilies/surprised.gif)
![Shocked](images/smilies/surprised.gif)
return Something
![Sad](images/smilies/sad.gif)
![Shocked](images/smilies/surprised.gif)
public OnFilterScriptInit()
{
new Something:a = Something:5, Something:b = Something:5;
a++;
b--;
printf("a = %i, b = %i", _:a, _:b);
return 1;
}[/code]
gives
Quote:
a = 6, b = 6 |