SA-MP Forums

Go Back   SA-MP Forums > SA-MP Scripting and Plugins > Scripting Help

Reply
 
Thread Tools Display Modes
Old 02/07/2020, 02:37 PM   #1
Yukie
Big Clucker
 
Yukie's Avatar
 
Join Date: Nov 2016
Location: Somewhere in PHILIPPINES
Posts: 114
Reputation: 3
Default Run time error 4

I always got this error in my server console
Code:
[22:05:28] [debug] Parameter count corrections:
[22:05:28] [debug]
[22:05:28] [debug] The 1st mangled argments (e.g. `<1073741823 arguments>`) below should read `<1 arguments>`
[22:05:28] [debug]
[22:05:28] [debug] Run time error 4: "Array index out of bounds"
[22:05:28] [debug]  Attempted to read/write array element at index 60 in array of size 50
[22:05:28] [debug] AMX backtrace:
[22:05:28] [debug] #0 003dd368 in public _y_utils_OnPlayerConnect (60) in roleplay.amx
[22:05:28] [debug] #1 00016738 in public SSCANF_OnPlayerConnect (60) in roleplay.amx
[22:05:28] [debug] #2 00008a64 in public MP_OPC (60) in roleplay.amx
[22:05:28] [debug] #3 native CallLocalFunction () in samp03svr
[22:05:28] [debug] #4 00006650 in ?? (60) in roleplay.amx
[22:05:28] [debug] #5 00025cc4 in public OnPlayerConnect (60) in roleplay.amx
I dont know how to fix it

here's my onplayerconnect codes
its quite long thats why I put in pastebin
https://pastebin.com/FaxLDbUz

Thanks in advance
__________________

Discord: ichaaaannn#5995|FB: @ichaaaannn
Paradox Roleplay
samp.paradox-rp.ml
Yukie is offline   Reply With Quote
Old 02/07/2020, 04:23 PM   #2
Kwarde
High-roller
 
Kwarde's Avatar
 
Join Date: Nov 2009
Location: The Netherlands
Posts: 2,740
Reputation: 1686
Default Re: Run time error 4

Runtime error 4: Array index out of bounds.

It means it tries to get data from an array from an index that does not exist. It literally says that:
Code:
[22:05:28] [debug] Run time error 4: "Array index out of bounds"
[22:05:28] [debug]  Attempted to read/write array element at index 60 in array of size 50
One of your arrays has a size of 50 cells, but it attempts to access index 60.
pawn Code:
new myArray[50];
myArray[60] = 1;
__________________
When the opportunity presents itself to flip-a da table, uh, you flip-a da table.

Discord: Kwarde#8009
Kwarde is offline   Reply With Quote
Old 02/07/2020, 04:45 PM   #3
ShadowMortar
Huge Clucker
 
ShadowMortar's Avatar
 
Join Date: Jul 2016
Location: Croatia
Posts: 303
Reputation: 89
Default Re: Run time error 4

1) Download crashdetect.dll or crashdetect.so.
2) Edit pawn.cfg, add "-d3", or use #pragma option -d3 on top of the script, then compile it.
3) Run server.exe, when it breaks, you will see the EXACT line where the error has occurred.
4) Profit.
__________________
If you appreciate(d) my help, I will appreciate +REP .

Quote:
Originally Posted by CheezIt View Post
Follow your heart and own style.
Feel free to PM me if you need help.
Quote:
Originally Posted by Pottus View Post
That is perfectly fine, I'm just pointing out where you made mistakes what does hearing "good job" get you? Absolutely nothing. You need to hear the problems otherwise you'll keep making the same mistakes
ShadowMortar is offline   Reply With Quote
Old 02/07/2020, 07:44 PM   #4
Yukie
Big Clucker
 
Yukie's Avatar
 
Join Date: Nov 2016
Location: Somewhere in PHILIPPINES
Posts: 114
Reputation: 3
Default Re: Run time error 4

Quote:
Originally Posted by ShadowMortar View Post
1) Download crashdetect.dll or crashdetect.so.
2) Edit pawn.cfg, add "-d3", or use #pragma option -d3 on top of the script, then compile it.
3) Run server.exe, when it breaks, you will see the EXACT line where the error has occurred.
4) Profit.
I already fixed it using -d3 method.. thanks
__________________

Discord: ichaaaannn#5995|FB: @ichaaaannn
Paradox Roleplay
samp.paradox-rp.ml
Yukie is offline   Reply With Quote
Reply

Thread Tools
Display Modes

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugin error / Gamemode run time error 19. TheBoZ Scripting Help 11 22/03/2016 12:40 PM
First time I see this error.... [Run time error 6: "Invalid instruction"] Scrillex Scripting Help 6 10/06/2014 10:44 PM
ERROR: run time error 19 file or function is not found SssSssSss Scripting Help 1 16/06/2013 03:31 PM
ERROR: run time error 19 file or function is not found SssSssSss Scripting Help 11 16/06/2013 12:02 PM


All times are GMT. The time now is 09:27 AM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.