viewing paste Unknown #12408 | Athena

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
//By Brian
//http://rathena.org/board/user/237-brian/
 
prontera,156,178,4  script  ChangeMe    910,{
    if (getgmlevel() < 10) end;
    set .@AID, getcharid(3);    // save their RID
    
    mes "Hello GM";
    mes "Enter the char's name:";
    input .@name$;
    query_sql "SELECT `account_id`,`name` FROM `char` WHERE `name` = '"+escape_sql(.@name$)+"'", .@account_id,.@name$;
    if (!.@account_id) {
        mes "^FF0000     This player doesn't exist!";
        close;
    }
    mes "How many cash point would you like give to^0000FF " + .@name$ + "^000000?";
    input .@amt;
    if (.@amt < 1) {
        mes "^FF0000     Amount must be positive.";
        close;
    }
    
    mes " ";
    mes "Give "+.@amt+" cash points to "+.@name$+"?";
    if(select("Yes:No")==2) close;
    
    if (attachrid(.@account_id)) {
        set #CASHPOINTS, #CASHPOINTS + .@amt;
        dispbottom "Gained "+.@amt+" cash points. Total "+#CASHPOINTS+" points";
    } else {
        query_sql "INSERT INTO `acc_reg_num_db`  (`account_id`,`key`,`index`,`value`) VALUES ("+.@account_id+",'#CASHPOINTS',0,"+.@amt+") ON DUPLICATE KEY UPDATE `value`=`value`+"+.@amt;
    }
    attachrid(.@AID);
    mes "Gave "+.@amt+" cash points to "+.@name$+".";
    announce "GM "+strcharinfo(0)+" gave to "+.@name$+" "+.@amt+" Cash Points",bc_all;
    close;
}
Viewed 1222 times, submitted by Dastgir.