Need help error on gm maybe
#1

hi all i got a gamemode by bomber07 and now i am updating it for my server so i have edit moneybag dm and rpg dm to sdm and dm so now when i join the /dm or /sdm it gives this errors server-log:
Код:
----------
Loaded log file: "server_log.txt".
----------

SA-MP Dedicated Server
----------------------
v0.3.7-R2, ©2005-2015 SA-MP Team

[15:54:26] 
[15:54:26] Server Plugins
[15:54:26] --------------
[15:54:26]  Loading plugin: crashdetect
[15:54:26]   CrashDetect plugin 4.19
[15:54:26]   Loaded.
[15:54:26]  Loading plugin: sscanf
[15:54:26] 

[15:54:26]  ===============================

[15:54:26]       sscanf plugin loaded.     

[15:54:26]          Version:  2.8.2        

[15:54:26]    © 2012 Alex "******" Cole  

[15:54:26]  ===============================

[15:54:26]   Loaded.
[15:54:26]  Loading plugin: streamer
[15:54:26] 

*** Streamer Plugin v2.7.8 by Incognito loaded ***

[15:54:26]   Loaded.
[15:54:26]  Loading plugin: MapAndreas
[15:54:26]   Loaded.
[15:54:26]  Loading plugin: Whirlpool
[15:54:26]  
[15:54:26]  ==================
[15:54:26]  
[15:54:26]   Whirlpool loaded
[15:54:26]  
[15:54:26]  ==================
[15:54:26]  
[15:54:26]   Loaded.
[15:54:26]  Loaded 5 plugins.

[15:54:26] 
[15:54:26] Filterscripts
[15:54:26] ---------------
[15:54:26]   Loading filterscript 'drops.amx'...
[15:54:26] AMX (38656968) loaded
[15:54:26] 
--------------------------------------
[15:54:26]  Drop Filterscript
[15:54:26] --------------------------------------

[15:54:26]   Loading filterscript 'admin.amx'...
[15:54:26] AMX (38489800) loaded
[15:54:26]  
[15:54:26] ------------------------------------------------
[15:54:26]  
[15:54:26] Attempting to initialize ''GAdminv2.amx''...
[15:54:26] --------------------
[15:54:26] [easydb.inc] Include loaded (build 3)
[15:54:26] [GAdmin] Total forbidden words: 0
[15:54:26] [GAdmin] Total forbidden names: 0
[15:54:26] [GAdmin] Total forbidden part of names/tags: 1
[15:54:26] --------------------
[15:54:26] Administration Filterscript | GAdmin.db | Loading complete...
[15:54:26]  
[15:54:26] ------------------------------------------------
[15:54:26]  
[15:54:26]   Loading filterscript 'lazer.amx'...
[15:54:26] AMX (38987776) loaded
[15:54:26]   Loading filterscript 'objects.amx'...
[15:54:26] AMX (40361448) loaded
[15:54:26] Total dynamic objects loaded: 3954
[15:54:26]   Loading filterscript 'rm.amx'...
[15:54:26] AMX (40363184) loaded
[15:54:26]   Loading filterscript 'vehicles.amx'...
[15:54:26] AMX (38983208) loaded
[15:54:26]   Loading filterscript 'Event.amx'...
[15:54:26] AMX (38983320) loaded
[15:54:26] 
--------------------------------------
[15:54:26] X Event system By TURBO
[15:54:26] --------------------------------------

[15:54:26]   Loaded 7 filterscripts.

