[OnplayerDeath]I haVe a Question
#1

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
     if(PlayerInfo[playerid][Level] >= 1) {
          PlayerInfo[killerid][AdminKills] ++;
     }
     return 1;
}
Insted Of using That Could i Use This ?

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
     if(PlayerInfo[playerid][Level] >= 1) {
          PlayerInfo[killerid][AdminKills] += 1;
     }
     return 1;
}
Guys answer please
Reply
#2

yes u can use it its fine
Reply
#3

And What Diffrent BEtwin It ?
Reply
#4

you can also do

pawn Код:
public OnPlayerDeath(playerid, killerid, reason)
{
     if(PlayerInfo[playerid][Level] >= 1) {
          PlayerInfo[killerid][AdminKills] = PlayerInfo[killerid][AdminKills] + 1;
     }
     return 1;
}
but what is the point?

They are the same.. depends on how you want to use it..
Reply
#5

i just want Each kill THey kill A admin there Admin kills + 1
Reply
#6

Q#1 What is difference between ++ and += operator ?

Answer:-
PlayerInfo[killerid][AdminKills] ++; // ++ is a operator, it can only add one in variable value

// but += is more then just add 1 in variable value

PlayerInfo[killerid][AdminKills] += 1; // += is a operator, it can add what ever in from of it in variable value. In this case it is similar ++ operator

// more example using += operator
PlayerInfo[killerid][AdminKills] += 5; // this will add 5 in variable value
PlayerInfo[killerid][AdminKills] += 7; // this will add 7 in variable value
PlayerInfo[killerid][AdminKills] += 500; // this will add 500 in variable value

// you can't use PlayerInfo[killerid][AdminKills]++ 5 or things like that. ++ operator just can do add 1 in variable value. ++ operator is limited. but += operator is not limited.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)