Could someone assist me? (Simple function issue)
#1

pawn Код:
IsMaxDamageWep(weaponid);
{
    new rst = -1;
    switch(weaponid)
    {
        case 24, 27, 30, 31, 32, 33 ,34, 35, 38;
        {
            rst = 1;
        }
        else
        {
            rst = 0;
        }
    }
    return rst;
}
Returns function not implemented.
Reply
#2

Remove the ';' on the first line and replace the ';' on the 'case' line with ':'.
Reply
#3

Use "case:" not "case;", and instead of "else" use "default:".
pawn Код:
IsMaxDamageWep(weaponid);
{
    new rst = -1;
    switch(weaponid)
    {
        case 24, 27, 30, 31, 32, 33, 34, 35, 38: rst = 1;
        default: rst = 0;
    }
    return rst;
}
Reply
#4

Quote:
Originally Posted by CalvinC
Посмотреть сообщение
Use "case:" not "case;", and instead of "else" use "default:".
pawn Код:
IsMaxDamageWep(weaponid);
{
    new rst = -1;
    switch(weaponid)
    {
        case 24, 27, 30, 31, 32, 33, 34, 35, 38: rst = 1;
        default: rst = 0;
    }
    return rst;
}
Lol you forgot something...

pawn Код:
IsMaxDamageWep(weaponid)
{
    new rst = -1;
    switch(weaponid)
    {
        case 24, 27, 30, 31..35, 38: rst = 1;
        default: rst = 0;
    }
    return rst;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)