array index out of bound
#1

Hola, disculpen la molestнa pero llevo con este error hace dнas y me congela el servidor , no le encuentro una soluciуn, si alguien seria tan amable de ayudar a repararlo le agradecerнa, si quiere lo puedo recompensar en el servidor, tenemos 50 usuarios diarios.

Код:
] #0 003fb89c in ?? () from CiudadRP.amx
[debug] #1 003fb358 in public severTimers@_yT () from CiudadRP.amx
[debug] Run time error 4: "Array index out of bounds"
[debug]  Accessing element at index 65535 past array upper bound 99
Код:
timer severTimers[MAX_PLAYERS]()
{
	if(iAdverTimer >= 1)
		--iAdverTimer;
	foreach(Player, i)
	{
		   SyncPlayerTime(i);
	    if(IsPlayerConnected(i) && gPlayerLogged{i} == 1)
	    {
			if(Tied[i] > 0) TogglePlayerControllable(i, 0);
            if(GetPVarInt(i, "EMSAttempt") == -1) ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0, 1);
		    if(CellTime[i] > 0)
			{
				if (CellTime[i] == cchargetime)
				{
					CellTime[i] = 1;
					if(Mobile[i] != INVALID_PLAYER_ID && Mobile[Mobile[i]])
					{
						CallCost[i] = CallCost[i]+callcost;
					}
				}
				CellTime[i]++;
				if (Mobile[i] != INVALID_PLAYER_ID && Mobile[Mobile[i]])
				{
				    if(IsPlayerConnected(Mobile[i]))
				    {
						new called[MAX_PLAYER_NAME], string[96];
						GetPlayerName(Mobile[i], called, sizeof(called));
						format(string, sizeof(string), "* El telйfono de %s esta sonando", called);
						ProxDetector(30.0, Mobile[i], string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					}
				}
			}
			if(CellTime[i] == 0 && CallCost[i] > 0)
			{
			    new string[24];
				format(string, sizeof(string), "~w~Costo de llamada~n~~r~%d",CallCost[i]);
				GivePlayerCash(i, -CallCost[i]);
				GameTextForPlayer(i, string, 5000, 1);
				CallCost[i] = 0;
			}
			for(new h = 0; h < sizeof(Points); h++)
			{
				if(IsPlayerInRangeOfPoint(i, 2.0, Points[h][Pointx], Points[h][Pointy], Points[h][Pointz])){
					if(Points[h][Type] == 3 && Info[i][pPot] < 3){
						GameTextForPlayer(i, "~w~Usa /comprarhierba para comprar algo de ~n~~r~hierba", 5000, 5);
					}
					else if(Points[h][Type] == 1 && GetPVarInt(i, "Packages") == 0){
						GameTextForPlayer(i, "~w~Usa /materiales para comprar ~n~~r~paquetes de materiales.", 5000, 5);
					}
					else if(Points[h][Type] == 4){
						GameTextForPlayer(i, "~w~Usa /comprarcrack para comprar ~n~algo de ~r~crack", 5000, 5);
					}
					else if(Points[h][Type] == 5){
						GameTextForPlayer(i, "~w~Usa /paquete para comprar un ~n~~r~paquete de droga", 5000, 5);
					}
				}
			}
			if(TransportDriver[i] < 999)
			{
				if(GetPlayerVehicleID(i) != GetPlayerVehicleID(TransportDriver[i]) || !TransportDuty[TransportDriver[i]])
				{
					if(IsPlayerConnected(TransportDriver[i]))
					{
					    new string[24];
						TransportMoney[TransportDriver[i]] += TransportCost[i];
						TransportTime[TransportDriver[i]] = 0;
						TransportCost[TransportDriver[i]] = 0;
						format(string, sizeof(string), "~w~Pasajero se fue~n~~g~ganaste %d",TransportCost[i]);
						GameTextForPlayer(TransportDriver[i], string, 5000, 1);
						TransportDriver[i] = 999;
					}
				}
				else if(TransportTime[i] >= 16)
				{
					TransportTime[i] = 1;
					GivePlayerCash(i, -TransportValue[TransportDriver[i]]);
					if(TransportDriver[i] < 999)
					{
						if(IsPlayerConnected(TransportDriver[i]))
						{
		  					TransportCost[i] += TransportValue[TransportDriver[i]];
							TransportCost[TransportDriver[i]] = TransportCost[i];
						}
					}
				}
				TransportTime[i] += 1;
				new string[24];
				format(string, sizeof(string), "~r~%d ~w~: ~g~%d",TransportTime[i],TransportCost[i]);
				GameTextForPlayer(i, string, 15000, 6);
				GameTextForPlayer(TransportDriver[i], string, 15000, 6);
				if(TransportCost[i] > GetPlayerCash(i))
				{
				    RemovePlayerFromVehicle(i);
				    new Float:slx, Float:sly, Float:slz;
					GetPlayerPos(i, slx, sly, slz);
					SetPlayerPos(i, slx, sly, slz + 2);
				    GameTextForPlayer(i, "~r~No tienes mбs dinero para pagar el taxi!", 4000, 4);
				}
			}
			if(IsPlayerInAnyVehicle(i))
			{
				if(GetPlayerState(i) == PLAYER_STATE_DRIVER) SetPlayerArmedWeapon(i, 0);
				else if(Info[i][pWeapons][4] == 0) SetPlayerArmedWeapon(i, 0);
				else SetPlayerArmedWeapon(i, 29);
			}
			if(GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK && JetPack[i] == 0 && Info[i][AdminGame] < 4)
			{
				new string[74 + MAX_PLAYER_NAME];
			    format( string, sizeof( string ), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) es posible que use Cheat de JetPack .", GetPlayerNameEx(i), i);
				ABroadCast( COLOR_YELLOW, string, 2 );
				format(string, sizeof(string), "%s (ID %d) es posible que use Cheat de JetPack.", GetPlayerNameEx(i), i);
				Log("logs/hack.log", string);
				format(string, sizeof(string), "AdmCmd: %s ha sido auto-expulsado, razуn: jetpack hack.", GetPlayerNameEx(i), i);
				ABroadCast(COLOR_YELLOW, string, 0 );
				Kick(i);
			}
			if(IsPlayerInRangeOfPoint(i, 2, 1544.2, -1353.4, 329.4))
			{
				GivePlayerValidWeapon(i, 46);
			}
		}
	}
}
Reply
#2

