File Writing
#1

Hello, i have ran into a problem again I have tried for 5 hours to resolve this problem, but i really cant seem to beat it.
My problem is basically this, it should write the ComponentId into my .Cfg file, but instead of that, it writes all kinds of symbols into it.

pawn Код:
//It should write the componentid as cMod1 but it doesnt for some reason
public OnVehicleMod(playerid, vehicleid, componentid)
{        
  new playerid20 = GetDriverID(vehicleid);
    if(GetPlayerState(playerid20) == PLAYER_STATE_DRIVER) {
      if(IsAnOwnableCar(vehicleid))
              {
                for(new s=0; s<20; s++) {
                if(componentid == spoiler[0]) {
                        CarInfo[vehicleid][cMod1] = componentid;
                }
                }
                for(new s=0; s<3; s++) {
                if(componentid == nitro[0]) {
                        CarInfo[vehicleid][cMod2] = componentid;
                }
                }
                for(new s=0; s<23; s++) {
                if(componentid == fbumper[0]) {
                        CarInfo[vehicleid][cMod3] = componentid;
                }
                }
                for(new s=0; s<22; s++) {
                if(componentid == rbumper[0]) {
                        CarInfo[vehicleid][cMod4] = componentid;
                }
                }
                for(new s=0; s<28; s++) {
                if(componentid == exhaust[0]) {
                        CarInfo[vehicleid][cMod5] = componentid;
                }
                }
                for(new s=0; s<2; s++) {
                if(componentid == bventr[0]) {
                        CarInfo[vehicleid][cMod6] = componentid;
                }
                }
                for(new s=0; s<2; s++) {
                if(componentid == bventl[0]) {
                        CarInfo[vehicleid][cMod7] = componentid;
                }
                }
                for(new s=0; s<4; s++) {
                if(componentid == bscoop[0]) {
                        CarInfo[vehicleid][cMod8] = componentid;
                }
                }
                for(new s=0; s<13; s++) {
                if(componentid == rscoop[0]) {
                        CarInfo[vehicleid][cMod9] = componentid;
                }
                }
                for(new s=0; s<21; s++) {
                if(componentid == lskirt[0]) {
                        CarInfo[vehicleid][cMod10] = componentid;
                }
                }
                for(new s=0; s<21; s++) {
                if(componentid == rskirt[0]) {
                        CarInfo[vehicleid][cMod11] = componentid;
                }
                }
                for(new s=0; s<1; s++) {
                if(componentid == hydraulics[0]) {
                        CarInfo[vehicleid][cMod12] = componentid;
                }
                }
                for(new s=0; s<1; s++) {
                if(componentid == base[0]) {
                        CarInfo[vehicleid][cMod13] = componentid;
                }
                }
                for(new s=0; s<2; s++) {
                if(componentid == rbbars[0]) {
                        CarInfo[vehicleid][cMod14] = componentid;
                }
                }
                for(new s=0; s<2; s++) {
                if(componentid == fbbars[0]) {
                        CarInfo[vehicleid][cMod15] = componentid;
                }
                }
                for(new s=0; s<17; s++) {
                if(componentid == wheels[0]) {
                        CarInfo[vehicleid][cMod16] = componentid;
                }
                }
                for(new s=0; s<2; s++) {
                if(componentid == lights[0]) {
                        CarInfo[vehicleid][cMod17] = componentid;
                }
                }
        OnPropUpdate();
                return 1;
               
            }
    }
    return 0;
}
Reply
#2

Where is the part of the script that actually writes into the file?
Reply
#3

THANK you so much for asking that question, i got it fixed now

I was using the wrong format to write the Data in :P
Reply
#4

Quote:
Originally Posted by Tony1337
THANK you so much for asking that question, i got it fixed now

I was using the wrong format to write the Data in :P
Using %s instead of %d :P?
Reply
#5

yeah, thanks again
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)