Something wrong with loading vehicle system?
#1

Is there something wrong with this code? the problem i am having is the showroom always creates with id zero.? so to me that means something is wrong with the GetEmptyShowroom but i don't know what :S Any help?

pawn Код:
// For Showrooms
new Iterator:SRs<MAX_SHOWROOM>;
pawn Код:
// -GetEmptyShowroomID
GetEmptyShowroomID()
{
    return Iter_Free(SRs);
}
pawn Код:
// For Showroom
// - CreateShowroom
public CreateShowroom(Name[], Float:X, Float:Y, Float:Z)
{
    new CreatedID = GetEmptyShowroomID();
   
    Iter_Add(SRs, CreatedID);
    LastShowroomID = Iter_Last(SRs)+1;
   
    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;
}
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)