Jump to content
  • 0

Need an @command to give eventpoints


kyithios

Question


  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  39
  • Reputation:   5
  • Joined:  02/12/12
  • Last Seen:  

So I want to use eventpoints as a currency players can gain from doing events, and also from a consumable as a reward for voting. So this question/request is two fold.

How do I get an @command to give people event points?

How do I create a consumable (say poring coins) that gives event points?

Link to comment
Share on other sites

12 answers to this question

Recommended Posts

  • 1

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

3 hours ago, kyithios said:

No, no spaces. @evenpt kyithios 10 (command, name, quantity) doesn't work. Just says character not found or is offline.

What git hash are you using? Anyways try this one

-	script	point_cmd	-1,{
OnInit:
	bindatcmd("eventpt","point_cmd::OnAtcommand",0,99);
	end;

OnAtcommand:
	.@points = atoi(.@atcmd_parameters$[1]);
	if( .@atcmd_parameters$[0] == "" || .@points < 1 || .@atcmd_numparameters != 2 ) {
		message strcharinfo(0),"Please enter correct parameters (usage: @evenpt <character name> <number of event points>)";
		message strcharinfo(0),"@evenpt failed.";
		end;
	}
	.@charname$ = .@atcmd_parameters$[0];
	.@accid = getcharid(3,.@charname$);
	.@rewarder$ = strcharinfo(0);
	if( attachrid(.@accid) ) {
		#EVENTPOINTS += .@points;
		dispbottom "You received "+.@points+" event points.";
		dispbottom "Total Event Points: "+#EVENTPOINTS+"";	
		message .@rewarder$, ""+.@points+" Event Points was rewarded to "+.@charname$+".";
	} else {
		message strcharinfo(0),"No character found.";
		message strcharinfo(0),"Might be offline or a non-existing character name.";
		message strcharinfo(0),"@evenpt failed.";
	}
	end;
}

 

  • Upvote 2
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

