if(PlayerInfo[killerid][team] == 1) if(PlayerInfo[playerid][team] != 1) { if(Changing == 0) { axticket -= 1; } UpdateDraws(); if(axticket < 1) { Changemap(); Changing = 1; SendClientMessageToAll(c_blue, "*** Allied team won the round! ***"); } return 1; } |
!= 1 means that it IS NOT EQUAL TO 1
= 1 means that it IS EQUAL TO 1 |
It's funny cos you missed that the "=" is actually a "-="
You need to read some compuphase pawn handbook... That kind of thing is in there, I don't actually know what the -= means. |
if(GetPlayerMoney(playerid) != 100) return SendClientMessage(playerid, White, "you dont have Exactly 100$ right now!");
/* Explain: GetPlayerMOney(playerid) mean that we want to find how much money the player have?
but before that we wrote "if" that making the line to a question. and we wrote != that making the question to
question and then we added the int 100 whice means the integar that we want to check! so our question is:
if the player doesn't have 100% it will send him a message that warn him that he dont have exactly 100$
and if we will change the line to: */
if(GetPlayerMoney(playerid) == 100) return SendClientMessage(playerid, White, "you have Exactly 100$ right now!");
/* It will be a positive question: if the player has 100$it will send him a message to warn him that he dont have exactly
100$
But there is another "question" that you can ask. and this question will check if the player has more or less then a
int: */
if(GetPlayerMoney(playerid) > 100) return SendClientMessage(playerid, White, "you have more then 100$ right now!");
/* This is question: if player have more then 100$ it will send him a message about it... */
Plus that answer is wrong as "==" checks if two things are equal, just one "=" is assignment, i.e. "save this value (right hand) in this variable (left hand)".
For everything except "==" and "!=" the "a X= b", where "X" is a symbol, is shorthand for "a = a X b", so: pawn Код:
|
a <<= b; // a = a << b
And what does this
Код:
a <<= b; // a = a << b |
public OnGameModeInit() {
new a = 10, b = 20;
printf("10 <<= 20: %d", a <<= b);
}
Why not try it out in a blank script?
pawn Код:
|
You wont understand what happend, you will notice that the number went bigger and sometimes negativ
Open pawn-lang.pdf (that could take a while) There you will find from page 105 "Operators and expressions" a 6 page long explanation If there are still question than you can ask again or ****** |
Originally Posted by Pawn guide
e1 << e2
results in the value of e1 shifted to the left by e2 bits; the rightmost bits are set to zero. There is no distinction between an arithmetic and a logical left shift |