cahadeyelo Posted October 22, 2016 Posted October 22, 2016 can you help me guys how this script will prevent the killer and the victim to get the Karma & Fame point(s) if they have the same ip address. - script orc_face -1,{ OnInit: setitemscript 601,"{ if ( [email protected]<script data-cfhash='f9e31' type="text/javascript">/* */</script>_face ) itemskill \"AL_TELEPORT\",1; }"; setitemscript 602,"{ if ( [email protected]/* */_face ) itemskill \"AL_TELEPORT\",3; }"; end; OnPCKillEvent: if( baselevel < 175 ) { end; } if( killedrid == getcharid(3) ) { end; } if( getstatus( SC_ORCISH ) ) { end; } set FAMEPOINTS,FAMEPOINTS + 1; dispbottom "Gained : "+ 1 +" Point(s). Total : "+ FAMEPOINTS +" Fame Point(s)."; .@origin = getcharid(3); attachrid( killedrid ); if ( !getstatus( SC_ORCISH ) ) { attachrid( .@origin ); @orc_face++; sc_start SC_ORCISH,60000,10; } end; OnPCDieEvent: @orc_face = 0; sc_end SC_ORCISH; if( killerrid == getcharid(3) ) { end; } if( killerrid > 2999999 ) { end; } if( killerrid == NULL ) { end; } if( baselevel < 175 ) { end; } set KARMAPOINTS,KARMAPOINTS + 1; dispbottom "Gained : "+ 1 +" Point(s). Total : "+ KARMAPOINTS +" Karma Point(s)."; end; } Quote
0 anacondaq Posted October 22, 2016 Posted October 22, 2016 something like this (i have rewrite your functions, sorry about it) OnPCDieEvent: @orc_face = 0; sc_end SC_ORCISH; if( killerrid == getcharid(3) || killerrid > 2999999 || killerrid == NULL || baselevel < 175 ) end; // Now we checking ip of our killer and killed via getcharip(), name2rid convert killedrid to name. if( getcharip() == getcharip(name2rid(killedrid)) ) end; set KARMAPOINTS,KARMAPOINTS + 1; dispbottom "Gained : "+ 1 +" Point(s). Total : "+ KARMAPOINTS +" Karma Point(s)."; end; // killedrid - the died guy // by default we are attached to guy WHO KILL // so we should for checking IP check IP address of the guy WHO died. OnPCKillEvent: // Your default checks if( baselevel < 175 || killedrid == getcharid(3) || getstatus(SC_ORCISH) ) end; // Now we checking ip of our killer and killed via getcharip(), name2rid convert killedrid to name. if( getcharip() == getcharip(name2rid(killedrid)) ) end; // the same logic like in your example, but without "attach command" and jumping between players. if( !getstatus(SC_ORCISH,0,getcharid(0,rid2name(killedrid))) ) { sc_start SC_ORCISH,60000,10,10000,SCSTART_NOTICKDEF,killedrid; set @orc_face, @orc_face + 1, getcharid(0,rid2name(killedrid)); } set KARMAPOINTS,KARMAPOINTS + 1; dispbottom "Gained : "+ 1 +" Point(s). Total : "+ KARMAPOINTS +" Karma Point(s)."; end; Quote
0 cahadeyelo Posted October 23, 2016 Author Posted October 23, 2016 i tried your codes, now it gives me error on line 10 and 20 - script orc_face -1,{ OnInit: setitemscript 601,"{ if ( !@orc_face ) itemskill \"AL_TELEPORT\",1; }"; setitemscript 602,"{ if ( !@orc_face ) itemskill \"AL_TELEPORT\",3; }"; end; OnPCKillEvent: if( baselevel < 175 || killedrid == getcharid(3) || getstatus( SC_ORCISH ) ) { end; } if( getcharip() == getcharip(name2rid(killedrid)) ) { end; } if( !getstatus(SC_ORCISH,0,getcharid(0,rid2name(killedrid))) ) { sc_start SC_ORCISH,60000,10,10000,SCSTART_NOTICKDEF,killedrid; set @orc_face, @orc_face + 1, getcharid(0,rid2name(killedrid)); } set FAMEPOINTS,FAMEPOINTS + 1; dispbottom "Gained : "+ 1 +" Point(s). Total : "+ FAMEPOINTS +" Fame Point(s)."; end; OnPCDieEvent: @orc_face = 0; sc_end SC_ORCISH; if( baselevel < 175 || killerrid == getcharid(3) || killerrid > 2999999 || killerrid == NULL ) { end; } if( getcharip() == getcharip(name2rid(killedrid)) ) { end; } set KARMAPOINTS,KARMAPOINTS + 1; dispbottom "Gained : "+ 1 +" Point(s). Total : "+ KARMAPOINTS +" Karma Point(s)."; end; } Quote
Question
cahadeyelo
can you help me guys how this script will prevent the killer and the victim to get the Karma & Fame point(s) if they have the same ip address.
2 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.