SA-MP Forums Archive
what what does it means,, im still learning my pawn skill - 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: what what does it means,, im still learning my pawn skill (/showthread.php?tid=266260)



what what does it means,, im still learning my pawn skill - handerson - 04.07.2011

Quote:

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;
}

I got that in Battlefield GameMode, im trying to understand the code,,,
can u tell me


im confused with this code if(PlayerInfo[playerid][team] != 1)
and axticket -= 1; }

what does "!=" mean
and "-="


Re: what what does it means,, im still learning my pawn skill - Max_Coldheart - 04.07.2011

!= 1 means that it IS NOT EQUAL TO 1
= 1 means that it IS EQUAL TO 1


Re: what what does it means,, im still learning my pawn skill - Sew_Sumi - 04.07.2011

Quote:
Originally Posted by Max_Coldheart
Посмотреть сообщение
!= 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.


Re: what what does it means,, im still learning my pawn skill - Max_Coldheart - 04.07.2011

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
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.
Oh sorry, miss read :P


Re: what what does it means,, im still learning my pawn skill - jameskmonger - 04.07.2011

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
I don't actually know what the -= means.
You need to read some compuphase pawn handbook... That kind of thing is in there, you hypocritical moron.


Re: what what does it means,, im still learning my pawn skill - Captain Price - 04.07.2011

(( != i )) it means that it NOT equal for the integar
Example;
pawn Код:
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... */
Understood?


Re: what what does it means,, im still learning my pawn skill - *IsBack - 04.07.2011

Quote:
Originally Posted by ******
Посмотреть сообщение
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
a *= b; // a = a * b
a <<= b; // a = a << b
etc.
And what does this
Код:
a <<= b; // a = a << b
means? < means LESS THAN, but << ?


Re: what what does it means,, im still learning my pawn skill - jameskmonger - 04.07.2011

Quote:
Originally Posted by *IsBack
Посмотреть сообщение
And what does this
Код:
a <<= b; // a = a << b
means? < means LESS THAN, but << ?
Why not try it out in a blank script?

pawn Код:
public OnGameModeInit() {
        new a = 10, b = 20;
        printf("10 <<= 20: %d", a <<= b);
}



AW: Re: what what does it means,, im still learning my pawn skill - Nero_3D - 04.07.2011

Quote:
Originally Posted by jameskmonger
Посмотреть сообщение
Why not try it out in a blank script?

pawn Код:
public OnGameModeInit() {
        new a = 10, b = 20;
        printf("10 <<= 20: %d", a <<= b);
}
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 ******


Re: AW: Re: what what does it means,, im still learning my pawn skill - *IsBack - 04.07.2011

Quote:
Originally Posted by Nero_3D
Посмотреть сообщение
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 ******
Quote:
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
Shifts e1 by e2 bits? That does that suppose to mean?
if I do
10 << 2
so 10 will increase by 2 bits? how much would that be then?