kiova Posted September 28, 2012 Posted September 28, 2012 Hello ^ ^. I need help with a NPC, basically what I want to do is if I kill a player who is under level 80, no point of me. Here I leave what I have: if (.mapas_pvp$[.@c] == strcharinfo(3)) if (getcharid(0,rid2name(killerrid)) && BaseLevel <= 80 ) { close; } set #PuntosPvp,#PuntosPvp + 1; I've tried everything and can not find a way. A greeting and thanks. Quote
Emistry Posted September 28, 2012 Posted September 28, 2012 try this... OnPCKillEvent: set .@KillerAID,getcharid(3); if( attachrid(killedrid) ) if( BaseLevel >= 80 ) if( attachrid(.@KillerAID) ){ set #PuntosPvp,#PuntosPvp + 1; dispbottom "Gained 1 Point when killed Character Level 80 or Above."; } end; Quote
kiova Posted September 28, 2012 Author Posted September 28, 2012 not work. I try to kill a lvl 80 char lower and I'm not about and if I kill one superior either. Any solution? Quote
Emistry Posted September 28, 2012 Posted September 28, 2012 it work fine for me... i use a character with level 103 killed a character with level 80 ....and i gain point... if i killed level 80 below character. ...i gain nothing... Quote
kiova Posted September 28, 2012 Author Posted September 28, 2012 OnPcKillEvent: // Sumamos los puntos al matar a alguienif (.MapaActivado) { for (set .@c, 0; .@c < getarraysize(.mapas_pvp$); set .@c, .@c + 1) if (.mapas_pvp$[.@c] == strcharinfo(3)) if( attachrid(killedrid) ) if( BaseLevel >= 80 ) if( attachrid(.@KillerAID) ) set #PuntosPvp,#PuntosPvp + 1; } else set #PuntosPvp,#PuntosPvp + 1; if(#PuntosPvp==$Campeon){ dispbottom "BONUs! Has llegado a " + #PuntosPvp + " Puntos así que te mereces un pequeño premio. "; warp .mapa_bonus$,.x_bonus,.y_bonus; end; } dispbottom "Has ganado un punto , ahora tienes " + #PuntosPvp + ". Sigue así."; end; I have to be doing something wrong, that does not work, so I have the script Quote
Emistry Posted September 28, 2012 Posted September 28, 2012 try this.. OnPcKillEvent: // Sumamos los puntos al matar a alguien if (.MapaActivado) { for (set .@c, 0; .@c < getarraysize(.mapas_pvp$); set .@c, .@c + 1) if (.mapas_pvp$[.@c] == strcharinfo(3) && attachrid(killedrid) ) if( BaseLevel >= 80 ) if( attachrid(.@KillerAID) ){ set #PuntosPvp,#PuntosPvp + 1; break; } if(#PuntosPvp==$Campeon){ dispbottom "BONUs! Has llegado a " + #PuntosPvp + " Puntos así que te mereces un peque?o premio. "; warp .mapa_bonus$,.x_bonus,.y_bonus; end; } } dispbottom "Has ganado un punto , ahora tienes " + #PuntosPvp + ". Sigue así."; end; Quote
kiova Posted September 28, 2012 Author Posted September 28, 2012 error map server [Error]: script_rid2sd: fatal error ! player not attached![Debug]: Function: getcharid (1 parameter): [Debug]: Data: number value=3 [Debug]: Source (NPC): pvp (invisible/not on a map) Quote
Emistry Posted September 28, 2012 Posted September 28, 2012 OnPCKillEvent: set .@KillerAID,getcharid(3); <------------------------------------ Quote
kiova Posted September 28, 2012 Author Posted September 28, 2012 ohhhh thank you very much and works XD Quote
Question
kiova
Hello ^ ^.
I need help with a NPC, basically what I want to do is if I kill a player who is under level 80, no point of me.
Here I leave what I have:
I've tried everything and can not find a way.
A greeting and thanks.
10 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.