Jump to content
  • 0

Problem with PVP Points


Question

Posted

Hi all. I have a problem with this NPC, the problem is that you still low points in any map and not the map that says the variable ". Mapas_pvp $".

On the map it says the variable works correctly, but for example if you are in another map that this is not a monster and kill you low points, that is the error.

I let the NPC deputy.

Take care.

PuntosPvp.txt

1 answer to this question

Recommended Posts

Posted

the problem is you put closing curly bracket wrongly

and the reason behind is because you TAB wrongly

OnPCDieEvent: // Restamos los puntos al matar a alguien

if (.RestarPuntos) {

if (.MapaActivado) {

for (set .@c, 0; .@c < getarraysize(.mapas_pvp$); set .@c, .@c + 1) { // PROBLEM : this line TAB twice

if (.mapas_pvp$[.@c] == strcharinfo(3)) {

if (.PuntosNegativos)

set #PuntosPvp,#PuntosPvp - 1;

else {

if (#PuntosPvp <= 0)

end;

else

set #PuntosPvp,#PuntosPvp - 1;

} // End if

} // End if

} // End loop

} // End if

/* } */ else { // you have 1 extra curly bracket

if (.PuntosNegativos)

set #PuntosPvp,#PuntosPvp - 1;

else {

if (#PuntosPvp <= 0)

end;

else

set #PuntosPvp,#PuntosPvp - 1;

} // End if

} // End if

dispbottom "Has perdido un punto PvP , ahora tienes " + #PuntosPvp + ".";

end;

}

} // and that closing curly bracket should belongs here

that's why TABBING with each closing curly bracket is important

and a tips is

if you are using Notepad++, on the top menu there File | Edit | Search

TextFX -> TextFx Edit -> Reindent C++ code

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.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...