So i already know how to call sql database from script.
but how to update it?
if player kill barricade then point = +1
if player trade the points to bronze coin = -Amount
Thanks alot, I am really a noob
prontera,164,172,2 script Points Room 757,{
query_sql ("SELECT `point` FROM `points_room` WHERE `account_id` = '"+getcharid(3)+"'", #Points);
waitingroom "Collect Points and Get Bronze Coins!",0;
switch( select( "Enter Greedy Points Room",
"Exchange Points to "+getitemname(.CoinID),
"Check Points",
"Exit" ) ){
Case 1:
atcommand "@die";
atcommand "@die";
atcommand "@alive";
set .@A,rand(50);
set .@B,rand(50);
mes "[insert the right answer to enter]";
mes "If A = "+.@A+" B = "+.@B;
switch( rand(1) ){
Case 0:
set .@Answer,.@A + .@B;
mes "How many is A + B ?";
break;
//Case 1:
set .@Answer,.@A - .@B;
mes "How many is A - B ?";
break;
//Case 2:
set .@Answer,.@A * .@B;
mes "How many is A * B ?";
break;
//Case 3:
set .@Answer,.@A / .@B;
mes "How many is A / B ?";
break;
}
input .@Input;
if( .@Input != .@Answer ){
mes "Incorrect Code Please Try Again";
Close;
}
else if( .@Input == .@Answer ){
warp .Map$,0,0; end;
}
Case 2:
mes "[Points Room]";
mes "You got "+#Points+" Points.";
mes "How many will be used to change into "+getitemname(.CoinID)+" ?";
mes "Each "+getitemname(.CoinID)+" = "+.Rate+" Points.";
if( #Points >= .Rate ){
input .@Amount,0,#Points;
set .@Calculation,( .@Amount / .Rate );
if( .@Calculation ){
set #Points,#Points - ( .@Calculation * .Rate );
getitem 673,.@Calculation;
mes "Gained "+.@Calculation+" x "+getitemname(.CoinID);
}
}
close;
Case 3:
mes "[Points Room]";
mes "You got "+#Points+" Greedy Points.";
default: break;
}
close;
OnInit:
set .Map$,"ordeal_1-1";
set .CoinID,673;
set .Rate,10;
monster .Map$,0,0,1906,100,strnpcinfo(0)+"::OnNPCKillEvent";
end;
OnNPCKillEvent:
if (strcharinfo(3) != "ordeal_1-1") end;
if (killedrid != 1906) end;
set #Points,#Points + 1;
monster .Map$,0,0,1906,1,strnpcinfo(0)+"::OnNPCKillEvent";
dispbottom "You Currently Have " +#Points +" Greedy Points";
end;
}
ordeal_1-1,150,150,2 script Exit 757,{
mes "[Exit Points Room]";
mes "Do you want to leave this room now?";
next;
menu "Yes",exit,"No",-; close;
exit:
warp "prontera",155,197;
close;
end;
}
ordeal_1-1,0,0,0,0 monster Greedy Barricade 1906,15,0,0,0
ordeal_1-1,0,0,0,0 monster Greedy Barricade 1906,10,0,0,0
ordeal_1-1,0,0,0,0 monster Greedy Barricade 1906,10,0,0,0
//Points Room
//Mapflags
ordeal_1-1 mapflag noskill
ordeal_1-1 mapflag nosave
ordeal_1-1 mapflag nobranch
ordeal_1-1 mapflag nomemo
ordeal_1-1 mapflag nowarp
ordeal_1-1 mapflag nowarpto
ordeal_1-1 mapflag nopenalty
ordeal_1-1 mapflag pvp_noparty
ordeal_1-1 mapflag noteleport
Question
Gelo
So i already know how to call sql database from script.
but how to update it?
if player kill barricade then point = +1
if player trade the points to bronze coin = -Amount
Thanks alot, I am really a noob
Link to comment
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.