glemor123 1 Posted May 7, 2014 (edited) - script Sample -1,{OnInit: set .Delay,18000; end;OnPCKillEvent: if( @Delay < gettimetick(2) ){ getitem 7227,1; announce strcharinfo(0) +"Killed Someone At The PVP Room",bc_blue|bc_all; if( .Delay ) set @Delay,gettimetick(2) + .Delay;}end;}} how many minutes/hours is 18000 that is set?? also about the announce i would like that the players killed name will pop up. like Killer 1 Killed Killer2 lastly. how to prevent them from bypassing the delay. because they will just reconnect and the delay will be removed already Edited May 7, 2014 by glemor123 Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted May 7, 2014 1st) It's in seconds. You can convert them to minutes or hours yourself. Please see gettimetick script command documentation for it, either in our wiki or the scripting documentation: *gettimetick(<tick type>) This function will return the system time in UNIX epoch time (if tick type is 2) or the time since the start of the current day in seconds if tick type is 1.Passing 0 will make it return the server's tick, which is a measurement in milliseconds used by the server's timer system. The server's tick is an unsigned int which loops every ~50 days. Just in case you don't know, UNIX epoch time is the number of seconds elapsed since 1st of January 1970, and is useful to see, for example, for how long the character has been online with OnPCLoginEvent and OnPCLogoutEvent, which could allow you to make an 'online time counted for conviction only' jail script. 2nd) You can use the killedrid var that is set as player value when running that OnPCKillEvent, and rid2name it . Documentation: OnPCKillEvent: This special label triggers when a player kills another player. The variable 'killedrid' is set to the ID of the player killed. * rid2name(<rid>) Converts rid to name. Note: The player/monster/NPC must be online/enabled. Good for PCKillEvent where you can convert 'killedrid' to the name of the player. Note: rid2name may not produce correct character names since rid means account id. It will return the current online character of the account only. Answer: announce strcharinfo(0) +"Killed " + rid2name(killedrid) + " At The PVP Room",bc_blue|bc_all; 3rd: Variables with an @ prefix are temporary char variables (documentation) that get reset/deleted when logging out. You could make your variables permanent to the characters if you put them without any prefix (documentation). Full documentation for this part: Extent can be: permanent - They still exist when the server resets. temporary - They cease to exist when the server resets. Prefix: scope and extent nothing - A permanent variable attached to the character, the default variable type. "@" - A temporary variable attached to the character. They disappear when the character logs out. Answer: Simply change all @Delay variable names to Delay without the @. This will force the var not to get deleted on log out. Hope it helped you. Quote Share this post Link to post Share on other sites
0 glemor123 1 Posted May 10, 2014 1st) It's in seconds. You can convert them to minutes or hours yourself. Please see gettimetick script command documentation for it, either in our wiki or the scripting documentation: *gettimetick(<tick type>) This function will return the system time in UNIX epoch time (if tick type is 2) or the time since the start of the current day in seconds if tick type is 1. Passing 0 will make it return the server's tick, which is a measurement in milliseconds used by the server's timer system. The server's tick is an unsigned int which loops every ~50 days. Just in case you don't know, UNIX epoch time is the number of seconds elapsed since 1st of January 1970, and is useful to see, for example, for how long the character has been online with OnPCLoginEvent and OnPCLogoutEvent, which could allow you to make an 'online time counted for conviction only' jail script. 2nd) You can use the killedrid var that is set as player value when running that OnPCKillEvent, and rid2name it . Documentation: > OnPCKillEvent: This special label triggers when a player kills another player. The variable 'killedrid' is set to the ID of the player killed. * rid2name(<rid>) Converts rid to name. Note: The player/monster/NPC must be online/enabled. Good for PCKillEvent where you can convert 'killedrid' to the name of the player. Note: rid2name may not produce correct character names since rid means account id. It will return the current online character of the account only. Answer: announce strcharinfo(0) +"Killed " + rid2name(killedrid) + " At The PVP Room",bc_blue|bc_all; 3rd: Variables with an @ prefix are temporary char variables (documentation) that get reset/deleted when logging out. You could make your variables permanent to the characters if you put them without any prefix (documentation). Full documentation for this part: Extent can be: permanent - They still exist when the server resets. temporary - They cease to exist when the server resets. Prefix: scope and extent nothing - A permanent variable attached to the character, the default variable type. "@" - A temporary variable attached to the character. They disappear when the character logs out. Answer: Simply change all @Delay variable names to Delay without the @. This will force the var not to get deleted on log out. Hope it helped you. thank you sir is this correct? - script Sample -1,{OnInit: set .Delay,3600; end;OnPCKillEvent: if( .Delay < gettimetick(2) ){ getitem 7227,1; announce strcharinfo(0) +"Killed " + rid2name(killedrid) + " At The PVP Room",bc_blue|bc_all; if( .Delay ) set @Delay,gettimetick(2) + .Delay;}end;}} Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted May 10, 2014 You haven't changed your variables well. I told you to change all @Delay for Delay and you've changed one to .Delay and failed to change the other. Quote Share this post Link to post Share on other sites
0 glemor123 1 Posted May 10, 2014 Sorry sir. I didn't saw it - script Sample -1,{OnInit: set .Delay,3600; end;OnPCKillEvent: if( .Delay < gettimetick(2) ){ getitem 7227,1; announce strcharinfo(0) +"Killed " + rid2name(killedrid) + " At The PVP Room",bc_blue|bc_all; if( .Delay ) set .Delay,gettimetick(2) + .Delay;}end;}} how about this sir? Quote Share this post Link to post Share on other sites
0 jaBote 438 Posted May 10, 2014 Your version is supposed to be this one: - script Sample -1,{OnInit: set .Delay,3600; end;OnPCKillEvent: if( Delay < gettimetick(2) ){ getitem 7227,1; announce strcharinfo(0) +"Killed " + rid2name(killedrid) + " At The PVP Room",bc_blue|bc_all; if( .Delay ) set Delay,gettimetick(2) + .Delay;}end;}} Changing the @VAR to VAR (without prefixes) and leaving the previous .VARs without being touched, as I said. Further advices, not for any purpose but for best scripting practices. This won't make your script better but at least easier to read and understand, think that you could en up making 500-line scripts: -> Make all your variables lowercase.; -> Name your variables differently. Even if .Delay (NPC var) is different from Delay (permanent character var) on script engine, it'd be better to have a different name for them. Examples: -> .Delay to .npc_delay -> Delay to player_delay Quote Share this post Link to post Share on other sites
how many minutes/hours is 18000 that is set??
also about the announce i would like that the players killed name will pop up. like Killer 1 Killed Killer2
lastly. how to prevent them from bypassing the delay. because they will just reconnect and the delay will be removed already
Edited by glemor123Share this post
Link to post
Share on other sites