Raised This Month: $ Target: $400
 0% 

Weird bug: script works for 1 person only [help plz]


  
 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Author Message
TiToTal
Member
Join Date: Feb 2006
Old 01-13-2007 , 03:13   Weird bug: script works for 1 person only [help plz]
Reply With Quote #1

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
}
TiToTal is offline
 



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 22:27.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode