Part of this code doesn't respond
#1

pawn Код:
public OnPlayerDeath(killerid,playerid,reason)
{
        if(Assault[playerid]==1)
        {
            if(IsPlayerConnected(killerid))
            {
                    // this part responds
        }
        else
        {
                    // also responds
        }
        }
        if(HellJumper[playerid]==1)
        {
            if(IsPlayerConnected(killerid))
            {
               // responds too
            }
            else
            {
                           // this one doesn't respond
            }
        }
     return 1;
}
Why? :/
Reply
#2

Код:
public OnPlayerDeath(killerid,playerid,reason)
{
        if(Assault[playerid]==1)
        {
            if(IsPlayerConnected(killerid))
            {
                   return 1;
        }
        else
        {
                    return 1;
        }
        }
        if(HellJumper[playerid]==1)
        {
            if(IsPlayerConnected(killerid))
            {
               return 1;
            }
            else
            {
                           return 1;
            }
        }
     return 0;
}
Do you mean it doesnt compile?

or it just doesnt work when you run it?
Reply
#3

the commented part doens't work when i go ingame
and it compiles fine without any errors.
Reply
#4

Okay well are you adding return 1; after each part?

i added it just to show an example ^
Reply
#5

pawn Код:
public OnPlayerDeath(killerid,playerid,reason)
{
        if(Assault[playerid]==1)
        {
            if(IsPlayerConnected(killerid))
            {
                    // this part responds
            }
            else
           {
                    // also responds
           }
        }
        else if(HellJumper[playerid]==1)
        {
            if(IsPlayerConnected(killerid))
            {
               // responds too
            }
            else
            {
                           // this one doesn't respond
            }
        }
     return 1;
}
Reply
#6

pawn Код:
public OnPlayerDeath(killerid,playerid,reason)
{
    if(Assault[playerid]==1)
    {
        if(IsPlayerConnected(killerid))
        {
            // this part responds
        }
        else
        {
        // also responds
        }
        if(HellJumper[playerid]==1)
        {
            if(IsPlayerConnected(killerid))
            {
                // responds too
            }
            else
            {
                // this one doesn't respond
            }
        }
     return 1;
}
EDIT: DAN !!!! HAHA same code o.O ?
Reply
#7

Quote:
Originally Posted by KingyKings
Посмотреть сообщение
Okay well are you adding return 1; after each part?

i added it just to show an example ^
yes tried it with return 1; and it didn't work
Quote:
Originally Posted by Dan.
Посмотреть сообщение
pawn Код:
public OnPlayerDeath(killerid,playerid,reason)
{
        if(Assault[playerid]==1)
        {
            if(IsPlayerConnected(killerid))
            {
                    // this part responds
            }
            else
           {
                    // also responds
           }
        }
        if(HellJumper[playerid]==1)
        {
            if(IsPlayerConnected(killerid))
            {
               // responds too
            }
            else
            {
                           // this one doesn't respond
            }
        }
     return 1;
}
Excuse me but i don't need to loose indentation here ..
Reply
#8

try this
pawn Код:
public OnPlayerDeath(killerid,playerid,reason)
{
    if(Assault[playerid]==1)
    {
        if(IsPlayerConnected(killerid))
        {
            // this part responds
        }
        else
        {
            // also responds
        }
    }
    if(HellJumper[playerid]==1)
    {
        if(IsPlayerConnected(killerid))
        {
            // responds too
        }
        else
        {
            // this one doesn't respond
        }
    }
    return 1;
}
Reply
#9

Didn't have a compiler in that computer, you just move the brackets by 1 space, lol.
Reply
#10

Quote:
Originally Posted by Dan.
Посмотреть сообщение
Didn't have a compiler in that computer, you just move the brackets by 1 space, lol.
lol Dan .. xD
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)