String format error? Can't find it.
#1

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

Reply
#2

Still unresolved
Reply
#3

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);
Reply
#4

Fixed! Thank you.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)