CreateCar
#1

Hello, me again.
For my dynamic house/owner-script I forwarded the following function.
pawn Код:
public GetNewPrivateCar(playerid,Owner[],CarID,Color1,Color2,Kennung[])
When the player bought his house (which works as far as I know) he gets a message now to drive to the place where he want to save his car and type a command in then.
Now the car the player is in gets deleted and a new car (loaded same as the saved dini-car) should be loaded. It works well, the cars became saved in a dini-file and after server gmx the car was loaded. But the car is first shown after gmx, not when I create it.
Here the full function:
pawn Код:
public GetNewPrivateCar(playerid,Owner[],CarID,Color1,Color2,Kennung[])
{
    new path[128], Float:px, Float:py, Float:pz, Float:pf;
    Wagenanzahl ++;
    format(path,sizeof(path),"/autos/%i.ini",Wagenanzahl);
    dini_Create(path);
    GetPlayerPos(playerid,px,py,pz);
    GetPlayerFacingAngle(playerid,pf);
    dini_FloatSet(path,"X",px);
    dini_FloatSet(path,"Y",py);
    dini_FloatSet(path,"Z",pz);
    dini_FloatSet(path,"Face",pf);
    dini_IntSet(path,"ID",CarID);
    dini_IntSet(path,"C1",Color1);
    dini_IntSet(path,"C2",Color2);
    dini_Set(path,"Owner",Owner);
    dini_Set(path,"Owner2","");
    dini_Set(path,"Plate",Kennung);
    SetVehicleNumberPlate(CreateVehicle(CarID, px, py, pz, pf, Color1, Color2, -1),Kennung);
// Looks like here's the problem. But in my LoadCars() function which is called on OnGamemodeInit this function is the same.
    format(path,sizeof(path),"/autos/anzahl.ini");
    dini_IntSet(path,"anzahl",Wagenanzahl);
    return 1;
}
Hope you can help me
Padarom
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)