diehard Posted January 17, 2013 Posted January 17, 2013 (edited) Announce if player killed the gm in prontera only. Thanks Ops. Wrong section. Please move this topic to request script section. Thank you! Edited January 17, 2013 by diehard Quote
Capuche Posted January 17, 2013 Posted January 17, 2013 Announce if player killed the gm in prontera only. Thanks Ops. Wrong section. Please move this topic to request script section. Thank you! - script ghjkl -1,{ OnPCDieEvent: if( getgmlevel() > 0 && killerrid ) { .@acc_id = getcharid(3); attachrid( killerrid ); if( getgmlevel() > 0 ) end; attachrid( .@acc_id ); announce "GM " + strcharinfo(0) + " had been kill by Player " + rid2name( killerrid ) + " !",0; } end; } Quote
diehard Posted January 17, 2013 Author Posted January 17, 2013 @Capuche I'm using eAthena. How to fix this error Quote
Capuche Posted January 17, 2013 Posted January 17, 2013 @Capuche I'm using eAthena. How to fix this error You have got several options : 1/ Change to rAthena or 2/ Change .variable = 666; into set <variable>,<expression>; - script ghjkl -1,{ OnPCDieEvent: if( getgmlevel() > 0 && killerrid ) { set .@acc_id, getcharid(3); attachrid( killerrid ); if( getgmlevel() > 0 ) end; attachrid( .@acc_id ); announce "GM " + strcharinfo(0) + " had been kill by Player " + rid2name( killerrid ) + " !",0; } end; } Quote
diehard Posted January 17, 2013 Author Posted January 17, 2013 @Capuche No errors. But not working. Quote
AnnieRuru Posted January 17, 2013 Posted January 17, 2013 OnPCDieEvent is only use when you are killed by monsters example like pvm event scripts OnPCDieEvent: announce strcharinfo(0)+" has been killed (by monster)",0; warp "SavePoint",0,0; something like this ... otherwise, pvp script should always use OnPCKillEvent - script kjdhfksdjhf -1,{ OnPCKillEvent: if ( !getgmlevel() && strcharinfo(3) == "prontera" ) { set .@name$, strcharinfo(0); attachrid killedrid; if ( getgmlevel() ) announce strcharinfo(0) +" has been killed by "+ .@name$, 0; } end; } somehow Capuche script is working fine in my test server though Quote
Capuche Posted January 17, 2013 Posted January 17, 2013 (edited) OnPCDieEvent is only use when you are killed by monsters example like pvm event scripts OnPCDieEvent: announce strcharinfo(0)+" has been killed (by monster)",0; warp "SavePoint",0,0; something like this ... otherwise, pvp script should always use OnPCKillEvent OnPCDieEvent can be use when you are killed by player if the doc doesn't lie. It's not a bug. Just to point it out XD OnPCDieEvent: This special label triggers when a player dies. The variable 'killerrid' is set to the ID of the killer. Edited January 17, 2013 by Capuche Quote
QQfoolsorellina Posted January 18, 2013 Posted January 18, 2013 maybe he use eAthena that doesn't have direct variable assignment system Quote
AnnieRuru Posted January 18, 2013 Posted January 18, 2013 OnPCDieEvent can be use when you are killed by player if the doc doesn't lie. It's not a bug. Just to point it out XD I know, 5 years ago I also used OnPCDieEvent in pvp scripts http://www.eathena.ws/board/index.php?showtopic=155874 later only I change it into OnPCKillEvent ( dunno where the topic went ) just to make it a habit as you can see in your script, you attachrid twice, and I only did once XD Quote
Ajjwidjdneidjenw Posted January 18, 2013 Posted January 18, 2013 (edited) I wonder why it was never possible to give a parameter for getgmlevel BUILDIN_FUNC(getgmlevel) { TBL_PC* sd; if( script_getnum(st,2) ) sd = script_getnum(st,2); else sd = script_rid2sd(st); if( sd == NULL ) return 0;// no player attached, report source script_pushint(st, pc_get_group_level(sd)); return 0; } Untested (+I'm not that great @src but I can't test it right now). Edited January 18, 2013 by Jeroen Quote
AnnieRuru Posted January 18, 2013 Posted January 18, 2013 (edited) LOL !! you wanna revolutionize the script commands ? there are TONS of them that needed optional parameter like checkweight, countitem, countitem2 <- getitem/delitem/getitem2/delitem2 has optional parameter for account ID getvariableofpc <- we got getvariableofnpc, why not make another getvariableofpc which read pc variable XD etc etc BUILDIN_FUNC(getgmlevel) { TBL_PC* sd = NULL; if ( script_hasdata(st,2) ) { if ( data_isstring( script_getdata(st,2) ) ) sd = map_nick2sd( script_getstr(st,2) ); else sd = map_id2sd( script_getnum(st,2) ); } else sd = script_rid2sd(st); if ( sd ) script_pushint( st, pc_get_group_level(sd) ); else script_pushint( st, 0 ); return 0; } BUILDIN_DEF(getgmlevel,"?"), tested with - script kjdhfksdjhf -1,{ OnPCKillEvent: if ( !getgmlevel() && getgmlevel(killedrid) && strcharinfo(3) == "prontera" ) announce rid2name( killedrid ) +" has been killed by "+ strcharinfo(0), 0; end; } Edited January 18, 2013 by AnnieRuru Quote
Ajjwidjdneidjenw Posted January 18, 2013 Posted January 18, 2013 (edited) Didn't really have time earlier this morning so It was kind of rushed and I forgot a few aspects . Anyway starting exam. Edited January 18, 2013 by Jeroen Quote
Capuche Posted January 18, 2013 Posted January 18, 2013 (edited) as you can see in your script, you attachrid twice, and I only did once XD - script ghjkl -1,{ OnPCDieEvent: if( getgmlevel() > 0 && killerrid ) { .@acc_id = getcharid(3); attachrid( killerrid ); if( getgmlevel() < 1 ) announce "GM " + rid2name( .@acc_id ) + " has been kill by Player " + strcharinfo(0) + " !",0; } end; } ahAH ! XD >> Whatever you're right it's better to use OnPCKillEvent Edited January 18, 2013 by Capuche Quote
Euphy Posted January 18, 2013 Posted January 18, 2013 getvariableofpc <- we got getvariableofnpc, why not make another getvariableofpc which read pc variable XD I suggested this, but it got abandoned. D: http://rathena.org/board/topic/65277-script-commands-for-offline-characters/ Quote
AnnieRuru Posted January 20, 2013 Posted January 20, 2013 almost 10 hours wasted on this single topic update this script http://www.eathena.ws/board/index.php?s=&showtopic=177319&view=findpost&p=975591 setvar_0.2.txt about setc\getc I don't recommend to set/retrieve value from an offline char because it needs to read the value from SQL table its not thread safe, and needs memory allocations I can try to code, but seems noob x.x setc.getc_17101.diff setc works great but getc got problem prontera,155,185,5 script jdfhksdfjhksdj 100,{ setc #abcd$, "12345", 2000000; // setc @abcd$, "54321", 2000001; // set @abcd$, ""; dispbottom #abcd$; // dispbottom getc( @abcd$, 2000000 ) +""; // dispbottom getc( @abcd$, 2000001 ); dispbottom getc( #abcd$ ) +""; // dispbottom getcharid( 3, "AnnieRuru" ) +""; end; } [Warning]: Found more arguments than necessary. unexpected arg type C_STR [Debug]: Function: dispbottom [Debug]: Source (NPC): jdfhksdfjhksdj at prontera (155,185) [Error]: Memory manager: args of aFree 0x1071CD50 is overflowed pointer d:\rathena\src\map\script.c line 2944 Quote
Question
diehard
Announce if player killed the gm in prontera only. Thanks
Ops. Wrong section. Please move this topic to request script section. Thank you!
Edited by diehard15 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.