Server crashes after public SaveDynamicCars is applied via any cmd ...
#1

Server crashes after public SaveDynamicCars is applied via any cmd that works with it...
here is the pastebin: http://pastebin.com/f2e81f03
here is the DynamicFactions variable:
pawn Код:
#define MAX_DYN_CARS 700
enum Cars
{
    CarModel,
    Float:CarX,
    Float:CarY,
    Float:CarZ,
    Float:CarAngle,
    CarColor1,
    CarColor2,
    FactionCar,
    CarType,
};
new DynamicCars[MAX_DYN_CARS][Cars];
public OnGameModeInit()
{
    new File:cars = fopen("Cars/carspawns.cfg",io_read);
    new tmpstr[200];
    for(new i; i <MAX_DYN_CARS;i++)
    {
    fread(cars,tmpstr,sizeof(tmpstr));
    if(!tmpstr[0])return 1;
    else i++;
    }
}
What is the problem that Causes the Crash?
Reply
#2

What gamemode do you use?
Reply
#3

I don't know about your main error, but putting i++ at the end of the loop means you'll skip every other car, as it will i++ again afterwards.

And anyway as soon as you come across a line without a car it will return 1...
Reply
#4

Running Carlito's RP
And Thanks Wierdo you kinda gave teh solution here... !!!
Reply
#5

Ok, Now it saves but saves the cars Like so:
I do /addcar
it saves 167 Cars out of 169 when Server started + the new car = 168 I loose 1 car
Reply
#6

Any1?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)