[15:54:26] AMX (38565176) loaded
[15:54:26] [easydb.inc] Include loaded (build 3)
[15:54:26]  
[15:54:26] Initializing gamemode...
[15:54:26]  
[15:54:26] MapAndreas: plugin could not init!
[15:54:26] MapAndreas: check files and make sure you have enough memory!
[15:54:26]  
[15:54:26] ** Team created USA, id: 0
[15:54:26] ** Team created SOVIET, id: 1
[15:54:26] ** Team created ARABIA, id: 2
[15:54:26] ** Team created AUSTRALIA, id: 3
[15:54:26] ** Team created EURASIA, id: 4
[15:54:26] ** Team created MERCENRAY, id: 5
[15:54:26] -> Total 6 teams created from gamemode!
[15:54:26]  
[15:54:26] ** Base created USA Base, base id: 0
[15:54:26] ** Base created Soviet Base, base id: 1
[15:54:26] ** Base created Arabia Base, base id: 2
[15:54:26] ** Base created Ausatralia Base, base id: 3
[15:54:26] ** Base created Eurasia Base, base id: 4
[15:54:26] -> Total 5 bases created from gamemode!
[15:54:26]  
[15:54:26] ** Prototype vehicle created for team USA, id: 0
[15:54:26] ** Prototype vehicle created for team SOVIET, id: 1
[15:54:26] ** Prototype vehicle created for team ARABIA, id: 2
[15:54:26] ** Prototype vehicle created for team AUSTRALIA, id: 3
[15:54:26] ** Prototype vehicle created for team EURASIA, id: 4
[15:54:26] -> Total 5 prototype vehicles created from gamemode!
[15:54:26]  
[15:54:26] ** Capture zone created Big Ear, id: 0, owner team: USA
[15:54:26] ** Capture zone created Desert Airport, id: 1, owner team: USA
[15:54:26] ** Capture zone created Embassy, id: 2, owner team: USA
[15:54:26] ** Capture zone created Area 51, id: 3, owner team: SOVIET
[15:54:26] ** Capture zone created Gas Station, id: 4, owner team: SOVIET
[15:54:26] ** Capture zone created Abandoned Settlement, id: 5, owner team: SOVIET
[15:54:26] ** Capture zone created Beach Shack, id: 6, owner team: SOVIET
[15:54:26] ** Capture zone created Oil Pump, id: 7, owner team: ARABIA
[15:54:26] ** Capture zone created Oil Refinery, id: 8, owner team: ARABIA
[15:54:26] ** Capture zone created Shooting Range, id: 9, owner team: ARABIA
[15:54:26] ** Capture zone created Snake Farm, id: 10, owner team: ARABIA
[15:54:26] ** Capture zone created Cluckin Bell, id: 11, owner team: AUSTRALIA
[15:54:26] ** Capture zone created Motel, id: 12, owner team: AUSTRALIA
[15:54:26] ** Capture zone created Electronics Grid, id: 13, owner team: AUSTRALIA
[15:54:26] ** Capture zone created Jays Diner, id: 14, owner team: AUSTRALIA
[15:54:26] ** Capture zone created Spread Ranch, id: 15, owner team: AUSTRALIA
[15:54:26] ** Capture zone created Caravan Park, id: 16, owner team: ARABIA
[15:54:26] ** Capture zone created Quarry, id: 17, owner team: EURASIA
[15:54:26] ** Capture zone created Mountain Outpost, id: 18, owner team: USA
[15:54:26] ** Capture zone created Bait Shop, id: 19, owner team: EURASIA
[15:54:26] ** Capture zone created Farmville, id: 20, owner team: EURASIA
[15:54:26] ** Capture zone created Cargo Ship, id: 21, owner team: EURASIA
[15:54:26] ** Capture zone created Bio Ship, id: 22, owner team: USA
[15:54:26] ** Capture zone created National Command Post, id: 23, owner team: EURASIA
[15:54:26] ** Capture zone created Black Market, id: 24, owner team: ARABIA
[15:54:26] ** Capture zone created Fuel Depot, id: 25, owner team: EURASIA
[15:54:26] ** Capture zone created Las Venturas Airport, id: 26, owner team: EURASIA
[15:54:26] -> Total 27 capture zones created from gamemode!
[15:54:26]  
[15:54:26] ** Rank created Newbie, id: 0, score: 0
[15:54:26] ** Rank created Begginer, id: 1, score: 50
[15:54:26] ** Rank created Specialist, id: 2, score: 100
[15:54:26] ** Rank created Super Specialist, id: 3, score: 200
[15:54:26] ** Rank created Gunnery, id: 4, score: 500
[15:54:26] ** Rank created Chief, id: 5, score: 1000
[15:54:26] ** Rank created Master Chief, id: 6, score: 1500
[15:54:26] ** Rank created Ensign, id: 7, score: 2500
[15:54:26] ** Rank created Killer, id: 8, score: 4500
[15:54:26] ** Rank created Lieutenant, id: 9, score: 8000
[15:54:26] ** Rank created Captain, id: 10, score: 10000
[15:54:26] ** Rank created Commander, id: 11, score: 13000
[15:54:26] ** Rank created Major, id: 12, score: 15000
[15:54:26] ** Rank created Sexy Major, id: 13, score: 20000
[15:54:26] ** Rank created Brigadier, id: 14, score: 25000
[15:54:26] ** Rank created General, id: 15, score: 40000
[15:54:26] ** Rank created Field Marshal, id: 16, score: 55000
[15:54:26] ** Rank created Killer, id: 17, score: 70000
[15:54:26] ** Rank created Warlord, id: 18, score: 150000
[15:54:26] ** Rank created Master Of War, id: 19, score: 200000
[15:54:26] ** Rank created God Of War, id: 20, score: 999999999
[15:54:26] -> Total 21 ranks created from gamemode!
[15:54:26]  
[15:54:26] ** Shop created, id: 0
[15:54:26] ** Shop created, id: 1
[15:54:26] ** Shop created, id: 2
[15:54:26] ** Shop created, id: 3
[15:54:26] ** Shop created, id: 4
[15:54:26] ** Shop created, id: 5
[15:54:26] ** Shop created, id: 6
[15:54:26] ** Shop created, id: 7
[15:54:26] ** Shop created, id: 8
[15:54:26] ** Shop created, id: 9
[15:54:26] ** Shop created, id: 10
[15:54:26] ** Shop created, id: 11
[15:54:26] ** Shop created, id: 12
[15:54:26] ** Shop created, id: 13
[15:54:26] ** Shop created, id: 14
[15:54:26] ** Shop created, id: 15
[15:54:26] ** Shop created, id: 16
[15:54:26] -> Total 17 shops created from gamemode!
[15:54:26]  
[15:54:26] ** Shop created, id: 0
[15:54:26] -> Total 1 car shops created from gamemode!
[15:54:26] ** Shop created, id: 0
[15:54:26] -> Total 1 car shops created from gamemode!
[15:54:26] ** Shop created, id: 0
[15:54:26] -> Total 1 car shops created from gamemode!
[15:54:26] ** Shop created, id: 0
[15:54:26] -> Total 1 car shops created from gamemode!
[15:54:26] ** Shop created, id: 0
[15:54:26] -> Total 1 car shops created from gamemode!
[15:54:26] 
------------------------------------------
[15:54:26] Call of Duty : World War 3

