PHP Code:
#include amxmodx
new iNormalVotes[2], iSpeedVotes[4], iJumpsVotes[3]
public _reset_votes()
{
arrayset(iNormalVotes, 0, sizeof(iNormalVotes))
arrayset(iSpeedVotes, 0, sizeof(iSpeedVotes))
arrayset(iJumpsVotes, 0, sizeof(iJumpsVotes))
}
public vote_smth(id, menu, item)
{
iNormalVotes[item]++ // index out of bounds
switch(item)
{
case 0: // print smth
case 1: // print smth
}
return PLUGIN_HANDLED
}
public vote_smth2(id, menu, item)
{
iSpeedVotes[item]++ // index out of bounds
switch(item)
{
case 0: // print smth
case 1: // print smth
case 2: // print smth
case 3: // print smth
}
return PLUGIN_HANDLED
}
public vote_smth2(id, menu, item)
{
iJumpsVotes[item]++
switch(item)
{
case 0: // print smth
case 1: // print smth
case 2: // print smth
}
return PLUGIN_HANDLED
}
public vote_smth3(id, menu, item)
{
iNormalVotes[item]++ // index out of bounds
switch(item)
{
case 0: // print smth
case 1: // print smth
}
return PLUGIN_HANDLED
}
public vote_smth4(id, menu, item)
{
iNormalVotes[item]++ // index out of bounds
switch(item)
{
case 0: // print smth
case 1: // print smth
}
return PLUGIN_HANDLED
}
the problem is when the variable is incremented the result is index out of bounds