*** Terrible Title Removed
#1

PHP код:
public OnPlayerDeath(playeridkilleridreason)
{
    if((
killerid != playerid) || (killerid INVALID_PLAYER_ID))
    {
        
pInfo[killerid][Kills]++;
        
pInfo[playerid][Deaths]++;
    }
    else
    {
        
pInfo[playerid][Suicides]++;
    }
    return 
1;

no errors or warnings but it doesn't work
Reply
#2

pawn Код:
if((killerid != playerid) || (killerid = INVALID_PLAYER_ID))
shouldnt it be:
pawn Код:
if((killerid != playerid) || (killerid != INVALID_PLAYER_ID))
or

pawn Код:
if((killerid != playerid) && (killerid != INVALID_PLAYER_ID))
or with the removed ( and )
pawn Код:
if((killerid != playerid && killerid != INVALID_PLAYER_ID)
??
Reply
#3

Quote:
Originally Posted by ******
Посмотреть сообщение
It is MUCH simpler to write and read "if" checks with the "true" version first:

pawn Код:
if((killerid == playerid) || (killerid == INVALID_PLAYER_ID))
{
        pInfo[playerid][Suicides]++;
}
else
{
        pInfo[killerid][Kills]++;
        pInfo[playerid][Deaths]++;
}
Yeah I prefer this way. It's much easier, non-confusing and understandable.
Reply
#4

still doesn't work
Reply
#5

Try this:
pawn Код:
if((killerid == playerid))
{
        pInfo[playerid][Suicides]++;
}
else
{
        pInfo[killerid][Kills]++;
        pInfo[playerid][Deaths]++;
}
Reply
#6

same
Reply
#7

So whats the problem? Is it just adding suicides or only kills and deaths?
Reply
#8

the suicides
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)