[15:54:26] ------------------------------------------

[15:54:26] Number of vehicle models: 55
[15:54:26] [connection] 127.0.0.1:53930 requests connection cookie.
[15:54:27] [connection] incoming connection: 127.0.0.1:53930 id: 0
[15:54:48] [connection] 192.168.10.2:53932 requests connection cookie.
[15:54:49] [connection] incoming connection: 192.168.10.2:53932 id: 0
[15:54:50] [join] Broly has joined the server (0:192.168.10.2)
[15:55:06] [part] [guest0]Broly has left the server (0:1)
[15:55:07] [debug] Run time error 4: "Array index out of bounds"
[15:55:07] [debug]  Attempted to read/write array element at negative index -1
[15:55:07] [debug] AMX backtrace:
[15:55:07] [debug] #0 00042cc0 in public OnPlayerTimeUpdate (0) from Ww3.amx
[15:55:07] [debug] Run time error 4: "Array index out of bounds"
[15:55:07] [debug]  Attempted to read/write array element at negative index -1
[15:55:07] [debug] AMX backtrace:
[15:55:07] [debug] #0 00042cc0 in public OnPlayerTimeUpdate (0) from Ww3.amx
[15:55:08] [debug] Run time error 4: "Array index out of bounds"
[15:55:08] [debug]  Attempted to read/write array element at negative index -1
[15:55:08] [debug] AMX backtrace:
[15:55:08] [debug] #0 00042cc0 in public OnPlayerTimeUpdate (0) from Ww3.amx
[15:55:09] [debug] Run time error 4: "Array index out of bounds"
[15:55:09] [debug]  Attempted to read/write array element at negative index -1
[15:55:09] [debug] AMX backtrace:
[15:55:09] [debug] #0 00042cc0 in public OnPlayerTimeUpdate (0) from Ww3.amx
[15:55:09] [debug] Run time error 4: "Array index out of bounds"
[15:55:09] [debug]  Attempted to read/write array element at negative index -1
[15:55:09] [debug] AMX backtrace:
[15:55:09] [debug] #0 00042cc0 in public OnPlayerTimeUpdate (0) from Ww3.amx
[15:55:10] [debug] Run time error 4: "Array index out of bounds"
[15:55:10] [debug]  Attempted to read/write array element at negative index -1
[15:55:10] [debug] AMX backtrace:
[15:55:10] [debug] #0 00042cc0 in public OnPlayerTimeUpdate (0) from Ww3.amx
[15:55:10] [debug] Run time error 4: "Array index out of bounds"
[15:55:10] [debug]  Attempted to read/write array element at negative index -1
[15:55:10] [debug] AMX backtrace:
[15:55:10] [debug] #0 00042cc0 in public OnPlayerTimeUpdate (0) from Ww3.amx
[15:55:11] [debug] Run time error 4: "Array index out of bounds"
[15:55:11] [debug]  Attempted to read/write array element at negative index -1
[15:55:11] [debug] AMX backtrace:
[15:55:11] [debug] #0 00042cc0 in public OnPlayerTimeUpdate (0) from Ww3.amx
[15:55:11] [debug] Run time error 4: "Array index out of bounds"
[15:55:11] [debug]  Attempted to read/write array element at negative index -1
[15:55:11] [debug] AMX backtrace:
[15:55:11] [debug] #0 00042cc0 in public OnPlayerTimeUpdate (0) from Ww3.amx
[15:55:12] [debug] Run time error 4: "Array index out of bounds"
[15:55:12] [debug]  Attempted to read/write array element at negative index -1
[15:55:12] [debug] AMX backtrace:
[15:55:12] [debug] #0 00042cc0 in public OnPlayerTimeUpdate (0) from Ww3.amx
Thank you in advance but please if u know how to fix it please reply
Reply
#2

