SA-MP Forums Archive
Part of this code doesn't respond - 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)
+--- Thread: Part of this code doesn't respond (/showthread.php?tid=364025)



Part of this code doesn't respond - CoDeZ - 29.07.2012

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? :/


Re: Part of this code doesn't respond - KingyKings - 29.07.2012

Код:
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?


Re: Part of this code doesn't respond - CoDeZ - 29.07.2012

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


Re: Part of this code doesn't respond - KingyKings - 29.07.2012

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

i added it just to show an example ^


Re: Part of this code doesn't respond - Dan. - 29.07.2012

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



Re: Part of this code doesn't respond - Devilxz97 - 29.07.2012

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 ?


Re: Part of this code doesn't respond - CoDeZ - 29.07.2012

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 ..


Re: Part of this code doesn't respond - Devilxz97 - 29.07.2012

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



Re: Part of this code doesn't respond - Dan. - 29.07.2012

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


Re: Part of this code doesn't respond - Devilxz97 - 29.07.2012

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