05.09.2010, 00:16
These symbols (or at least some of them) are related to general math/algebra.
Symbols:
&& : - This means and, in terms of PAWN, you could do 2 functions in 1 if statement. Example is below.
& : This I do not really know yet, but I do know a way you could use it. Example is below.
< : Less then, 1 < 5 - 1 is less then 5.
<< : I do not know yet.
>> : I do not know yet.
> : Greater then, 5 > 1 - 5 is greater then 1.
| : I do not know yet.
|| : This is like &&, but this is "or". You can use this for many things, such as strcmp.
* : This is a math symbol, multiplication.
- : This is a math symbol, subtraction. But this is used inside a function.
-- : This is used to downgrade or subtract a variable.
= : This is a math symbol, basically equal to. It is used to assign a value to a var or array, etc.
== : This is a math symbol, similar to the equal sign, but instead, this is used to compare two functions/vars/arrays/etc.
+ : This is like subtraction, except, it is addition, you use it inside a function, to add numbers or variables/values.
++ : This is like the subtraction sign for vars, but this is addition.
% : This is used to format a specifier, inside a format.
>= : This is using the greater then, but also like assigning a var. This can be used to see a player's admin level in a if statement.
<= : This is using the less then, but also like assigning a var. This can be used to see a player's admin level in a if statement.
-= : This is like the subtraction sign, except used for vars/arrays/enums etc.
+= : This is like the addition sign, except used for vars/arrays/enums etc.
Hope this helped.
Symbols:
&& : - This means and, in terms of PAWN, you could do 2 functions in 1 if statement. Example is below.
pawn Код:
if(IsPlayerConnected(playerid) && IsPlayerAdmin(playerid))
pawn Код:
if(newkeys & KEY_FIRE)
pawn Код:
if(PlayerInfo[playerid][Money] < GetPlayerMoney(playerid)) - //If their money is less then their client side money.
>> : I do not know yet.
> : Greater then, 5 > 1 - 5 is greater then 1.
pawn Код:
if(GetPlayerMoney(playerid) > PlayerInfo[playerid][Money]) - //If their client side money is larger then their var money.
|| : This is like &&, but this is "or". You can use this for many things, such as strcmp.
pawn Код:
if(!strcmp(cmd, "/help", true) || !strcmp(cmd, "/h", true)) - //Comparing if they used /h or /help.
pawn Код:
75 * 3 - //Same thing as 75 x 3
pawn Код:
300.0 - 250.0
pawn Код:
CountDown--;
pawn Код:
new Float:Health = 3000.0
pawn Код:
if(playerid == INVALID_PLAYER_ID) // This is used in a PM cmd, to see if they typed a invalid playerid.
pawn Код:
50.0 + 300.0
pawn Код:
CountDown++; //Will count upwards.
pawn Код:
%d - Whole Intenger | %s - string | %f - Float | %c - Single Character and more (search wiki)
pawn Код:
if(PlayerInfo[playerid][pAdmin] >= 4) // This will check if the person's level is 4 or higher.
pawn Код:
if(PlayerInfo[playerid][pAdmin] <= 4) // This will check if the person's level is 4 or lower.
-= : This is like the subtraction sign, except used for vars/arrays/enums etc.
pawn Код:
PlayerInfo[playerid][Money] -= amount;
pawn Код:
PlayerInfo[palyerid][Money] += amount;