i can see 1 problem, that is MapAndreas.

Try using this https://sampforum.blast.hk/showthread.php?tid=273263
Reply
#3

Quote:
Originally Posted by Jyothiranand
Посмотреть сообщение
i can see 1 problem, that is MapAndreas.

Try using this https://sampforum.blast.hk/showthread.php?tid=273263
mmm yeah that is the problem but what about onplayertimeupdate error?
Reply
#4

Quote:
Originally Posted by Venom546
Посмотреть сообщение
mmm yeah that is the problem but what about onplayertimeupdate error?
Show your entire code in OnPlayerTimeUpdate.
Reply
#5

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
Show your entire code in OnPlayerTimeUpdate.
Код:
public OnPlayerTimeUpdate(playerid)
{
	new rank = GetPlayerRank(playerid);

	new hours, minutes, seconds;
	GetPlayerConnectedTime(playerid, hours, minutes, seconds);

	new string[256];
	
	format(string, sizeof(string),"~w~Rank:%s",gRank[rank][r_name]);
	PlayerTextDrawSetString(playerid, Rank1[playerid], string);
	
	format(string, sizeof(string),"~w~Team:%s", gTeam[GetPlayerTeam(playerid)][E_NAME]);
	PlayerTextDrawSetString(playerid, Team1[playerid], string);
	
	format(string, sizeof(string),"~w~Class:%s", ReturnPlayerClassName(playerid));
	PlayerTextDrawSetString(playerid, Class1[playerid], string);
	
	for(new i=0; i<MAX_PLAYERS;++i)
	{
	new fps2 = GetPlayerFPS(i);
	new ping = GetPlayerPing(i);
	new Float:packetloss = GetPlayerPacketloss(i);
	format(string, sizeof(string),"~w~FPS: ~b~%d ~w~PING: ~b~%dms ~w~PACKETLOSS: ~b~%0.2f~n~", fps2, ping, packetloss);
	if(fps2 > 100 ||fps2 < 1) continue;
	FPS[i] = fps2;
	PlayerTextDrawSetString(i, TextdrawFPS[i], string);
	}

	
	//airdrop system
	if(	! GetPlayerVirtualWorld(playerid) &&
	    ! GetPlayerInterior(playerid) &&
		IsPlayerSpawned(playerid) &&
		! IsPlayerInAnyVehicle(playerid))
 	{
		for(new i; i < MAX_AIRDROPS; i++)
		{
		    if(gAirdrop[i][AIRDROP_EXIST])
		    {
			    if(! gAirdrop[i][AIRDROP_PICKED])
			    {
					if(IsPlayerInRangeOfPoint(playerid, 5.0, gAirdrop[i][AIRDROP_POS][0], gAirdrop[i][AIRDROP_POS][1], gAirdrop[i][AIRDROP_POS][2]))
				    {
						GameTextForPlayer(playerid, "~n~~n~~n~~n~~n~~b~~h~~h~~h~Press ~h~~k~~CONVERSATION_NO~ ~b~~h~~h~~h~to pick", 1000, 3);
						break;
					}
				}
			}
	    }
    }
	return 1;
}
Reply
#6

