SA-MP Forums Archive
String format error? Can't find it. - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: String format error? Can't find it. (/showthread.php?tid=500472)



String format error? Can't find it. - Dokins - 13.03.2014

pawn Код:
if(VehicleFaction[x] > 0 && DefaultPlate[x] == 0)
            {
                new string[12];
                format(string, sizeof(string), "%s%d", ShortFName[VehicleFaction[x]], x);
               
                if(!strcmp(string, VehPlate[x], false))
                {
                    printf("SAVED MYSQL PLATE");
                    */ERROR LINE*/format(VehPlate[x], sizeof(VehPlate[x]),"%s%d", ShortFName[VehicleFaction[x]], x); //This is the ERROR LINE.
                    SetVehicleNumberPlate(x, VehPlate[x]);
                    MySQL_SetString(x, "VehPlate", VehPlate[x], "vehicles");
                }
               
            }
            else
            {
                printf("DEFAULT PLATE");
                SetVehicleNumberPlate(x, VehPlate[x]);
            }
pawn Код:
mysql_get_field( "VehPlate", VehPlate[x]);
It gives this:

Quote:

C:\Users\user\Desktop\Bone County Roleplay\gamemodes\TRRP_MYSQL.pwn(10385) : error 001: expected token: "]", but found "-identifier-"
C:\Users\user\Desktop\Bone County Roleplay\gamemodes\TRRP_MYSQL.pwn(10385) : warning 215: expression has no effect
C:\Users\user\Desktop\Bone County Roleplay\gamemodes\TRRP_MYSQL.pwn(10385) : error 001: expected token: ";", but found "]"
C:\Users\user\Desktop\Bone County Roleplay\gamemodes\TRRP_MYSQL.pwn(10385) : error 029: invalid expression, assumed zero
C:\Users\user\Desktop\Bone County Roleplay\gamemodes\TRRP_MYSQL.pwn(10385) : fatal error 107: too many error messages on one line




Re: String format error? Can't find it. - Dokins - 13.03.2014

Still unresolved


Re: String format error? Can't find it. - Ardenshy - 13.03.2014

Change:
pawn Код:
format(VehPlate[x], sizeof(VehPlate[x]),"%s%d", ShortFName[VehicleFaction[x]], x);
To:
pawn Код:
format(VehPlate[x], sizeof(VehPlate),"%s%d", ShortFName[VehicleFaction[x]], x);



Re: String format error? Can't find it. - Dokins - 13.03.2014

Fixed! Thank you.