Jump to content
  • 0

Change permission can trade : false if account id == ?


Currently

Question


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  313
  • Reputation:   1
  • Joined:  01/22/12
  • Last Seen:  

An OnPCLoginEvent where the NPC will automatically change the player's permissions to cannot trade when

account "25xxx" login.

will be used for donators.

Link to comment
Share on other sites

6 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  218
  • Reputation:   16
  • Joined:  01/24/12
  • Last Seen:  

An OnPCLoginEvent where the NPC will automatically change the player's permissions to cannot trade when

account "25xxx" login.

will be used for donators.

Why not just create a seperate Group for donators? And then set the can_trade to false.

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  313
  • Reputation:   1
  • Joined:  01/22/12
  • Last Seen:  

But then I'll have to restart server :(

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  28
  • Topics Per Day:  0.01
  • Content Count:  218
  • Reputation:   16
  • Joined:  01/24/12
  • Last Seen:  

But then I'll have to restart server :(

No you don't. use @reloadpcdb

  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  18
  • Topics Per Day:  0.00
  • Content Count:  2044
  • Reputation:   682
  • Joined:  10/09/12
  • Last Seen:  

http://www.eathena.ws/board/index.php?showtopic=174578

revamp this script entirely

replace into item_db2 values ( 31061, 'Super_Player_card', 'Super Player card', 3, 10, null, 1, null, null, null, null, 2147483647, 7, 2, null, null, null, null, null, null, null, null );
replace into item_db2 values ( 31062, 'Hyper_Player_card', 'Hyper Player card', 3, 10, null, 1, null, null, null, null, 2147483647, 7, 2, null, null, null, null, null, null, null, null );
replace into item_db2 values ( 31063, 'Ultra_Player_card', 'Ultra Player card', 3, 10, null, 1, null, null, null, null, 2147483647, 7, 2, null, null, null, null, null, null, null, null );

//    ~~~~~ show time left in days, hours, minutes and seconds ~~~~~
function    script    timeleft__    {
   if ( ( .@left = getarg(0) ) <= 0 ) return getarg(0);
   .@day = .@left / 86400;
   .@hour = .@left % 86400 / 3600;
   .@min = .@left % 3600 / 60;
   .@sec = .@left % 60;
   if ( .@day )
       return .@day +" day "+ .@hour +" hour";
   else if ( .@hour )
       return .@hour +" hour "+ .@min +" min";
   else if ( .@min )
       return .@min +" min "+ .@sec +" sec";
   else
       return .@sec +" sec";
}

prontera,156,179,5    script    Player Promoter    947,{
   mes "[Player Promoter]";
   if ( getgmlevel() == 99 ) {
       mes "Hi Admin, do you want to distribute ^00CC00Player Promoter Cards^000000 with your name on it ?";
       next;
       for ( .@i = 1; .@i <= .total_group; .@i++ )
           .@menu$ = .@menu$ +"Distribute "+ getitemname( .group_idreq[.@i] ) +":";
       .@s = select( .@menu$ );
       getitem2 .group_idreq[.@s], 1,1,0,0, 254, 0, getcharid(0) % ( 1 << 16 ), getcharid(0) >> 16;
       close;
   }
   else if ( getgmlevel() > 1 ) {
       mes "Only Admin can use me";
       close;
   }
   for ( .@i = 1; .@i <= .total_group; .@i++ )
       .@menu$ = .@menu$ +( ( getgroupid() < .@i && countitem( .group_idreq[.@i] ) )? "upgrade to "+ .group_name$[.@i] : "" )+":";
   if ( getstrlen( #pp_accupgrade$ ) ) {
       sscanf #pp_accupgrade$, "%d %d", .@id, .@time;
       mes "Your account is currently a ^00CC00"+ .group_name$[.@id] +"^000000. You still have ^0000FF"+ callfunc( "timeleft__", .@time - gettimetick(2) )+"^000000.";
       if ( getstrlen( .@menu$ ) == .total_group ) close;
   }
   else if ( getstrlen( .@menu$ ) == .total_group ) {
       mes "Make a donation and you can upgrade your account to become Super Players ^^";
       close;
   }
   mes "Do you want to upgrade your account ?";
   next;
   .@s = select( .@menu$ );
   delitem .group_idreq[.@s], 1;
   #pp_accupgrade$ = .@s +" "+( gettimetick(2) + 2592000 ); // 1 month
   atcommand "@adjgroup "+ .@s;
   mes "[Player Promoter]";
   mes "Your account has successfully upgraded to "+ .group_name$[1];
   close;
OnPCLoginEvent:
   if ( getgmlevel() > 1 )
       #pp_accupgrade$ = "";
   if ( !getstrlen( #pp_accupgrade$ ) ) end;
   sscanf #pp_accupgrade$, "%d %d", .@id, .@time;
   .@left = .@time - gettimetick(2);
   if ( .@left > 0 ) {
       atcommand "@adjgroup "+ .@id;
       if ( .@left >= 2147483 ) end;
       addtimer .@left *1000, "player_demoter::Ondemote";
       end;
   }
Ondemote:
   atcommand "@adjgroup 0";
   message strcharinfo(0), "Your account has demoted to normal player";
   #pp_accupgrade$ = "";
   end;
OnInit:
//    setarray .group_<definition>, <group ID 1>, <group ID 2>, <group ID 3>;  ... must follow the sequence in 1,2,3,4,5 ...
   setarray .group_idreq[1], 31061, 31062, 31063;
   setarray .group_name$[1], "Super Player", "Hyper Player", "Ultra Player";
   .total_group = 3;
   end;
}

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  40
  • Topics Per Day:  0.01
  • Content Count:  587
  • Reputation:   104
  • Joined:  11/19/11
  • Last Seen:  

there is a new command that can handle this

-	script	notest12345	-1,{
OnPCLoginEvent:
if(donatorvar)
	atcommand "@rmvperm  can_trade";
}		

Edited by QQfoolsorellina
  • Upvote 1
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  162
  • Topics Per Day:  0.04
  • Content Count:  313
  • Reputation:   1
  • Joined:  01/22/12
  • Last Seen:  

Thank you! This one is much easier (:

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...