Saving vehicle status on gamemodeexit
#2

Okay, i have started to make the script. Here it is:

pawn Code:
new carworld;


if(strcmp(cmd, "/park", true) == 0)
    {

                new currentcar;
                currentcar = GetPlayerVehicleID(playerid);
                carworld = GetVehicleVirtualWorld(currentcar);

                if (!dini_Exists(carintvw(playerid)))
                {
                    dini_Create(carintvw(playerid));
                }

                SaveStats(playerid);
        }
        return 1;
    }

forward LoadVWandInt(playerid);
public LoadVWandInt(playerid)
{
    SetVehicleVirtualWorld(GetPlayerVehicleID(playerid), carworld);
    KillTimer(Loadcarintandwv);
    return 1;
}

Player(playerid)
{
 new player[MAX_PLAYER_NAME];
 GetPlayerName(playerid, player, sizeof(player));
 return player;
}

carintvw(playerid)
{
  new a[256]; format(a, sizeof(a), "/ParkedVehicles/%s.ini",udb_encode(Player(playerid)));
  return a;
}

SaveStats(playerid)
{
  dini_IntSet(carintvw(playerid), "carworld", carworld);
  //dini_IntSet(carintvw(playerid), "PositionY", floatround(positiony));
  //dini_IntSet(carintvw(playerid), "PositionZ", floatround(positionz));
}

LoadStats(playerid)
{
  carworld = dini_Int(carintvw(playerid), "carworld");
  //positiony = dini_Int(carintvw(playerid), "PositionY");
  //positionz = dini_Int(carintvw(playerid), "PositionZ");
}
But there is an error on this line:

pawn Code:
carintvw(playerid)
{
  new a[256]; format(a, sizeof(a), "/ParkedVehicles/%s.ini",udb_encode(Player(playerid))); // This line
  return a;
}
ERROR: Undefined symbol udb_encode
How can i fix it?
Reply


Messages In This Thread
Saving vehicle status on gamemodeexit - by lewismichaelbbc - 21.08.2011, 06:08
Re: Saving vehicle status on gamemodeexit - by lewismichaelbbc - 21.08.2011, 07:26
Re: Saving vehicle status on gamemodeexit - by Pinguinn - 21.08.2011, 08:32
Re: Saving vehicle status on gamemodeexit - by lewismichaelbbc - 21.08.2011, 11:06

Forum Jump:


Users browsing this thread: 1 Guest(s)