Need help about if and else on script

hadiesyafiq

New member
Messages
160
Points
0
Age
35
Location
Malaysia
Github
hadiesyafiq
Emulator
hi i want make this script will work if we have just one of 3 different item

1 got 3 kind of item apple,meat and orange...this script will be use if we have one of the item..

example

-    script    VIP    FAKE_NPC,{

    OnPCLoginEvent:
        if (countitem(apple) > 0)
        {
            setparam(125, 55 * .exp_rate); // SP_MOD_EXP
            setparam(126, 40 * .drop_rate); // SP_MOD_DROP
            setparam(127, 0); // SP_MOD_DEATH
        }
        else
        {
            setparam(125, 100); // SP_MOD_EXP
            setparam(126, 100); // SP_MOD_DROP
            setparam(127, 0); // SP_MOD_DEATH
        }
    end;

    OnPCLoginEvent:
        if (countitem(meat) > 0)
        {
            setparam(125, 55 * .exp_rate); // SP_MOD_EXP
            setparam(126, 40 * .drop_rate); // SP_MOD_DROP
            setparam(127, 0); // SP_MOD_DEATH
        }
        else
        {
            setparam(125, 100); // SP_MOD_EXP
            setparam(126, 100); // SP_MOD_DROP
            setparam(127, 0); // SP_MOD_DEATH
        }
    end;

    OnPCLoginEvent:
        if (countitem(orange) > 0)
        {
            setparam(125, 55 * .exp_rate); // SP_MOD_EXP
            setparam(126, 40 * .drop_rate); // SP_MOD_DROP
            setparam(127, 0); // SP_MOD_DEATH
        }
        else
        {
            setparam(125, 100); // SP_MOD_EXP
            setparam(126, 100); // SP_MOD_DROP
            setparam(127, 0); // SP_MOD_DEATH
        }
    end;

}

not work like above..i forgot how to make script if and else...can someone show me the script?

 
Code:
if (countitem(apple) > 0 || countitem(meat) > 0 || countitem(orange) > 0){
//
} else {
//
}
 
Last edited by a moderator:
totally don't understand what this trying to do

on 1 thing, when player login, it will check the item, and if the player has the item, adjust the VIP like bonus

1. what happens if the player drop the item ? will it recalculate the exp bonus ?

2. what happens if the player has multiple of the said items ? will it stack the bonus ?

3. why use an item ????????

4. use OnPCStatCalcEvent ????? or Charms ???

5. is the bonus is bind to an account ???? or bind to an item ???

6. where the the .exp_rate comes from ?? if this isn't set anywhere, they actually get 0 because anything times ZERO is equal to ZERO

setparam(125, 55 * .exp_rate); // SP_MOD_EXP
setparam(126, 40 * .drop_rate); // SP_MOD_DROP
setparam(127, 0); // SP_MOD_DEATH




I have so many questions I don't even know where to start

EDIT: I think no.6 just forgot to add getbattleflag("<something>")

 
Last edited by a moderator:
totally don't understand what this trying to do

on 1 thing, when player login, it will check the item, and if the player has the item, adjust the VIP like bonus

1. what happens if the player drop the item ? will it recalculate the exp bonus ?

2. what happens if the player has multiple of the said items ? will it stack the bonus ?

3. why use an item ????????

4. use OnPCStatCalcEvent ????? or Charms ???

5. is the bonus is bind to an account ???? or bind to an item ???

6. where the the .exp_rate comes from ?? if this isn't set anywhere, they actually get 0 because anything times ZERO is equal to ZERO

setparam(125, 55 * .exp_rate); // SP_MOD_EXP setparam(126, 40 * .drop_rate); // SP_MOD_DROP setparam(127, 0); // SP_MOD_DEATH

setparam(125, 55 * .exp_rate); // SP_MOD_EXP
setparam(126, 40 * .drop_rate); // SP_MOD_DROP
setparam(127, 0); // SP_MOD_DEATH




I have so many questions I don't even know where to start

EDIT: I think no.6 just forgot to add getbattleflag("<something>")
yes @AnnieRuru i use your charms plugins

thats script above is just example...i made new item use charms plugins vip will bind to item its mean only the character have it will get vip bonus...the item can be store but cannot trade or drops...but have 3 item to get same script effect like 3day/7day/30day with rental script

here like this 

-    script    VIP    FAKE_NPC,{

    OnInit:
        // Players Exp rate (Base and Job Experience)
        // 0 = No Exp
        // 1 = Normal Exp
        // 2 = 2x Exp
        .exp_rate = 2;

        // Players Drop rate
        // 0 = No Drop
        // 1 = Normal Drop
        // 2 = 2x Drop
        .drop_rate = 3;

    end;

    OnPCLoginEvent:
        if (countitem(newitem1) > 0)

        {
            setparam(125, 55 * .exp_rate); // SP_MOD_EXP
            setparam(126, 40 * .drop_rate); // SP_MOD_DROP
            //setparam(127, 0); // SP_MOD_DEATH
        }
        else
        {
            setparam(125, 100); // SP_MOD_EXP
            setparam(126, 100); // SP_MOD_DROP
            //setparam(127, 100); // SP_MOD_DEATH
        }
    end;

 OnPCLoginEvent:
        if (countitem(newitem3) > 0)

        {
            setparam(125, 55 * .exp_rate); // SP_MOD_EXP
            setparam(126, 40 * .drop_rate); // SP_MOD_DROP
            //setparam(127, 0); // SP_MOD_DEATH
        }
        else
        {
            setparam(125, 100); // SP_MOD_EXP
            setparam(126, 100); // SP_MOD_DROP
            //setparam(127, 100); // SP_MOD_DEATH
        }
    end;

 OnPCLoginEvent:
        if (countitem(newitem1) > 0)

        {
            setparam(125, 55 * .exp_rate); // SP_MOD_EXP
            setparam(126, 40 * .drop_rate); // SP_MOD_DROP
            //setparam(127, 0); // SP_MOD_DEATH
        }
        else
        {
            setparam(125, 100); // SP_MOD_EXP
            setparam(126, 100); // SP_MOD_DROP
            //setparam(127, 100); // SP_MOD_DEATH
        }
    end;

}

if (countitem(apple) > 0 || countitem(meat) > 0 || countitem(orange) > 0){ // } else { // }

Code:
if (countitem(apple) > 0 || countitem(meat) > 0 || countitem(orange) > 0){
//
} else {
//
}
Thanks sir @gantz

 
Last edited by a moderator:
Back
Top