viewing paste Unknown #482 | Text

Posted on the
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50
map,x,y,z   script  Cash Point Exchanger    100,{
 
    set .@n$, "[Cashpoint Exchanger]";
    set .@TCG, 7227;
    
    mes .@n$;
    mes "How can I help you?";
    set .@menu$, "Cash Points > TCG:TCG > Cash Points";
    set .@j, select ( .@menu$ ) - 1;
    explode(.@menu$,.@menu$,":");
    next;
    mes .@n$;
    mes .@menu$[.@j];
    mes " ";
    mes "^FF0000Input " +((!.@j)?"Cash Points":"TCG")+ " amount to be exchanged.^000000";
    input .@amt;
    next;
    mes .@n$;
    mes "Are you sure you want to trade away " +.@amt+ " " +((!.@j)?"Cash Points":"TCG")+ "?";
    if ( select ( "Yes:No" ) == 2 ) close;
    switch (.@j)
    {
        Case 0:
            if ( #CASHPOINTS >= .@amt )
            {
                close2;
                set #CASHPOINTS, #CASHPOINTS - .@amt;
                getitem .@TCG, .@amt;   
                dispbottom "You have gained " +.@amt+ " x " +getitemname(.@TCG)+ ".";   
                end;
            }
            break;
            
        Case 1:
            if ( countitem(.@TCG) >= .@amt )
            {
                close2;
                set #CASHPOINT, #CASHPOINTS + .@amt;
                delitem .@TCG, .@amt;   
                dispbottom "You have gained " +.@amt+ " Cash Points.";
                end;
            }
            break;
    }
    next;
    mes .@n$;
    mes "Invalid amount...";
    close;
 
}
Viewed 828 times, submitted by Guest.