Jump to content
  • 0

Need an @command to give eventpoints


Question

Posted

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?

12 answers to this question

Recommended Posts

  • 1
Posted
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
  • 0
Posted
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";},{},{}

 

  • 0
Posted (edited)
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
  • 0
Posted
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 
 

  • 0
Posted
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]"

  • 0
Posted
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);
  • 0
Posted
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;
}

 

  • 0
Posted
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." 

  • 0
Posted
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?

  • 0
Posted
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.

  • 0
Posted
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?

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...