SA-MP Forums

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

Reply
 
Thread Tools Display Modes
Old 08/08/2016, 06:05 PM   #1
EgyptForLife
Huge Clucker
 
EgyptForLife's Avatar
 
Join Date: Mar 2014
Posts: 280
Reputation: 11
Default undefined symbol "MAX_STRING" [+REP for helping!]

Hello SA-MP Community,
Well I was checking a script and I wanted to test it, this is the script's thread: http://forum.sa-mp.com/showthread.ph...thmatch+Racing

At first I ran the server and got this error:
Code:
SA-MP Dedicated Server
----------------------
v0.3.7, (C)2005-2015 SA-MP Team

[20:58:14] 
[20:58:14] Server Plugins
[20:58:14] --------------
[20:58:14]  Loading plugin: sscanf
[20:58:14] 

[20:58:14]  ===============================

[20:58:14]       sscanf plugin loaded.     

[20:58:14]          Version:  2.8.1        

[20:58:14]    (c) 2012 Alex "******" Cole  

[20:58:14]  ===============================

[20:58:14]   Loaded.
[20:58:14]  Loading plugin: xml
[20:58:14]   Loaded.
[20:58:14]  Loaded 2 plugins.

[20:58:14] 
[20:58:14] Filterscripts
[20:58:14] ---------------
[20:58:14]   Loaded 0 filterscripts.

[20:58:14] Script[gamemodes/dmrace.amx]: Run time error 19: "File or function is not found"
[20:58:14] Number of vehicle models: 0
While the .amx is already there and in the gamemode0 line in the server.cfg is as the following:
Code:
gamemode0 dmrace 1
So I opened the script and started downloading all it's includes and stuff, but in the end at the compile I got these errors(after all includes are download):
Code:
C:\Users\PC-9\Desktop\Fun-Generation [DD.DM] Server\pawno\include\MTA_LOAD.inc(226) : warning 219: local variable "mapValues" shadows a variable at a preceding level
C:\Users\PC-9\Desktop\Fun-Generation [DD.DM] Server\gamemodes\dmrace2.pwn(936) : error 017: undefined symbol "MAX_STRING"
C:\Users\PC-9\Desktop\Fun-Generation [DD.DM] Server\gamemodes\dmrace2.pwn(936) : error 009: invalid array size (negative, zero or out of bounds)
C:\Users\PC-9\Desktop\Fun-Generation [DD.DM] Server\gamemodes\dmrace2.pwn(936) : error 036: empty statement
C:\Users\PC-9\Desktop\Fun-Generation [DD.DM] Server\gamemodes\dmrace2.pwn(936) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


