Saving problem :x
#2

Well your code really doesn't make any sense, there's several problems with it. First of all, you're creating a string for the playername with a length of MAX_PLAYER_NAME (24), and then you're specifying the length of the string as 30 in your GetPlayerName function? You should change that to:

pawn Код:
GetPlayerName(playerid, pname,30);
The next part doesn't make sense at all, this is assuming that CarOwner[playerid] has stored the ID of the vehicle that they own. So why do you need a loop at all to find what car they own? Then you're storing the ID of the vehicle in a float and storing it as the health of the vehicle!? Also you're trying to store the return value of the GetVehicleZAngle function, which won't work since the return value is not the angle.

Either way I suggest you store the ID of the vehicle they own in the CarOwner variable. Then you can simply do this:

pawn Код:
if(dini_Exists(file))
{
    new Float:Healthh, Float:angl;
    GetVehicleHealth(CarOwner[playerid],Healthh);
    GetVehicleZAngle(CarOwner[playerid],angl);
    GetVehiclePos(CarOwner[playerid],x,y,z);
    dini_IntSet(file,"LastID", CarOwner[playerid]);
    dini_IntSet(file,"CModel", CarInfo[CarOwner[playerid]][CModel]);
    dini_FloatSet(file,"PosX", x);
    dini_FloatSet(file,"PosY", y);
    dini_FloatSet(file,"PosZ", z);
    dini_FloatSet(file,"Angle", angl);
    dini_FloatSet(file,"Health", Healthh);
    DestroyVehicle(CarOwner[playerid]);
}
Doesn't that make more sense? Or am I missing the point of your code?
Reply


Messages In This Thread
Saving problem :x - by Kmitska - 21.02.2011, 10:13
Re: Saving problem :x - by JaTochNietDan - 21.02.2011, 10:25
AW: Saving problem :x - by Kmitska - 21.02.2011, 10:33
Re: Saving problem :x - by JaTochNietDan - 21.02.2011, 10:34
AW: Saving problem :x - by Kmitska - 21.02.2011, 10:36
Re: Saving problem :x - by JaTochNietDan - 21.02.2011, 10:38
AW: Saving problem :x - by Kmitska - 21.02.2011, 10:41
Re: Saving problem :x - by JaTochNietDan - 21.02.2011, 10:45
AW: Saving problem :x - by Kmitska - 21.02.2011, 10:48
Re: Saving problem :x - by JaTochNietDan - 21.02.2011, 10:50

Forum Jump:


Users browsing this thread: 2 Guest(s)