3002,Ecoin,Event Coin,0,5000,,40,,,,,0xFFFFFFFF,7,2,,,,,,{ set #EVENTPOINTS,#EVENTPOINTS+10;specialeffect2 590; dispbottom  "You got 10 Event points, now"+strcharinfo(0)+" have "+#EVENTPOINTS+" Eventpoints in Total";},{},{}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

1 hour ago, kyithios said:

How do I get an @command to give people event points?

Try

-	script	point_cmd	-1,{
OnInit:
	bindatcmd("eventpt","commands_limit::OnAtcommand",0,99);
	end;

OnAtcommand:
	if( .@atcmd_parameters$[0] == "" || .@atcmd_parameters$[1] < 1 || .@atcmd_numparameters > 2 ) {
		message strcharinfo(0),"Please enter the exact character name (usage: @evenpt <character name> <number of event points>)";
		message strcharinfo(0),"@evenpt failed.";
		end;
	}
	.@charname = .@atcmd_parameters$[0];
	.@points = .@atcmd_parameters[1];
	.@charid = getcharid(3,.@charname);
	if( !isloggedin(.@charid) ) {
		message strcharinfo(0),"No character found.";
		message strcharinfo(0),"Might be offline or a non-existing character name.";
		message strcharinfo(0),"@evenpt failed.";
		end;
	}
	set #EVENTPOINTS, #EVENTPOINTS + .@points, .@charid;
	message strcharinfo(0),""+.@points+" Event Points was rewarded to "+.@charname+"";
	end;
}

 

1 hour ago, kyithios said:

How do I create a consumable (say poring coins) that gives event points?

Try to change the poring coin in item_db.txt to

7539,Poring_Coin,Poring Coin,0,0,,0,,,,,0xFFFFFFFF,7,2,,,,,,{ set #EVENTPOINTS, #EVENTPOINTS + 5; },{},{}

 

PS: Didn't test it. Please let me know if it works.

Edited by Technoken
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  8
  • Topics Per Day:  0.00
  • Content Count:  1137
  • Reputation:   290
  • Joined:  04/29/13
  • Last Seen:  

3 minutes ago, Cyro said:

3002,Ecoin,Event Coin,0,5000,,40,,,,,0xFFFFFFFF,7,2,,,,,,{ set #EVENTPOINTS,#EVENTPOINTS+10;specialeffect2 590; dispbottom  "You got 10 Event points, now"+strcharinfo(0)+" have "+#EVENTPOINTS+" Eventpoints in Total";},{},{}

 

you can use @item and add give this consumable item for event points/votepoints 
 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  39
  • Reputation:   5
  • Joined:  02/12/12
  • Last Seen:  

1 hour ago, Technoken said:

Try


-	script	point_cmd	-1,{
OnInit:
	bindatcmd("eventpt","commands_limit::OnAtcommand",0,99);
	end;

OnAtcommand:
	if( .@atcmd_parameters$[0] == "" || .@atcmd_parameters$[1] < 1 || .@atcmd_numparameters > 2 ) {
		message strcharinfo(0),"Please enter the exact character name (usage: @evenpt <character name> <number of event points>)";
		message strcharinfo(0),"@evenpt failed.";
		end;
	}
	.@charname = .@atcmd_parameters$[0];
	.@points = .@atcmd_parameters[1];
	.@charid = getcharid(3,.@charname);
	if( !isloggedin(.@charid) ) {
		message strcharinfo(0),"No character found.";
		message strcharinfo(0),"Might be offline or a non-existing character name.";
		message strcharinfo(0),"@evenpt failed.";
		end;
	}
	set #EVENTPOINTS, #EVENTPOINTS + .@points, .@charid;
	message strcharinfo(0),""+.@points+" Event Points was rewarded to "+.@charname+"";
	end;
}

 

Try to change the poring coin in item_db.txt to


7539,Poring_Coin,Poring Coin,0,0,,0,,,,,0xFFFFFFFF,7,2,,,,,,{ set #EVENTPOINTS, #EVENTPOINTS + 5; },{},{}

 

PS: Didn't test it. Please let me know if it works.

The third line of the script hits an error when @eventpt is used, says "event not found [commands_limit::OnAtcommand]"

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

1 hour ago, kyithios said:

The third line of the script hits an error when @eventpt is used, says "event not found [commands_limit::OnAtcommand]"

Sorry, please change this line

bindatcmd("eventpt","commands_limit::OnAtcommand",0,99);

to

bindatcmd("eventpt","point_cmd::OnAtcommand",0,99);
Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  39
  • Reputation:   5
  • Joined:  02/12/12
  • Last Seen:  

8 hours ago, Technoken said:

Sorry, please change this line


bindatcmd("eventpt","commands_limit::OnAtcommand",0,99);

to


bindatcmd("eventpt","point_cmd::OnAtcommand",0,99);

New error.  0a53450009e38eaf8abbe6b3ef7c1ab6.png
https://gyazo.com/0a53450009e38eaf8abbe6b3ef7c1ab6

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

13 hours ago, kyithios said:

Its always my bad habit. I forgot to add $ on strings variable. lol

Try this again and let me know if it works

-	script	point_cmd	-1,{
OnInit:
	bindatcmd("eventpt","point_cmd::OnAtcommand",0,99);
	end;

OnAtcommand:
	.@points = .@atcmd_parameters$[1];
	if( .@atcmd_parameters$[0] == "" || .@points < 1 || .@atcmd_numparameters != 2 ) {
		message strcharinfo(0),"Please enter the exact character name (usage: @evenpt <character name> <number of event points>)";
		message strcharinfo(0),"@evenpt failed.";
		end;
	}
	.@charname$ = .@atcmd_parameters$[0];
	.@charid = getcharid(0,.@charname$);
	.@accid = getcharid(3,.@charname$);
	if( !isloggedin(.@accid,.@charid) ) {
		message strcharinfo(0),"No character found.";
		message strcharinfo(0),"Might be offline or a non-existing character name.";
		message strcharinfo(0),"@evenpt failed.";
		end;
	}
	set #EVENTPOINTS, #EVENTPOINTS + .@points, .@charid;
	message strcharinfo(0),""+.@points+" Event Points was rewarded to "+.@charname$+"";
	dispbottom "You received "+.@points+" event points.", 0x63D1F4, .@charid;
	dispbottom "Total Event Points: "+#EVENTPOINTS+"", 0x63D1F4, .@charid;
	end;
}

 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  39
  • Reputation:   5
  • Joined:  02/12/12
  • Last Seen:  

10 hours ago, Technoken said:

Its always my bad habit. I forgot to add $ on strings variable. lol

Try this again and let me know if it works


-	script	point_cmd	-1,{
OnInit:
	bindatcmd("eventpt","point_cmd::OnAtcommand",0,99);
	end;

OnAtcommand:
	.@points = .@atcmd_parameters$[1];
	if( .@atcmd_parameters$[0] == "" || .@points < 1 || .@atcmd_numparameters != 2 ) {
		message strcharinfo(0),"Please enter the exact character name (usage: @evenpt <character name> <number of event points>)";
		message strcharinfo(0),"@evenpt failed.";
		end;
	}
	.@charname$ = .@atcmd_parameters$[0];
	.@charid = getcharid(0,.@charname$);
	.@accid = getcharid(3,.@charname$);
	if( !isloggedin(.@accid,.@charid) ) {
		message strcharinfo(0),"No character found.";
		message strcharinfo(0),"Might be offline or a non-existing character name.";
		message strcharinfo(0),"@evenpt failed.";
		end;
	}
	set #EVENTPOINTS, #EVENTPOINTS + .@points, .@charid;
	message strcharinfo(0),""+.@points+" Event Points was rewarded to "+.@charname$+"";
	dispbottom "You received "+.@points+" event points.", 0x63D1F4, .@charid;
	dispbottom "Total Event Points: "+#EVENTPOINTS+"", 0x63D1F4, .@charid;
	end;
}

 

Command functions now without any errors in the console, but it doesn't recognize anyone I put in, online or not, even myself. Just says "No character found." 

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  27
  • Topics Per Day:  0.01
  • Content Count:  505
  • Reputation:   126
  • Joined:  04/04/16
  • Last Seen:  

13 hours ago, kyithios said:

Command functions now without any errors in the console, but it doesn't recognize anyone I put in, online or not, even myself. Just says "No character found." 

That's weird. I tried it in my server and it's working fine. Does the name has space character?

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  10
  • Topics Per Day:  0.00
  • Content Count:  39
  • Reputation:   5
  • Joined:  02/12/12
  • Last Seen:  

On 2/9/2017 at 1:53 PM, Technoken said:

That's weird. I tried it in my server and it's working fine. Does the name has space character?

No, no spaces. @evenpt kyithios 10 (command, name, quantity) doesn't work. Just says character not found or is offline.

On 2/10/2017 at 12:25 PM, Technoken said:

What git hash are you using? Anyways try this one


-	script	point_cmd	-1,{
OnInit:
	bindatcmd("eventpt","point_cmd::OnAtcommand",0,99);
	end;

OnAtcommand:
	.@points = atoi(.@atcmd_parameters$[1]);
	if( .@atcmd_parameters$[0] == "" || .@points < 1 || .@atcmd_numparameters != 2 ) {
		message strcharinfo(0),"Please enter correct parameters (usage: @evenpt <character name> <number of event points>)";
		message strcharinfo(0),"@evenpt failed.";
		end;
	}
	.@charname$ = .@atcmd_parameters$[0];
	.@accid = getcharid(3,.@charname$);
	.@rewarder$ = strcharinfo(0);
	if( attachrid(.@accid) ) {
		#EVENTPOINTS += .@points;
		dispbottom "You received "+.@points+" event points.";
		dispbottom "Total Event Points: "+#EVENTPOINTS+"";	
		message .@rewarder$, ""+.@points+" Event Points was rewarded to "+.@charname$+".";
	} else {
		message strcharinfo(0),"No character found.";
		message strcharinfo(0),"Might be offline or a non-existing character name.";
		message strcharinfo(0),"@evenpt failed.";
	}
	end;
}

 

That worked. I'm super happy about that, that'll help my staff give out the right stuff. I had to make a small modification, but the whole thing works great.

Link to comment
Share on other sites

  • 0

  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.02
  • Content Count:  291
  • Reputation:   26
  • Joined:  12/16/17
  • Last Seen:  

On 2/10/2017 at 12:25 PM, Technoken said:

What git hash are you using? Anyways try this one


-	script	point_cmd	-1,{
OnInit:
	bindatcmd("eventpt","point_cmd::OnAtcommand",0,99);
	end;

OnAtcommand:
	.@points = atoi(.@atcmd_parameters$[1]);
	if( .@atcmd_parameters$[0] == "" || .@points < 1 || .@atcmd_numparameters != 2 ) {
		message strcharinfo(0),"Please enter correct parameters (usage: @evenpt <character name> <number of event points>)";
		message strcharinfo(0),"@evenpt failed.";
		end;
	}
	.@charname$ = .@atcmd_parameters$[0];
	.@accid = getcharid(3,.@charname$);
	.@rewarder$ = strcharinfo(0);
	if( attachrid(.@accid) ) {
		#EVENTPOINTS += .@points;
		dispbottom "You received "+.@points+" event points.";
		dispbottom "Total Event Points: "+#EVENTPOINTS+"";	
		message .@rewarder$, ""+.@points+" Event Points was rewarded to "+.@charname$+".";
	} else {
		message strcharinfo(0),"No character found.";
		message strcharinfo(0),"Might be offline or a non-existing character name.";
		message strcharinfo(0),"@evenpt failed.";
	}
	end;
}

 

Hi how can i change if another points? I need 2 points command @Donatepts @Activitypoints?

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...