07.02.2012, 01:56
Yes i did not use dini for a while but now i am making /park which will log the CreateVehicle in a .txt, the reason is that when i use /park it does not add anything in it
pawn Код:
CMD:park(playerid,params[])
{
new ppcol1,ppcol2;
new modelid = GetVehicleModel(GetPlayerVehicleID(playerid));
if(PlayerData[playerid][AdminLevel] < 4) return 0;
if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SCM(playerid,red,"ERROR: You are not driving a vehicle");
GetVehiclePos(GetPlayerVehicleID(playerid),X,Y,Z);
GetVehicleZAngle(GetPlayerVehicleID(playerid),A);
GetPlayerName(playerid,Nam,sizeof(Nam));
getdate(byear,bmonth,bday);
GetVehicleColor(GetPlayerVehicleID(playerid),ppcol1,ppcol2);
format(str,sizeof(str),"You have added this vehicle to the cars .txt (model %d,Color 1 %d,Color 2 %d)",GetVehicleModel(GetPlayerVehicleID(playerid)),ppcol1,ppcol2);
SCM(playerid,COLOR_YELLOW,str);
format(file,sizeof(file),"Cars.txt");
if(!dini_Exists(file))
{
dini_Create(file);
format(str,sizeof(str),"CreateVehicle(%d,%f,%f,%f,%f,%d,%d,3600); //%s (%s %d)",modelid,X,Y,Z,A,ppcol1,ppcol2,Nam,Months[bmonth - 1],bday);
dini_Set(file,"",str);
}
if(dini_Exists(file))
{
format(str,sizeof(str),"CreateVehicle(%d,%f,%f,%f,%f,%d,%d,3600); //%s (%s %d)",modelid,X,Y,Z,A,ppcol1,ppcol2,Nam,Months[bmonth - 1],bday);
dini_Set(file,"",str);
}
return 1;
}