Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - script Sample#command -1,{
- OnInit:
- bindatcmd("tradepoint",strnpcinfo(0)+"::OnAtCommand");
- end;
- OnAtCommand:
- if( .@atcmd_parameters$[0] == "" || atoi( .@atcmd_parameters$[1] ) <= 0 ){
- dispbottom "Usage : @tradepoint <name> <amount> ";
- }else if( atoi( .@atcmd_parameters$[1] ) > @Points ){
- dispbottom "You didnt have that much of Points.";
- }else if( strcharinfo(0) == .@atcmd_parameters$[0] ){
- dispbottom "You cant trade the points with yourself....";
- }else if( !isloggedin( getcharid( 3,.@atcmd_parameters$[0] ) ) ){
- dispbottom "Player '"+.@atcmd_parameters$[0]+"' isnt online...";
- }else{
- .@Giver$ = strcharinfo(0);
- dispbottom "waiting responses from '"+.@atcmd_parameters$[0]+" ...";
- if( attachrid( getcharid( 3,.@atcmd_parameters$[0] ) ) ){
- mes "Player ^0055FF'"+.@Giver$+"'^000000 has sent you '"+.@atcmd_parameters$[1]+"' Points.";
- next;
- if( select("Accept:Reject") == 1 ){
- @Points += atoi( .@atcmd_parameters$[1] );
- mes "Gained ^FF0000"+atoi( .@atcmd_parameters$[1] )+"^000000 Points.";
- message .@Giver$,"Accepted the Trades.";
- }else{
- message .@Giver$,"Rejected the Trades.";
- .@Failed = 1;
- }
- close2;
- }
- attachrid( getcharid( 3,.@Giver$ ) );
- if( !.@Failed ) @Points -= atoi( .@atcmd_parameters$[1] );
- dispbottom ( .@Failed ?"Failed":"Success" )+" to transfer "+atoi( .@atcmd_parameters$[1] )+" Points to "+.@atcmd_parameters$[0]+" ....";
- dispbottom "Point Left : "+@Points+" Points";
- }
- end;
- }
Advertisement
Add Comment
Please, Sign In to add comment