Something wrong with loading vehicle system?
#6

pawn Код:
#define GetEmptyShowroomID() Iter_Free(SRs)
public CreateShowroom(Name[], Float:X, Float:Y, Float:Z)
{
    new
        CreatedID = GetEmptyShowroomID();
    printf("Showroom: Fetched showroom %d", CreatedID);
   
    Iter_Add(SRs, CreatedID);
   
    //I'm not quite sure what is LastShowroomID supposed to point at. Last
    //ID inserted is just one line higher, and it's CreatedID.
    //Iter_Last + 1 should be substituted with Iter_Free
    LastShowroomID = GetEmptyShowroomID();
    if(LastShowroomID == -1) {
        printf("Showroom: There is no more free slots!");
        return 0;
    }
   
    format(Showrooms[CreatedID][SRName], 100, Name);
    Showrooms[CreatedID][SRX] = X;
    Showrooms[CreatedID][SRY] = Y;
    Showrooms[CreatedID][SRZ] = Z;
    Showrooms[CreatedID][SRExist] = 1;
   
    Showrooms[CreatedID][SRPick] = CreatePickup(1239, 1, X, Y, Z, 0);
   
    new String[128];
    format(String, 128, "{ADFF2F}SHOWROOM\n{ADFF2F}%s\n{FFFFFF}Showroom ID {ADFF2F}%d", Showrooms[CreatedID][SRName], CreatedID);
    Showrooms[CreatedID][SR3D] = Create3DTextLabel(String, -1, X, Y, Z, 25.0, 0);
   
    new FileName[50];
    format(FileName, 50, "%s/Showroom_%d.ini", EVOVEHICLE_SHOWROOM_DIR, CreatedID);
   
    new INI:SRFile = INI_OpenFile(FileName);
   
    INI_SetTag(SRFile, "evo");
   
    INI_TypeString(SRFile, "NAME", Name);
    INI_TypeFloat(SRFile, "X", X);
    INI_TypeFloat(SRFile, "Y", Y);
    INI_TypeFloat(SRFile, "Z", Z);
   
    INI_CloseFile(SRFile);
   
    return CreatedID;
}
Run this code, and give me the output from console/log.
Reply


Messages In This Thread
Something wrong with loading vehicle system? - by Donvalley - 21.08.2013, 09:44
Re: Something wrong with loading vehicle system? - by Misiur - 21.08.2013, 11:08
Re: Something wrong with loading vehicle system? - by Donvalley - 21.08.2013, 11:51
Re: Something wrong with loading vehicle system? - by Donvalley - 23.08.2013, 11:21
Re: Something wrong with loading vehicle system? - by Donvalley - 04.09.2013, 09:39
Re: Something wrong with loading vehicle system? - by Misiur - 04.09.2013, 09:57
Re: Something wrong with loading vehicle system? - by Donvalley - 05.09.2013, 10:48

Forum Jump:


Users browsing this thread: 1 Guest(s)