Intenta quitandole el [MAX_PLAYERS] al timer
Reply
#3

Nop, deja de funcionar el pawno.
Reply
#4

Prueba asн.
Код:
timer severTimers(i)
{
	if(iAdverTimer >= 1)
		--iAdverTimer;
	foreach(Player, i)
	{
		   SyncPlayerTime(i);
	    if(IsPlayerConnected(i) && gPlayerLogged{i} == 1)
	    {
			if(Tied[i] > 0) TogglePlayerControllable(i, 0);
            if(GetPVarInt(i, "EMSAttempt") == -1) ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0, 1);
		    if(CellTime[i] > 0)
			{
				if (CellTime[i] == cchargetime)
				{
					CellTime[i] = 1;
					if(Mobile[i] != INVALID_PLAYER_ID && Mobile[Mobile[i]])
					{
						CallCost[i] = CallCost[i]+callcost;
					}
				}
				CellTime[i]++;
				if (Mobile[i] != INVALID_PLAYER_ID && Mobile[Mobile[i]])
				{
				    if(IsPlayerConnected(Mobile[i]))
				    {
						new called[MAX_PLAYER_NAME], string[96];
						GetPlayerName(Mobile[i], called, sizeof(called));
						format(string, sizeof(string), "* El telйfono de %s esta sonando", called);
						ProxDetector(30.0, Mobile[i], string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					}
				}
			}
			if(CellTime[i] == 0 && CallCost[i] > 0)
			{
			    new string[24];
				format(string, sizeof(string), "~w~Costo de llamada~n~~r~%d",CallCost[i]);
				GivePlayerCash(i, -CallCost[i]);
				GameTextForPlayer(i, string, 5000, 1);
				CallCost[i] = 0;
			}
			for(new h = 0; h < sizeof(Points); h++)
			{
				if(IsPlayerInRangeOfPoint(i, 2.0, Points[h][Pointx], Points[h][Pointy], Points[h][Pointz])){
					if(Points[h][Type] == 3 && Info[i][pPot] < 3){
						GameTextForPlayer(i, "~w~Usa /comprarhierba para comprar algo de ~n~~r~hierba", 5000, 5);
					}
					else if(Points[h][Type] == 1 && GetPVarInt(i, "Packages") == 0){
						GameTextForPlayer(i, "~w~Usa /materiales para comprar ~n~~r~paquetes de materiales.", 5000, 5);
					}
					else if(Points[h][Type] == 4){
						GameTextForPlayer(i, "~w~Usa /comprarcrack para comprar ~n~algo de ~r~crack", 5000, 5);
					}
					else if(Points[h][Type] == 5){
						GameTextForPlayer(i, "~w~Usa /paquete para comprar un ~n~~r~paquete de droga", 5000, 5);
					}
				}
			}
			if(TransportDriver[i] < 999)
			{
				if(GetPlayerVehicleID(i) != GetPlayerVehicleID(TransportDriver[i]) || !TransportDuty[TransportDriver[i]])
				{
					if(IsPlayerConnected(TransportDriver[i]))
					{
					    new string[24];
						TransportMoney[TransportDriver[i]] += TransportCost[i];
						TransportTime[TransportDriver[i]] = 0;
						TransportCost[TransportDriver[i]] = 0;
						format(string, sizeof(string), "~w~Pasajero se fue~n~~g~ganaste %d",TransportCost[i]);
						GameTextForPlayer(TransportDriver[i], string, 5000, 1);
						TransportDriver[i] = 999;
					}
				}
				else if(TransportTime[i] >= 16)
				{
					TransportTime[i] = 1;
					GivePlayerCash(i, -TransportValue[TransportDriver[i]]);
					if(TransportDriver[i] < 999)
					{
						if(IsPlayerConnected(TransportDriver[i]))
						{
		  					TransportCost[i] += TransportValue[TransportDriver[i]];
							TransportCost[TransportDriver[i]] = TransportCost[i];
						}
					}
				}
				TransportTime[i] += 1;
				new string[24];
				format(string, sizeof(string), "~r~%d ~w~: ~g~%d",TransportTime[i],TransportCost[i]);
				GameTextForPlayer(i, string, 15000, 6);
				GameTextForPlayer(TransportDriver[i], string, 15000, 6);
				if(TransportCost[i] > GetPlayerCash(i))
				{
				    RemovePlayerFromVehicle(i);
				    new Float:slx, Float:sly, Float:slz;
					GetPlayerPos(i, slx, sly, slz);
					SetPlayerPos(i, slx, sly, slz + 2);
				    GameTextForPlayer(i, "~r~No tienes mбs dinero para pagar el taxi!", 4000, 4);
				}
			}
			if(IsPlayerInAnyVehicle(i))
			{
				if(GetPlayerState(i) == PLAYER_STATE_DRIVER) SetPlayerArmedWeapon(i, 0);
				else if(Info[i][pWeapons][4] == 0) SetPlayerArmedWeapon(i, 0);
				else SetPlayerArmedWeapon(i, 29);
			}
			if(GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK && JetPack[i] == 0 && Info[i][AdminGame] < 4)
			{
				new string[74 + MAX_PLAYER_NAME];
			    format( string, sizeof( string ), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) es posible que use Cheat de JetPack .", GetPlayerNameEx(i), i);
				ABroadCast( COLOR_YELLOW, string, 2 );
				format(string, sizeof(string), "%s (ID %d) es posible que use Cheat de JetPack.", GetPlayerNameEx(i), i);
				Log("logs/hack.log", string);
				format(string, sizeof(string), "AdmCmd: %s ha sido auto-expulsado, razуn: jetpack hack.", GetPlayerNameEx(i), i);
				ABroadCast(COLOR_YELLOW, string, 0 );
				Kick(i);
			}
			if(IsPlayerInRangeOfPoint(i, 2, 1544.2, -1353.4, 329.4))
			{
				GivePlayerValidWeapon(i, 46);
			}
		}
	}
}
Reply
#5