4 Errors.
Here's the script code:
Code:
stock trcar(car[]) {
  new tmp[MAX_STRING];
  set(tmp,car);
  tmp=strreplace("[","(",tmp);
  tmp=strreplace("]",")",tmp);
  return tmp;
Hope you can help me with fixing this erorr, the one who helps will get +REP!
__________________
If I helped you, just click on this :

I am Learning Scripting, i am not pro, i don't know how to script from SCRATCH , I just take a gamemode and edit it. I think this is how almost everyone started to learn too. So, When i ask a question I want to learn on how to fix it and how to do it in the next time, not just to copy paste.
EgyptForLife is offline   Reply With Quote
Old 08/08/2016, 06:18 PM   #2
F1N4L
High-roller
 
F1N4L's Avatar
 
Join Date: Jun 2013
Posts: 2,723
Reputation: 260
Default Re: undefined symbol "MAX_STRING" [+REP for helping!]

Define?
Quote:
#define MAX_STRING 129
F1N4L is offline   Reply With Quote
Old 08/08/2016, 06:32 PM   #3
EgyptForLife
Huge Clucker
 
EgyptForLife's Avatar
 
Join Date: Mar 2014
Posts: 280
Reputation: 11
Default Re: undefined symbol "MAX_STRING" [+REP for helping!]

Quote:
Originally Posted by F1N4L View Post
Define?
I've tried this before and I got this:
Code:
C:\Users\PC-9\Desktop\Fun-Generation [DD.DM] Server\pawno\include\MTA_LOAD.inc(226) : warning 219: local variable "mapValues" shadows a variable at a preceding level
C:\Users\PC-9\Desktop\Fun-Generation [DD.DM] Server\gamemodes\dmrace2.pwn(939) : error 017: undefined symbol "set"
C:\Users\PC-9\Desktop\Fun-Generation [DD.DM] Server\gamemodes\dmrace2.pwn(940) : error 017: undefined symbol "strreplace"
C:\Users\PC-9\Desktop\Fun-Generation [DD.DM] Server\gamemodes\dmrace2.pwn(940) : error 033: array must be indexed (variable "tmp")
C:\Users\PC-9\Desktop\Fun-Generation [DD.DM] Server\gamemodes\dmrace2.pwn(941) : error 017: undefined symbol "strreplace"
C:\Users\PC-9\Desktop\Fun-Generation [DD.DM] Server\gamemodes\dmrace2.pwn(941) : error 033: array must be indexed (variable "tmp")
C:\Users\PC-9\Desktop\Fun-Generation [DD.DM] Server\gamemodes\dmrace2.pwn(1099) : warning 204: symbol is assigned a value that is never used: "ServerVoted"
Pawn compiler 3.2.3664	 	 	Copyright (c) 1997-2006, ITB CompuPhase


5 Errors.
__________________
If I helped you, just click on this :

I am Learning Scripting, i am not pro, i don't know how to script from SCRATCH , I just take a gamemode and edit it. I think this is how almost everyone started to learn too. So, When i ask a question I want to learn on how to fix it and how to do it in the next time, not just to copy paste.
EgyptForLife is offline   Reply With Quote
Old 08/08/2016, 06:36 PM   #4
Parallex
Gangsta
 
Parallex's Avatar
 
Join Date: Mar 2014
Posts: 556
Reputation: 64
Default Re: undefined symbol "MAX_STRING" [+REP for helping!]

The Runtime error 19 is caused by the misconfiguration of plugins. Are you sure you've got the required plugins in the plugin folder?

Note: The Pawn compiler errors is a different topic to be discussed.
__________________
Spectre
LS:RP Administration Team
Parallex is offline   Reply With Quote
Old 08/08/2016, 06:40 PM   #5
F1N4L
High-roller
 
F1N4L's Avatar
 
Join Date: Jun 2013
Posts: 2,723
Reputation: 260
Default Re: undefined symbol "MAX_STRING" [+REP for helping!]

You have not set and strreplace function...

Similar topics:
http://forum.sa-mp.com/showthread.php?t=280084
http://forum.sa-mp.com/showthread.php?t=609675
F1N4L is offline   Reply With Quote
Old 08/08/2016, 06:53 PM   #6
Vince
Spam Machine
 
Vince's Avatar
 
Join Date: Sep 2007
Location: Belgium
Posts: 10,066
Reputation: 2660
Default Re: undefined symbol "MAX_STRING" [+REP for helping!]

"MAX_STRING" is such an arbitrary value since a string only needs to be as large as it needs to be. If you have a script that requires "MAX_STRING" then it is a bad script. End of.

If a string is to be altered it should be done by reference (i.e. modifying the original) rather than by returning a new value. In the same way that format, strcat, strins and the other string functions work.
__________________
Vince is offline   Reply With Quote
Old 08/08/2016, 06:57 PM   #7
EgyptForLife
Huge Clucker
 
EgyptForLife's Avatar
 
Join Date: Mar 2014
Posts: 280
Reputation: 11
Default Re: undefined symbol "MAX_STRING" [+REP for helping!]

Quote:
Originally Posted by F1N4L View Post
I've checked this but I got nothing from it.
__________________
If I helped you, just click on this :

I am Learning Scripting, i am not pro, i don't know how to script from SCRATCH , I just take a gamemode and edit it. I think this is how almost everyone started to learn too. So, When i ask a question I want to learn on how to fix it and how to do it in the next time, not just to copy paste.
EgyptForLife is offline   Reply With Quote
Old 08/08/2016, 07:10 PM   #8
EgyptForLife
Huge Clucker
 
EgyptForLife's Avatar
 
Join Date: Mar 2014
Posts: 280
Reputation: 11
Default Re: undefined symbol "MAX_STRING" [+REP for helping!]

Quote:
Originally Posted by Parallex View Post
The Runtime error 19 is caused by the misconfiguration of plugins. Are you sure you've got the required plugins in the plugin folder?

Note: The Pawn compiler errors is a different topic to be discussed.
The runtime error is working fine now, but I need to work on the script and edit it, so that I can add features in it, Hope you can help me and I will +REP you
__________________
If I helped you, just click on this :

I am Learning Scripting, i am not pro, i don't know how to script from SCRATCH , I just take a gamemode and edit it. I think this is how almost everyone started to learn too. So, When i ask a question I want to learn on how to fix it and how to do it in the next time, not just to copy paste.
EgyptForLife is offline   Reply With Quote
Old 05/04/2017, 12:19 AM   #9
Vin Diesel
Gangsta
 
Vin Diesel's Avatar
 
Join Date: Aug 2011
Location: ŠSA:MP Map EditorŽ
Posts: 528
Reputation: 100
Default Re: undefined symbol "MAX_STRING" [+REP for helping!]

Nevermind.
__________________
Youtube Channel: EGMido

Last edited by Vin Diesel; 05/04/2017 at 02:38 AM.
Vin Diesel 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
[HELP] error 017: undefined symbol "MAX_STRING" KONTROWKEN Scripting Help 5 15/06/2016 11:30 AM
"error 017: undefined symbol "vehicleid"" problem. OMonger Scripting Help 5 31/01/2015 12:55 PM
error 017: undefined symbol "ReadPlayer" and error 017: undefined symbol "WritePlayer" brandypol Scripting Help 8 26/08/2014 06:16 PM
5 Dialog errors - Input line too long, undefined symbol "t","is" and "only" Deal-or-die Scripting Help 6 01/05/2012 12:08 PM


All times are GMT. The time now is 11:04 AM.


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