Undefined symbol string
#1

I get the givecash command from tthe lvdm gamemode,but when i compile it gives me this errors:

Code:
C:\Documents and Settings\user\Desktop\server samp\gamemodes\testserver.pwn(1351) : error 017: undefined symbol "string"
C:\Documents and Settings\user\Desktop\server samp\gamemodes\testserver.pwn(1351) : error 017: undefined symbol "string"
C:\Documents and Settings\user\Desktop\server samp\gamemodes\testserver.pwn(1351) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\server samp\gamemodes\testserver.pwn(1351) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Line 1351:

Code:
format(string, sizeof(string), "You have sent $%d to %s.", giveplayer,giveplayerid, moneys);
Reply
#2

Show line 1351, your probably need "new string[128];"
Reply
#3

pawn Code:
new
    string[ 128 ];

format( string, sizeof( string ), "You have sent $%d to %s.", giveplayer, giveplayerid, moneys );
// Rest
Reply
#4

Steel this:

Code:
C:\Documents and Settings\user\Desktop\server samp\gamemodes\testserver.pwn(1360) : error 017: undefined symbol "string"
C:\Documents and Settings\user\Desktop\server samp\gamemodes\testserver.pwn(1360) : error 017: undefined symbol "string"
C:\Documents and Settings\user\Desktop\server samp\gamemodes\testserver.pwn(1360) : error 029: invalid expression, assumed zero
C:\Documents and Settings\user\Desktop\server samp\gamemodes\testserver.pwn(1360) : fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


4 Errors.
Code:
GivePlayerMoney(playerid, (0 - moneys));
				GivePlayerMoney(giveplayerid, moneys);
				new string[128];
				format(string, sizeof(string), ""GREEN"You have sent $%d to %s.", giveplayer,giveplayerid, moneys);
				SendClientMessage(playerid, COLOR, string);
				format(string, sizeof(string), ""GREEN"%s gave you $%d.", moneys, sendername, playerid);
				SendClientMessage(giveplayerid, COLOR, string);
Reply
#5

Add the string[ 128 ]; before 1350 line and if there is another command before line 1360 add again on the 1360 line string[ 128 ];
Reply
#6

Now this :

Code:
C:\Documents and Settings\user\Desktop\server samp\gamemodes\testserver.pwn(1350) : error 021: symbol already defined: "string"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#7

Then rename it (to string2 or whatever). Also change the string name in the format();
Reply
#8

I Fixed it! Thanks for help!
Reply
#9

Still got 1 error.
Code:
C:\Users\aNdRe\Downloads\UnderWorld Roleplay\UnderWorld Roleplay\gamemodes\UWRP18.pwn(63634) : error 021: symbol already defined: "string"
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


1 Error.
Reply
#10

That means you have defined string twice. For one of the string, rename it to different one.
You might have something like this, new string[128], pName[MAX_PALYER_NAME];
new string[128];

For anyone form above, change to string2 or whatever. Make sure to also change it where you have used it.

HELPED?!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)