Para quй un timer para usuario cuando creas un loop despuйs?

Lo correcto para mн, serнa:
Код:
timer severTimers()
{
	if(iAdverTimer >= 1)
		iAdverTimer--;
	foreach(Player, i)
	{
		   SyncPlayerTime(i);
	    if(gPlayerLogged(i) == 1)
	    {
			if(Tied[i] > 0) TogglePlayerControllable(i, 0);
            if(GetPVarInt(i, "EMSAttempt") == -1) ApplyAnimation(i, "CRACK", "crckdeth2", 4.0, 1, 0, 0, 0, 0, 1);
		    if(CellTime[i] > 0)
			{
				if (CellTime[i] == cchargetime)
				{
					CellTime[i] = 1;
					if(Mobile[i] != INVALID_PLAYER_ID && Mobile[Mobile[i]])
					{
						CallCost[i] = CallCost[i]+callcost;
					}
				}
				CellTime[i]++;
				if (Mobile[i] != INVALID_PLAYER_ID && Mobile[Mobile[i]])
				{
				    if(IsPlayerConnected(Mobile[i]))
				    {
						new called[MAX_PLAYER_NAME], string[96];
						GetPlayerName(Mobile[i], called, sizeof(called));
						format(string, sizeof(string), "* El telйfono de %s esta sonando", called);
						ProxDetector(30.0, Mobile[i], string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
					}
				}
			}
			if(CellTime[i] == 0 && CallCost[i] > 0)
			{
			    new string[24];
				format(string, sizeof(string), "~w~Costo de llamada~n~~r~%d",CallCost[i]);
				GivePlayerCash(i, -CallCost[i]);
				GameTextForPlayer(i, string, 5000, 1);
				CallCost[i] = 0;
			}
			for(new h = 0; h < sizeof(Points); h++)
			{
				if(IsPlayerInRangeOfPoint(i, 2.0, Points[h][Pointx], Points[h][Pointy], Points[h][Pointz])){
					if(Points[h][Type] == 3 && Info[i][pPot] < 3){
						GameTextForPlayer(i, "~w~Usa /comprarhierba para comprar algo de ~n~~r~hierba", 5000, 5);
					}
					else if(Points[h][Type] == 1 && GetPVarInt(i, "Packages") == 0){
						GameTextForPlayer(i, "~w~Usa /materiales para comprar ~n~~r~paquetes de materiales.", 5000, 5);
					}
					else if(Points[h][Type] == 4){
						GameTextForPlayer(i, "~w~Usa /comprarcrack para comprar ~n~algo de ~r~crack", 5000, 5);
					}
					else if(Points[h][Type] == 5){
						GameTextForPlayer(i, "~w~Usa /paquete para comprar un ~n~~r~paquete de droga", 5000, 5);
					}
				}
			}
			if(TransportDriver[i] < 999)
			{
				if(GetPlayerVehicleID(i) != GetPlayerVehicleID(TransportDriver[i]) || !TransportDuty[TransportDriver[i]])
				{
					if(IsPlayerConnected(TransportDriver[i]))
					{
					    new string[24];
						TransportMoney[TransportDriver[i]] += TransportCost[i];
						TransportTime[TransportDriver[i]] = 0;
						TransportCost[TransportDriver[i]] = 0;
						format(string, sizeof(string), "~w~Pasajero se fue~n~~g~ganaste %d",TransportCost[i]);
						GameTextForPlayer(TransportDriver[i], string, 5000, 1);
						TransportDriver[i] = 999;
					}
				}
				else if(TransportTime[i] >= 16)
				{
					TransportTime[i] = 1;
					GivePlayerCash(i, -TransportValue[TransportDriver[i]]);
					if(TransportDriver[i] < 999)
					{
						if(IsPlayerConnected(TransportDriver[i]))
						{
		  					TransportCost[i] += TransportValue[TransportDriver[i]];
							TransportCost[TransportDriver[i]] = TransportCost[i];
						}
					}
				}
				TransportTime[i] += 1;
				new string[24];
				format(string, sizeof(string), "~r~%d ~w~: ~g~%d",TransportTime[i],TransportCost[i]);
				GameTextForPlayer(i, string, 15000, 6);
				GameTextForPlayer(TransportDriver[i], string, 15000, 6);
				if(TransportCost[i] > GetPlayerCash(i))
				{
				    RemovePlayerFromVehicle(i);
				    new Float:slx, Float:sly, Float:slz;
					GetPlayerPos(i, slx, sly, slz);
					SetPlayerPos(i, slx, sly, slz + 2);
				    GameTextForPlayer(i, "~r~No tienes mбs dinero para pagar el taxi!", 4000, 4);
				}
			}
			if(IsPlayerInAnyVehicle(i))
			{
				if(GetPlayerState(i) == PLAYER_STATE_DRIVER) SetPlayerArmedWeapon(i, 0);
				else if(Info[i][pWeapons][4] == 0) SetPlayerArmedWeapon(i, 0);
				else SetPlayerArmedWeapon(i, 29);
			}
			if(GetPlayerSpecialAction(i) == SPECIAL_ACTION_USEJETPACK && JetPack[i] == 0 && Info[i][AdminGame] < 4)
			{
				new string[74 + MAX_PLAYER_NAME];
			    format( string, sizeof( string ), "{AA3333}AdmWarning{FFFF00}: %s (ID %d) es posible que use Cheat de JetPack .", GetPlayerNameEx(i), i);
				ABroadCast( COLOR_YELLOW, string, 2 );
				format(string, sizeof(string), "%s (ID %d) es posible que use Cheat de JetPack.", GetPlayerNameEx(i), i);
				Log("logs/hack.log", string);
				format(string, sizeof(string), "AdmCmd: %s ha sido auto-expulsado, razуn: jetpack hack.", GetPlayerNameEx(i), i);
				ABroadCast(COLOR_YELLOW, string, 0 );
				Kick(i);
			}
			if(IsPlayerInRangeOfPoint(i, 2, 1544.2, -1353.4, 329.4))
			{
				GivePlayerValidWeapon(i, 46);
			}
		}
	}
}
Reply
#6

Deja de funcionar,
Globito pawn me tira millones de warnings
Reply
#7

Quote:
Originally Posted by Nicosm
Посмотреть сообщение
Deja de funcionar,
Globito pawn me tira millones de warnings
En dуnde llamбs al timer ese?
Reply
#8

Quote:

main()
{
repeat severTimers();
repeat severTimers2();

aqui
Reply
#9

Код:
main()
{
}
repeat severTimers();
repeat severTimers2();
Reply
#10

error declared invalid function
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)