Jump to content
  • 0

Need Help with my Script


SlashGeeGee

Question


  • Group:  Members
  • Topic Count:  111
  • Topics Per Day:  0.02
  • Content Count:  573
  • Reputation:   20
  • Joined:  11/19/11
  • Last Seen:  

Here's my Script :


- <tab> script <tab> KillRewards <tab> -1,{

OnPCKillEvent:
if( killedrid == getcharid(3) ) end;  // anti-suicide, can remove
getmapxy (.@map$, .@x, .@y, 0);
if( .@map$ == "guild_vs3")
		set #CASHPOINTS, #CASHPOINTS + 5;		// Cash Points
	dispbottom "Gained 5 Cash Points.	  Total = " + #CASHPOINTS;
end;
}

how to add more maps for the kill system ? and add a delay of 1 minute for every person killed .

Thank You

SlashGeeGee

Edited by SlashGeeGee
Link to comment
Share on other sites

3 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  45
  • Topics Per Day:  0.01
  • Content Count:  715
  • Reputation:   83
  • Joined:  01/05/12
  • Last Seen:  

Try this

Note: 300 = 5 mins

-	script	YOURPVPCASHPOINT	-1,{

OnPCKillEvent:
set @cashpkilldelay, 300; //Kill delay for same person in seconds

if(@cashpkillid != killedrid || @cashpkilltime + @cashpkilldelay < gettimetick(2)) {
	set #CASHPOINTS, #CASHPOINTS + 1;
	set @cashpkillid, killedrid;
	set @cashpkilltime, gettimetick(2);
	dispbottom "you gained 1 cash point";
}
end;
}

Sorry about this script i forgot that it has no certain map for kill system .but you can still modify this script i gave you

Edited by Lelouch
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  6
  • Topics Per Day:  0.00
  • Content Count:  11
  • Reputation:   1
  • Joined:  05/13/12
  • Last Seen:  

May be like this with map array ?

-	   script  YOURPVPCASHPOINT		-1,{
OnInit:
setarray .mappk$[0],"mapname1","mapname2","mapname3",...,"mapnamex";
set @cashpkilldelay, 300; //Delay

OnPCKillEvent:
getmapxy (.@map$, .@x, .@y, 0);
for(set .@i,0; .@i < (getarraysize(.mappk$)); set .@i,.@i+1) {
if(.@map$ ==  .mappk$[.@i]) {
	if(@cashpkillid != killedrid || @cashpkilltime + @cashpkilldelay < gettimetick(2)) {
			set #CASHPOINTS, #CASHPOINTS + 1;
			set @cashpkillid, killedrid;
			set @cashpkilltime, gettimetick(2);
			dispbottom "you gained 1 cash point";
	}
}
}
end;
}

I didn't test it yet and I'm not pro at this point -.- try and edit by yourself

Edited by gertrude
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10013
  • Reputation:   2345
  • Joined:  10/28/11
  • Last Seen:  

try this.

http://upaste.me/017b3951032a4d6

if your players able to abuse it by relogging to reset the delay count...then you just change the variable for delay into character permanent variable.

but if you are using short delay..i think it is okay..since not all players are willing to keep relog after killed a character to gain 1 points.

@gertrude

remember to end the process of OnInit...otherwise it might return some error after you loaded it.


if(@cashpkillid != killedrid || @cashpkilltime + @cashpkilldelay < gettimetick(2)) {

and i think it is better to use && instead of ||

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