SetVehicleNumberPlate problem
#1

http://pastebin.com/3GU9Sz4L
Last two lines
new reg = CarInfo[idx][cReg] = dini_Int(file,"Registracija");
SetVehicleNumberPlate(idx, reg);
Error for last line C:\NooBotRP\gamemodes\noobotrp.pwn(22064) : error 035: argument type mismatch (argument 2)
Anyone, how to slove this problem?
Thank you!
Reply
#2

Try this:

pawn Код:
public LoadCar()
{
    new file[26],reg = CarInfo[idx][cReg];
    for(new idx = 1; idx < sizeof(CarInfo) ; idx++)
    {
        format(file, sizeof(file),"NooBotRP/Vehicles/%d.ini", idx)
        if(dini_Exists(file))
        {
            CarInfo[idx][cModel] = dini_Int(file,"Model");
            CarInfo[idx][cLocationx] = dini_Float(file,"Location_X");
            CarInfo[idx][cLocationy] = dini_Float(file,"Location_Y");
            CarInfo[idx][cLocationz] = dini_Float(file,"Location_Z");
            CarInfo[idx][cAngle] = dini_Float(file,"Angle");
            CarInfo[idx][cColorOne] = dini_Int(file,"Color_1");
            CarInfo[idx][cColorTwo] = dini_Int(file,"Color_2");
            strmid(CarInfo[idx][cOwner], dini_Get(file,"Owner"), 0, strlen(dini_Get(file,"Owner")), 255);
            CarInfo[idx][cOwned] = dini_Int(file,"Owned");
            CarInfo[idx][cLock] = dini_Int(file,"Locked");
            CarInfo[idx][cPaintjob] = dini_Int(file,"Paintjob");
            CarInfo[idx][cVirWorld] = dini_Int(file,"VirtualWorld");
            CarInfo[idx][cComponent0] = dini_Int(file,"Component0");
            CarInfo[idx][cComponent1] = dini_Int(file,"Component1");
            CarInfo[idx][cComponent2] = dini_Int(file,"Component2");
            CarInfo[idx][cComponent3] = dini_Int(file,"Component3");
            CarInfo[idx][cComponent4] = dini_Int(file,"Component4");
            CarInfo[idx][cComponent5] = dini_Int(file,"Component5");
            CarInfo[idx][cComponent6] = dini_Int(file,"Component6");
            CarInfo[idx][cComponent7] = dini_Int(file,"Component7");
            CarInfo[idx][cComponent8] = dini_Int(file,"Component8");
            CarInfo[idx][cComponent9] = dini_Int(file,"Component9");
            CarInfo[idx][cComponent10] = dini_Int(file,"Component10");
            CarInfo[idx][cComponent11] = dini_Int(file,"Component11");
            CarInfo[idx][cComponent12] = dini_Int(file,"Component12");
            CarInfo[idx][cComponent13] = dini_Int(file,"Component13");
            CarInfo[idx][cCode] = dini_Int(file,"SecurityCode");
            CarInfo[idx][cReg] = dini_Int(file,"Registracija");
            reg = dini_Get(file,"Registracija");
            SetVehicleNumberPlate(idx, reg);
        }
    }
    print("[SCRIPT]: Loaded Cars");
    return 1;
}
If that don't work try this:

pawn Код:
public LoadCar()
{
    new file[26],reg = CarInfo[idx][cReg];
    for(new idx = 1; idx < sizeof(CarInfo) ; idx++)
    {
        format(file, sizeof(file),"NooBotRP/Vehicles/%d.ini", idx)
        if(dini_Exists(file))
        {
            CarInfo[idx][cModel] = dini_Int(file,"Model");
            CarInfo[idx][cLocationx] = dini_Float(file,"Location_X");
            CarInfo[idx][cLocationy] = dini_Float(file,"Location_Y");
            CarInfo[idx][cLocationz] = dini_Float(file,"Location_Z");
            CarInfo[idx][cAngle] = dini_Float(file,"Angle");
            CarInfo[idx][cColorOne] = dini_Int(file,"Color_1");
            CarInfo[idx][cColorTwo] = dini_Int(file,"Color_2");
            strmid(CarInfo[idx][cOwner], dini_Get(file,"Owner"), 0, strlen(dini_Get(file,"Owner")), 255);
            CarInfo[idx][cOwned] = dini_Int(file,"Owned");
            CarInfo[idx][cLock] = dini_Int(file,"Locked");
            CarInfo[idx][cPaintjob] = dini_Int(file,"Paintjob");
            CarInfo[idx][cVirWorld] = dini_Int(file,"VirtualWorld");
            CarInfo[idx][cComponent0] = dini_Int(file,"Component0");
            CarInfo[idx][cComponent1] = dini_Int(file,"Component1");
            CarInfo[idx][cComponent2] = dini_Int(file,"Component2");
            CarInfo[idx][cComponent3] = dini_Int(file,"Component3");
            CarInfo[idx][cComponent4] = dini_Int(file,"Component4");
            CarInfo[idx][cComponent5] = dini_Int(file,"Component5");
            CarInfo[idx][cComponent6] = dini_Int(file,"Component6");
            CarInfo[idx][cComponent7] = dini_Int(file,"Component7");
            CarInfo[idx][cComponent8] = dini_Int(file,"Component8");
            CarInfo[idx][cComponent9] = dini_Int(file,"Component9");
            CarInfo[idx][cComponent10] = dini_Int(file,"Component10");
            CarInfo[idx][cComponent11] = dini_Int(file,"Component11");
            CarInfo[idx][cComponent12] = dini_Int(file,"Component12");
            CarInfo[idx][cComponent13] = dini_Int(file,"Component13");
            CarInfo[idx][cCode] = dini_Int(file,"SecurityCode");
            CarInfo[idx][cReg] = dini_Int(file,"Registracija");
            reg = dini_Int(file,"Registracija");
            SetVehicleNumberPlate(idx, reg);
        }
    }
    print("[SCRIPT]: Loaded Cars");
    return 1;
}
Reply
#3

First of all double equal sign works(a = b = c).
However a and b will have the value of c.
I guess he want to store dini_Int(file,"Registracija") into both reg and CarInfo[idx][cReg].

The only problem is that SetVehicleNumberPlate only accepts a string for the second parameter.
Try to use valstr to convert that.
Reply
#4

There are errors in both cases...first unknow variables and mismatch, second mismatch...
I also tryed with this
new string[100];
new reg = CarInfo[idx][cReg];
format(string, sizeof(string),"LS-%d-",reg);
SetVehicleNumberPlate(idx, string);
and this
new string[100];
new reg = dini_Int(file,"Registracija");
format(string, sizeof(string),"LS-%d-",reg);
SetVehicleNumberPlate(idx, string);
There are no errors but dont work :S
same with this
new string[100];
new reg = CarInfo[idx][cReg] = dini_Int(file,"Registracija");
format(string, sizeof(string),"LS-%d-",reg);
SetVehicleNumberPlate(idx, string);
Reply
#5

Bump! Anyone?
Reply
#6

You must use SetVehicleToRespawn under SetVehicleNumberPlate to make it work,
i.e.
pawn Код:
SetVehicleNumberPlate(idx,string);
SetVehicleToRespawn(idx);
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)