/Park - I need Help Its doesn't Save just crashes the Game -
Castle - 11.03.2009
Well, I got a Car ownership FS now I wanted to add a CMD that will allow the player to do /park and park the vehicle wherever he wants.
Heres what I got:
http://pastebin.com/f5fbe9be5
Its only the cmds itself with the Saving CallBack
Now, Heres is and Example of how the File Looks like after I Spawn a Car:
Код:
{Player_Name:License_Plate:ModelId:Col1:Col2:FloatX:FloatY:FloatZ:FloatA}
Now I wanted to do that it Only changes the X, Y, Z, A Floats(editing only them) and without touching the Owner, Vehicle Plate, CarModel, Col1, Col2
Please Help, It doesn't give Errors when I Compile it just crashes my Client when I try to use the CMD
Re: /Park - I need Help Its doesn't Save just crashes the Game -
MenaceX^ - 11.03.2009
Probably CPU problem?
Re: /Park - I need Help Its doesn't Save just crashes the Game -
Castle - 12.03.2009
Quote:
Originally Posted by MenaceX^
Probably CPU problem?
|
If you checked the Pastebin.. did you saw any mistakes in the CMD?
Re: /Park - I need Help Its doesn't Save just crashes the Game -
MenaceX^ - 12.03.2009
Bah, I don't really good at saving things exept MySQL..
Why are you using 1024 cell strings?
Try to change it to 128..
Re: /Park - I need Help Its doesn't Save just crashes the Game -
Coicatak - 12.03.2009
pawn Код:
DestroyVehicle(vehicleid);
CreateVehicle(vehModel, vehX, vehY, vehZ, vehAng, vehCol1, vehCol2, 999999);
This is the problem, or at least a problem. Actually this will destroy/despawn the vehicle and then create a new one. But, here is the problem. Let's say you have 5 cars spawned on your server, and that this car is car number 2. Actully destroying the vehicle will deacrease the ID of every vehicles which had an ID >= 2:
Код:
ID 1 Car1
ID 2 Car2
ID 3 Car3
ID 4 Car4
ID 5 Car5
So if you destroy Car2 which have ID 2:
Код:
ID 1 Car1
ID 2 Car3
ID 3 Car4
ID 4 Car5
ID 5 Unused
Then the CreateVehicle will do:
Код:
ID 1 Car1
ID 2 Car3
ID 3 Car4
ID 4 Car5
ID 5 Car2
So when you save car2 it will save car ID 5 which means that in your file the 5th cars will be updated, not the second.
PS: This will happen assuming the saving function (btw you don't need to make a public for it if I'm not wrong as it isn't using timer) saves the line matching with the car ID which is logic.
Re: /Park - I need Help Its doesn't Save just crashes the Game -
Mytzake - 02.01.2011
Just remove PutPlayerInVehicle(playerid,vehicleid,0);