undefined symbol "MAX_STRING" [+REP for helping!]
#1

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:
Код:
SA-MP Dedicated Server
----------------------
v0.3.7, ©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]    © 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:
Код:
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):
Код:
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 © 1997-2006, ITB CompuPhase


4 Errors.
Here's the script 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!
Reply
#2

Define?
Quote:

#define MAX_STRING 129

Reply
#3

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
Define?
I've tried this before and I got this:
Код:
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 © 1997-2006, ITB CompuPhase


5 Errors.
Reply
#4

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.
Reply
#5

You have not set and strreplace function...

Similar topics:
https://sampforum.blast.hk/showthread.php?tid=280084
https://sampforum.blast.hk/showthread.php?tid=609675
Reply
#6

"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.
Reply
#7

Quote:
Originally Posted by F1N4L
Посмотреть сообщение
I've checked this but I got nothing from it.
Reply
#8

Quote:
Originally Posted by Parallex
Посмотреть сообщение
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
Reply
#9

Nevermind.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)