My guess is that you are looping trough all players.
Okay so lets imagine MAX_PLAYERS is 50 for now.
So you are looping 50 times.
When you have this:
PHP код:
new FPS[30
You are getting the error Array index out of bounds i think.
The thing is that it is looking for FPS[31] it the 31th loop while it isnt there.
Same for others such as: gAirdrop[i][AIRDROP_EXIST]

What you could do is increasing their sizes, which i do not recommend or you could create a new loop for them like:

PHP код:
MAXFPS 32
for(new d=0d<MAXFPS;++d
Reply
#7

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
My guess is that you are looping trough all players.
Okay so lets imagine MAX_PLAYERS is 50 for now.
So you are looping 50 times.
When you have this:
PHP код:
new FPS[30
You are getting the error Array index out of bounds i think.
The thing is that it is looking for FPS[31] it the 31th loop while it isnt there.
Same for others such as: gAirdrop[i][AIRDROP_EXIST]

What you could do is increasing their sizes, which i do not recommend or you could create a new loop for them like:

PHP код:
MAXFPS 32
for(new d=0d<MAXFPS;++d
thank you sir its fixed now
Reply
#8

Quote:
Originally Posted by jasperschellekens
Посмотреть сообщение
My guess is that you are looping trough all players.
Okay so lets imagine MAX_PLAYERS is 50 for now.
So you are looping 50 times.
When you have this:
PHP код:
new FPS[30
You are getting the error Array index out of bounds i think.
The thing is that it is looking for FPS[31] it the 31th loop while it isnt there.
Same for others such as: gAirdrop[i][AIRDROP_EXIST]

What you could do is increasing their sizes, which i do not recommend or you could create a new loop for them like:

PHP код:
MAXFPS 32
for(new d=0d<MAXFPS;++d
The loop starts from 0 so the index will never be -1 as the run time error indicates. The only part of code which is yet unknown (as to what value it returns) is
pawn Код:
new rank = GetPlayerRank(playerid);
which is later used in here:
Код:
format(string, sizeof(string),"~w~Rank:%s",gRank[rank][r_name]);
Venom546, provide GetPlayerRank function and gRank initialization.

If you want to know the exact line, you can use -d3 flag. Learn more here: https://github.com/Zeex/samp-plugin-...ith-debug-info
Reply
#9

Quote:
Originally Posted by Calisthenics
Посмотреть сообщение
The loop starts from 0 so the index will never be -1 as the run time error indicates. The only part of code which is yet unknown (as to what value it returns) is
pawn Код:
new rank = GetPlayerRank(playerid);
which is later used in here:
Код:
format(string, sizeof(string),"~w~Rank:%s",gRank[rank][r_name]);
Venom546, provide GetPlayerRank function and gRank initialization.

If you want to know the exact line, you can use -d3 flag. Learn more here: https://github.com/Zeex/samp-plugin-...ith-debug-info
bro no need its fixed now i dont need to make it bad
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)