21.02.2011, 10:13
Hello guys!
I made an easy carownership system but there is one little problem that i can't solve...
Here is the post:
This script is added in: OnPlayerDisconnect(playerid)
and the problem is it doesn't save anything if i do GMX
- yes i also tried on OnPlayerGameModeExit
I made an easy carownership system but there is one little problem that i can't solve...
Here is the post:
pawn Код:
new file[128];
new Float:x,Float:y,Float:z;
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,30);
format(file,sizeof(file),"Server/Cars/%s.ini",pName);
if(dini_Exists(file))
{
for(new i; i<MAX_VEHICLES; i++)
if(i == CarOwner[playerid])
{
new Float:Healthh;
Healthh = GetPlayerVehicleID(playerid);
new Float:angl;
GetVehiclePos(i,x,y,z);
dini_IntSet(file,"LastID", i);
dini_IntSet(file,"CModel", CarInfo[i][CModel]);
dini_FloatSet(file,"PosX", x);
dini_FloatSet(file,"PosY", y);
dini_FloatSet(file,"PosZ", z);
dini_IntSet(file,"Angle", GetVehicleZAngle(i,angl));
dini_FloatSet(file,"Health", Healthh);
CarOwner[playerid] = i;
DestroyVehicle(i);
}
}
and the problem is it doesn't save anything if i do GMX
- yes i also tried on OnPlayerGameModeExit