The following code is working only for one person, I think it only works for the first who joins the server, or the first to get the piece of code activated.
take a look...
it is for The Specialists mod...
Code:
new preso[33]
new timer_seconds[33] = 0
new timer_minutes[33] = 0
Code:
if(get_distance(origin,jailone) <= 100.0 || get_distance(origin,jailtwo) <= 100.0 || get_distance(origin,jailthree) <= 100.0 || get_distance(origin,jailfour) <= 100.0)
{
set_hudmessage(175,0,0,-1.5,0.95,2,0.0,99.9,0.0,0.0,2)
show_hudmessage(players[i],"Voce esta na prisao. Seu Salario foi suspendido enquanto estiver aqui")
if (preso[players[i]] == 1) return PLUGIN_HANDLED
if (preso[players[i]] == 0)
{
preso[players[i]] = 1
client_print(players[i],print_chat,"[Brasileiros RolePlay] Para saber a quanto tempo voce esta preso use say /tempopreso!^n")
}
}
And I think the truly problem is here:
Code:
public jail_timer(id)
{
new num, players[32]
get_players(players,num,"ac")
for( new i = 0; i < num; i++ )
{
if (preso[players[i]] == 0) return PLUGIN_HANDLED
else if (preso[players[i]] == 1)
{
if ( timer_seconds[players[i]] < 60) timer_seconds[players[i]] += 1
else if (timer_seconds[players[i]] >= 60)
{
timer_seconds[players[i]] = 0
timer_minutes[players[i]] += 1
}
}
}
return PLUGIN_CONTINUE
}