pawn Код:
#include <YSI\y_ini>
#include <fixes>
public OnPlayerDisconnect(playerid, reason)
{
if(IsPlayerNPC(playerid)) return 1;
VFuelOff(playerid);
LoggedinPlayer[playerid]=0;
Calling[playerid]=0;
Reporterid[playerid]=0;
ReportidRes[playerid]=0;
if(PlayerD[playerid]<=1)
{
ClearPlayerSettings(playerid);
PlayerD[playerid]=0;
}else if(PlayerD[playerid]==2)
{
PlayerD[playerid]=0;
SavePlayerSettings(playerid);
for(new v; v<MAX_VEHICLES; v++)
{
if(vehicleFile[v]>=1)
{
if(vehicleSaving[v]==playerid)
{
SaveVehicleSettings(v);
}
}
}
GetPlayerPos(playerid,px[playerid],py[playerid],pz[playerid]);
GetPlayerFacingAngle(playerid,pfa[playerid]);
new string[256],name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
switch(reason)
{
case 0: format(string,sizeof(string),"%s has left the server. (Timeout)",name);
case 1: format(string,sizeof(string),"%s has left the server. (Leaving)",name);
case 2: format(string,sizeof(string),"%s has left the server. (Kicked)",name);
}
for(new DPlayer; DPlayer < MAX_PLAYERS; DPlayer++)
{
if(PlayerD[DPlayer]==2)
{
if(player[DPlayer][World]==player[playerid][World])
{
if(player[DPlayer][Interior]==player[playerid][Interior])
{
if(IsPlayerInRangeOfPoint(DPlayer,2,px[playerid],py[playerid],pz[playerid]))
{
SendClientMessage(DPlayer,0xFFFF4444,string);
}
}
}
}
}
ClearPlayerSettings(playerid);
}
return 1;
}
forward LoadSettings(playerid, name[], value[]);
public LoadSettings(playerid, name[], value[])
{
INI_Int("Password",player[playerid][Pass]);
INI_Int("Skin",player[playerid][Skinid]);
INI_Int("Sex",player[playerid][Sex]);
INI_Int("Money",player[playerid][Money]);
INI_Int("Bank",player[playerid][Bank]);
INI_Int("Faction",player[playerid][Faction]);
INI_Int("Rank",player[playerid][Rank]);
INI_Int("Job",player[playerid][Job]);
INI_Int("Admin",player[playerid][Adminlevel]);
INI_Int("Level",player[playerid][Level]);
INI_Int("Respects",player[playerid][Respects]);
INI_Int("Tickets",player[playerid][Tickets]);
INI_Int("Helper",player[playerid][Helper]);
INI_Int("Phone",player[playerid][Phone]);
INI_Int("WalkieT",player[playerid][Walkt]);
INI_Int("World",player[playerid][World]);
INI_Int("Interior",player[playerid][Interior]);
INI_Int("Vehid",player[playerid][Vehid]);
INI_Int("Vehseat",player[playerid][Vehseat]);
INI_Int("Wslot1",player[playerid][Wslot1]);
INI_Int("Wslot2",player[playerid][Wslot2]);
INI_Int("Wslot3",player[playerid][Wslot3]);
INI_Int("Wslot4",player[playerid][Wslot4]);
INI_Int("Wslot5",player[playerid][Wslot5]);
INI_Int("Wslot6",player[playerid][Wslot6]);
INI_Int("Wslot7",player[playerid][Wslot7]);
INI_Int("Wslot8",player[playerid][Wslot8]);
INI_Int("Wslot9",player[playerid][Wslot9]);
INI_Int("Wslot10",player[playerid][Wslot10]);
INI_Int("Wslot11",player[playerid][Wslot11]);
INI_Int("Wslot12",player[playerid][Wslot12]);
INI_Int("Vip",player[playerid][Vip]);
INI_String("Lastlogdate",playerLastlogdate[playerid],128);
INI_Float("Health",playerHealth[playerid]);
INI_Float("Armour",playerArmour[playerid]);
INI_String("Accent",playerAccent[playerid],128);
INI_Float("Posx",playerPosx[playerid]);
INI_Float("Posy",playerPosy[playerid]);
INI_Float("Posz",playerPosz[playerid]);
INI_Float("Posa",playerPosa[playerid]);
return 1;
}
forward LoadVSettings(vehicleid, name[], value[]);
public LoadVSettings(vehicleid, name[], value[])
{
INI_Int("Model",vehicle[vehicleid][Model]);
INI_Int("Lock",vehicle[vehicleid][Lock]);
INI_Int("Color1",vehicle[vehicleid][Color1]);
INI_Int("Color2",vehicle[vehicleid][Color2]);
INI_Int("Paintjob",vehicle[vehicleid][Paintjob]);
INI_Int("Fuel",vehicle[vehicleid][Fuel]);
INI_Int("Fuel2",vehicle[vehicleid][Fuel2]);
INI_Int("Engine",vehicle[vehicleid][Engine]);
INI_Int("Lights",vehicle[vehicleid][Lights]);
INI_Int("Trunk",vehicle[vehicleid][Trunk]);
INI_Int("Hood",vehicle[vehicleid][Hood]);
INI_Int("Weap1",vehicle[vehicleid][Weap1]);
INI_Int("Weap2",vehicle[vehicleid][Weap2]);
INI_Int("Weap3",vehicle[vehicleid][Weap3]);
INI_Int("Weap4",vehicle[vehicleid][Weap4]);
INI_Int("Weap5",vehicle[vehicleid][Weap5]);
INI_Int("World",vehicle[vehicleid][VWorld]);
INI_Int("Interior",vehicle[vehicleid][VInterior]);
INI_Int("Trailer",vehicle[vehicleid][Trailer]);
INI_Int("Tower",vehicle[vehicleid][Tower]);
INI_Int("PanelsDamage",vehicle[vehicleid][PanelsDamage]);
INI_Int("DoorsDamage",vehicle[vehicleid][DoorsDamage]);
INI_Int("LightsDamage",vehicle[vehicleid][LightsDamage]);
INI_Int("TiresDamage",vehicle[vehicleid][TiresDamage]);
INI_Int("Component0",vehicle[vehicleid][Component0]);
INI_Int("Component1",vehicle[vehicleid][Component1]);
INI_Int("Component2",vehicle[vehicleid][Component2]);
INI_Int("Component3",vehicle[vehicleid][Component3]);
INI_Int("Component4",vehicle[vehicleid][Component4]);
INI_Int("Component5",vehicle[vehicleid][Component5]);
INI_Int("Component6",vehicle[vehicleid][Component6]);
INI_Int("Component7",vehicle[vehicleid][Component7]);
INI_Int("Component8",vehicle[vehicleid][Component8]);
INI_Int("Component9",vehicle[vehicleid][Component9]);
INI_Int("Component10",vehicle[vehicleid][Component10]);
INI_Int("Component11",vehicle[vehicleid][Component11]);
INI_Int("Component12",vehicle[vehicleid][Component12]);
INI_Int("Component13",vehicle[vehicleid][Component13]);
INI_Float("Health",vehicleHealth[vehicleid]);
INI_Float("Posx",vehiclePosx[vehicleid]);
INI_Float("Posy",vehiclePosy[vehicleid]);
INI_Float("Posz",vehiclePosz[vehicleid]);
INI_Float("Posa",vehiclePosr[vehicleid]);
return 1;
}
public OnUnoccupiedVehicleUpdate(vehicleid, playerid, passenger_seat)
{
if(vehicleFile[vehicleid]>=1)
{
UpdateVehicleStatus(vehicleid);
vehicleSaving[vehicleid]=playerid;
new vfile[256];
format(vfile,sizeof(vfile),"Roleplay/Vehicles/%i.ini",vehicleFile[vehicleid]);
INI_ParseFile(vfile,"LoadVSettings", .bExtra=true, .extra=vehicleFile[vehicleid]);
new e,l,a,d,b,bo,o;
GetVehicleParamsEx(vehicleid,e,l,a,d,b,bo,o);
SetVehicleParamsEx(vehicleid,vehicle[vehicleFile[vehicleid]][Engine],vehicle[vehicleFile[vehicleid]][Lights],a,vehicle[vehicleFile[vehicleid]][Lock],vehicle[vehicleFile[vehicleid]][Hood],vehicle[vehicleFile[vehicleid]][Trunk],o);
}
return 1;
}
public OnPlayerUpdate(playerid)
{
if(IsPlayerNPC(playerid)) return 1;
if(PlayerD[playerid]<=1)
{
SendClientMessage(playerid,0xFFFFFF,"");
SendClientMessage(playerid,0xFFFFFF,"");
SendClientMessage(playerid,0xFFFFFF,"");
SendClientMessage(playerid,0xFFFFFF,"");
SendClientMessage(playerid,0xFFFFFF,"");
SendClientMessage(playerid,0xFFFFFF,"");
SendClientMessage(playerid,0xFFFFFF,"");
SendClientMessage(playerid,0xFFFFFF,"");
SendClientMessage(playerid,0xFFFFFF,"");
SendClientMessage(playerid,0xFFFFFF,"");
SendClientMessage(playerid,0xFFFFFF,"");
SendClientMessage(playerid,0xFFFFFF,"");
TextDrawShowForPlayer(playerid,logscreen);
TextDrawShowForPlayer(playerid,logscreen2);
}
else if(PlayerD[playerid]==2)
{
new banmsg[256];
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid,name,sizeof(name));
format(banmsg,sizeof(banmsg),"%s was Banned, Reason: Hacked Jetpack",name);
if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_USEJETPACK){
if(player[playerid][Adminlevel]==0)
{
SendClientMessage(playerid,0xAA3333AA,banmsg);
Ban(playerid);
}
}
if(IsPlayerInAnyVehicle(playerid))
{
new vid = GetPlayerVehicleID(playerid);
player[playerid][Vehid]=vehicleFile[vid];
new seat = GetPlayerVehicleSeat(playerid);
player[playerid][Vehseat]=seat;
new e,l,a,d,b,bo,o;
GetVehicleParamsEx(vid,e,l,a,d,b,bo,o);
if(vehicleFile[vid]>=1)
{
vehicle[vehicleFile[vid]][VInterior]=player[playerid][Interior];
LinkVehicleToInterior(vid,player[playerid][Interior]);
UpdateVehicleStatus(vid);
vehicleSaving[vid]=playerid;
new vfile[256];
format(vfile,sizeof(vfile),"Roleplay/Vehicles/%i.ini",vehicleFile[vid]);
INI_ParseFile(vfile,"LoadVSettings", .bExtra=true, .extra=vehicleFile[vid]);
}
if(GetPlayerVehicleSeat(playerid)==0)
{
if(GetVehicleModel(vid)==481)
{
TextDrawHideForPlayer(playerid,VTFuel[playerid]);
TextDrawSetString(VTFuel[playerid],"");
TextDrawHideForPlayer(playerid,VTSpeed[playerid]);
TextDrawSetString(VTSpeed[playerid],"");
KillTimer(EngineTime[vid]);
vehicle[vehicleFile[vid]][Fuel]=0;
vehicle[vehicleFile[vid]][Fuel2]=0;
vehicle[vehicleFile[vid]][Engine]=0;
vehicle[vehicleFile[vid]][Lights]=0;
vehicle[vehicleFile[vid]][Trunk]=0;
vehicle[vehicleFile[vid]][Hood]=0;
SetVehicleParamsEx(vid,1,0,a,d,0,0,o);
}else if(GetVehicleModel(vid)==509)
{
TextDrawHideForPlayer(playerid,VTFuel[playerid]);
TextDrawSetString(VTFuel[playerid],"");
TextDrawHideForPlayer(playerid,VTSpeed[playerid]);
TextDrawSetString(VTSpeed[playerid],"");
KillTimer(EngineTime[vid]);
vehicle[vehicleFile[vid]][Fuel]=0;
vehicle[vehicleFile[vid]][Fuel2]=0;
vehicle[vehicleFile[vid]][Engine]=0;
vehicle[vehicleFile[vid]][Lights]=0;
vehicle[vehicleFile[vid]][Trunk]=0;
vehicle[vehicleFile[vid]][Hood]=0;
SetVehicleParamsEx(vid,1,0,a,d,0,0,o);
}else if(GetVehicleModel(vid)==510)
{
TextDrawHideForPlayer(playerid,VTFuel[playerid]);
TextDrawSetString(VTFuel[playerid],"");
TextDrawHideForPlayer(playerid,VTSpeed[playerid]);
TextDrawSetString(VTSpeed[playerid],"");
KillTimer(EngineTime[vid]);
vehicle[vehicleFile[vid]][Fuel]=0;
vehicle[vehicleFile[vid]][Fuel2]=0;
vehicle[vehicleFile[vid]][Engine]=0;
vehicle[vehicleFile[vid]][Lights]=0;
vehicle[vehicleFile[vid]][Trunk]=0;
vehicle[vehicleFile[vid]][Hood]=0;
SetVehicleParamsEx(vid,1,0,a,d,0,0,o);
}else
{
TextDrawShowForPlayer(playerid,VTFuel[playerid]);
new vfuel[256];
if(vehicle[vehicleFile[vid]][Fuel]>=50)
{
if(vehicle[vehicleFile[vid]][Fuel]==50)
{
TextDrawSetString(VTFuel[playerid],"~b~ Fuel: ~y~ 50%");
}else
{
format(vfuel,sizeof(vfuel),"~b~ Fuel: ~g~ %i%",vehicle[vehicleFile[vid]][Fuel]);
TextDrawSetString(VTFuel[playerid],vfuel);
}
}else if((vehicle[vehicleFile[vid]][Fuel]>=20) && (vehicle[vehicleFile[vid]][Fuel]<=50))
{
if(vehicle[vehicleFile[vid]][Fuel]==20)
{
TextDrawSetString(VTFuel[playerid],"~b~ Fuel: ~r~ 20%");
}else
{
format(vfuel,sizeof(vfuel),"~b~ Fuel: ~y~ %i%",vehicle[vehicleFile[vid]][Fuel]);
TextDrawSetString(VTFuel[playerid],vfuel);
}
}else if(vehicle[vehicleFile[vid]][Fuel]>=0)
{
if(vehicle[vehicleFile[vid]][Fuel]==0)
{
TextDrawSetString(VTFuel[playerid],"~b~ Fuel: ~r~ E");
}else
{
format(vfuel,sizeof(vfuel),"~b~ Fuel: ~r~ %i%",vehicle[vehicleFile[vid]][Fuel]);
TextDrawSetString(VTFuel[playerid],vfuel);
}
}
TextDrawShowForPlayer(playerid,VTSpeed[playerid]);
new vspeed[256];
if(GetPlayerSpeed(playerid,true)>=120)
{
format(vspeed,sizeof(vspeed),"~b~ Km/h: ~r~ %d",GetPlayerSpeed(playerid,true));
TextDrawSetString(VTSpeed[playerid],vspeed);
}else if((GetPlayerSpeed(playerid,true)>=60) && (GetPlayerSpeed(playerid,true)<=120))
{
format(vspeed,sizeof(vspeed),"~b~ Km/h: ~y~ %d",GetPlayerSpeed(playerid,true));
TextDrawSetString(VTSpeed[playerid],vspeed);
}else if(GetPlayerSpeed(playerid,true)>=0)
{
format(vspeed,sizeof(vspeed),"~b~ Km/h: ~g~ %d",GetPlayerSpeed(playerid,true));
TextDrawSetString(VTSpeed[playerid],vspeed);
}
SetVehicleParamsEx(vid,vehicle[vehicleFile[vid]][Engine],l,a,vehicle[vehicleFile[vid]][Lock],vehicle[vehicleFile[vid]][Hood],vehicle[vehicleFile[vid]][Trunk],o);
if(vehicleHealth[vehicleFile[vid]]<=250)
{
vehicle[vehicleFile[vid]][Engine]=0;
SetVehicleHealth(vid,250);
}
for(new spike; spike<MAX_OBJECTS; spike++)
{
if(IsValidObject(Spike[spike]))
{
new Float:atmx,Float:atmy,Float:atmz;
GetObjectPos(Spike[spike],atmx,atmy,atmz);
if(IsPlayerInRangeOfPoint(playerid,2.5,atmx,atmy,atmz))
{
new panelsd,doorsd,lightsd,tiresd;
GetVehicleDamageStatus(vid,panelsd,doorsd,lightsd,tiresd);
UpdateVehicleDamageStatus(vid,panelsd,doorsd,lightsd,15);
}
}
}
}
new Keys,ud,lr;
GetPlayerKeys(playerid,Keys,ud,lr);
if(playerVehflight[playerid]==1)
{
new Float:vvx,Float:vvy,Float:vvz;
GetVehicleVelocity(vid,vvx,vvy,vvz);
if(vvz<=0.1)
{
SetVehicleVelocity(vid,vvx,vvy,0.1);
}
if(Keys == KEY_SPRINT)
{
GetVehiclePos(vid, vnx, vny, vnz);
GetXYInFrontOfCar(vid, vnx, vny, 5);
SetVehiclePos(vid,vnx,vny,vnz);
}if(Keys == KEY_DOWN)
{
GetVehiclePos(vid, vnx, vny, vnz);
GetXYInFrontOfCar(vid, vnx, vny, 5);
SetVehiclePos(vid,vnx,vny,vnz);
}if(lr == KEY_LEFT)
{
GetVehicleZAngle(vid,vnr);
SetVehicleZAngle(vid,vnr+5);
}if(lr == KEY_RIGHT)
{
GetVehicleZAngle(vid,vnr);
SetVehicleZAngle(vid,vnr-5);
}
if(ud>0)
{
GetVehiclePos(vid, vnx, vny, vnz);
SetVehiclePos(vid,vnx,vny,vnz-5);
}if(ud<0)
{
GetVehiclePos(vid, vnx, vny, vnz);
SetVehiclePos(vid,vnx,vny,vnz+5);
}
}
//0x008844FF
}
}else
{
player[playerid][Vehid]=0;
player[playerid][Vehseat]=0;
playerVehflight[playerid]=0;
TextDrawHideForPlayer(playerid,VTFuel[playerid]);
TextDrawSetString(VTFuel[playerid],"");
TextDrawHideForPlayer(playerid,VTSpeed[playerid]);
TextDrawSetString(VTSpeed[playerid],"");
}
TextDrawHideForPlayer(playerid,logscreen);
TextDrawHideForPlayer(playerid,logscreen2);
SetPlayerScore(playerid,player[playerid][Level]);
new money;
money = GetPlayerMoney(playerid);
if(player[playerid][Money]>money)
{
new getmoney;
getmoney=player[playerid][Money]-money;
GivePlayerMoney(playerid,getmoney);
}if(player[playerid][Money]<money)
{
new getmoney;
getmoney=money-player[playerid][Money];
GivePlayerMoney(playerid,-getmoney);
}
new skin;
skin = GetPlayerSkin(playerid);
if(player[playerid][Skinid]!=skin)
{
SetPlayerSkin(playerid,player[playerid][Skinid]);
}
new world;
world = GetPlayerVirtualWorld(playerid);
player[playerid][World]=world;
new interior;
interior = GetPlayerInterior(playerid);
player[playerid][Interior]=interior;
if(player[playerid][Vip]>=1)
{
new day, month, year;
getdate(year, month, day);
new newlogdate[128];
format(newlogdate,sizeof(newlogdate),"%d/%d/%d",day,month,year);
if(strval(playerLastlogdate[playerid])!=strval(newlogdate))
{
player[playerid][Vip]-=1;
playerLastlogdate[playerid]=newlogdate;
if(player[playerid][Vip]==0)
{
SendClientMessage(playerid,0xAA33C2FF,"Your Vip has been deactivated by finishing it, Sorry.");
}else
{
SendClientMessage(playerid,0xAA33C2FF,"Your Vip is still active for today in new date, Enjoy.");
}
}
}else
{
new day, month, year;
getdate(year, month, day);
new newlogdate[128];
format(newlogdate,sizeof(newlogdate),"%d/%d/%d",day,month,year);
playerLastlogdate[playerid]=newlogdate;
}
if(player[playerid][Faction]!=1)
{
if(IsPlayerInAnyVehicle(playerid))
{
new vid=GetPlayerVehicleID(playerid);
if(GetVehicleModel(vid)==596)
{
GetPlayerPos(playerid,px[playerid],py[playerid],pz[playerid]);
SetPlayerPos(playerid,px[playerid],py[playerid],pz[playerid]);
SendClientMessage(playerid,0xAFAFAFAA,"You are not a Cop!");
}
}
}
new wslot1, wslot1ammo;
GetPlayerWeaponData(playerid,1,wslot1,wslot1ammo);
player[playerid][Wslot1]=wslot1;
new wslot2, wslot2ammo;
GetPlayerWeaponData(playerid,2,wslot2,wslot2ammo);
player[playerid][Wslot2]=wslot2;
new wslot3, wslot3ammo;
GetPlayerWeaponData(playerid,3,wslot3,wslot3ammo);
player[playerid][Wslot3]=wslot3;
GetPlayerHealth(playerid,health[playerid]);
GetPlayerArmour(playerid,armour[playerid]);
playerHealth[playerid]=health[playerid];
playerArmour[playerid]=armour[playerid];
GetPlayerPos(playerid,px[playerid],py[playerid],pz[playerid]);
GetPlayerFacingAngle(playerid,pfa[playerid]);
playerPosx[playerid]=px[playerid];
playerPosy[playerid]=py[playerid];
playerPosz[playerid]=pz[playerid];
playerPosa[playerid]=pfa[playerid];
}
return 1;
}
ClearPlayerSettings(playerid)
{
player[playerid][Pass]=0;
player[playerid][Skinid]=0;
player[playerid][Sex]=0;
player[playerid][Money]=0;
player[playerid][Bank]=0;
player[playerid][Faction]=0;
player[playerid][Rank]=0;
player[playerid][Job]=0;
player[playerid][Adminlevel]=0;
player[playerid][Level]=0;
player[playerid][Respects]=0;
player[playerid][Tickets]=0;
player[playerid][Helper]=0;
player[playerid][Phone]=0;
player[playerid][Walkt]=0;
player[playerid][World]=0;
player[playerid][Interior]=0;
player[playerid][Vehid]=0;
player[playerid][Vehseat]=0;
player[playerid][Wslot1]=0;
player[playerid][Wslot2]=0;
player[playerid][Wslot3]=0;
player[playerid][Wslot4]=0;
player[playerid][Wslot5]=0;
player[playerid][Wslot6]=0;
player[playerid][Wslot7]=0;
player[playerid][Wslot8]=0;
player[playerid][Wslot9]=0;
player[playerid][Wslot10]=0;
player[playerid][Wslot11]=0;
player[playerid][Wslot12]=0;
player[playerid][Vip]=0;
playerLastlogdate[playerid]="";
playerHealth[playerid]=0;
playerArmour[playerid]=0;
playerAccent[playerid]="";
playerPosx[playerid]=0;
playerPosy[playerid]=0;
playerPosz[playerid]=0;
playerPosa[playerid]=0;
}
SavePlayerSettings(playerid)
{
new name[MAX_PLAYER_NAME],string[256];
GetPlayerName(playerid,name,sizeof(name));
format(string,sizeof(string),"Roleplay/Players/%s.ini",name);
new INI:acc = INI_Open(string);
INI_WriteInt(acc,"Password",player[playerid][Pass]);
INI_WriteInt(acc,"Skin",player[playerid][Skinid]);
INI_WriteInt(acc,"Sex",player[playerid][Sex]);
INI_WriteInt(acc,"Money",player[playerid][Money]);
INI_WriteInt(acc,"Bank",player[playerid][Bank]);
INI_WriteInt(acc,"Faction",player[playerid][Faction]);
INI_WriteInt(acc,"Rank",player[playerid][Rank]);
INI_WriteInt(acc,"Job",player[playerid][Job]);
INI_WriteInt(acc,"Admin",player[playerid][Adminlevel]);
INI_WriteInt(acc,"Level",player[playerid][Level]);
INI_WriteInt(acc,"Respects",player[playerid][Respects]);
INI_WriteInt(acc,"Tickets",player[playerid][Tickets]);
INI_WriteInt(acc,"Helper",player[playerid][Helper]);
INI_WriteInt(acc,"Phone",player[playerid][Phone]);
INI_WriteInt(acc,"WalkieT",player[playerid][Walkt]);
INI_WriteInt(acc,"World",player[playerid][World]);
INI_WriteInt(acc,"Interior",player[playerid][Interior]);
INI_WriteInt(acc,"Vehid",player[playerid][Vehid]);
INI_WriteInt(acc,"Vehseat",player[playerid][Vehseat]);
INI_WriteInt(acc,"Wslot1",player[playerid][Wslot1]);
INI_WriteInt(acc,"Wslot2",player[playerid][Wslot2]);
INI_WriteInt(acc,"Wslot3",player[playerid][Wslot3]);
INI_WriteInt(acc,"Wslot4",player[playerid][Wslot4]);
INI_WriteInt(acc,"Wslot5",player[playerid][Wslot5]);
INI_WriteInt(acc,"Wslot6",player[playerid][Wslot6]);
INI_WriteInt(acc,"Wslot7",player[playerid][Wslot7]);
INI_WriteInt(acc,"Wslot8",player[playerid][Wslot8]);
INI_WriteInt(acc,"Wslot9",player[playerid][Wslot9]);
INI_WriteInt(acc,"Wslot10",player[playerid][Wslot10]);
INI_WriteInt(acc,"Wslot11",player[playerid][Wslot11]);
INI_WriteInt(acc,"Wslot12",player[playerid][Wslot12]);
INI_WriteInt(acc,"Vip",player[playerid][Vip]);
INI_WriteString(acc,"Lastlogdate",playerLastlogdate[playerid]);
INI_WriteFloat(acc,"Health",playerHealth[playerid]);
INI_WriteFloat(acc,"Armour",playerArmour[playerid]);
INI_WriteString(acc,"Accent",playerAccent[playerid]);
INI_WriteFloat(acc,"Posx",playerPosx[playerid]);
INI_WriteFloat(acc,"Posy",playerPosy[playerid]);
INI_WriteFloat(acc,"Posz",playerPosz[playerid]);
INI_WriteFloat(acc,"Posa",playerPosa[playerid]);
INI_Close(acc);
}
SaveVehicleSettings(vehicleid)
{
new string[256];
format(string,sizeof(string),"Roleplay/Vehicles/%i.ini",vehicleFile[vehicleid]);
new INI:acc = INI_Open(string);
INI_WriteInt(acc,"Model",vehicle[vehicleFile[vehicleid]][Model]);
INI_WriteInt(acc,"Lock",vehicle[vehicleFile[vehicleid]][Lock]);
INI_WriteInt(acc,"Color1",vehicle[vehicleFile[vehicleid]][Color1]);
INI_WriteInt(acc,"Color2",vehicle[vehicleFile[vehicleid]][Color2]);
INI_WriteInt(acc,"Paintjob",vehicle[vehicleFile[vehicleid]][Paintjob]);
INI_WriteInt(acc,"Fuel",vehicle[vehicleFile[vehicleid]][Fuel]);
INI_WriteInt(acc,"Fuel2",vehicle[vehicleFile[vehicleid]][Fuel2]);
INI_WriteInt(acc,"Engine",vehicle[vehicleFile[vehicleid]][Engine]);
INI_WriteInt(acc,"Lights",vehicle[vehicleFile[vehicleid]][Lights]);
INI_WriteInt(acc,"Trunk",vehicle[vehicleFile[vehicleid]][Trunk]);
INI_WriteInt(acc,"Hood",vehicle[vehicleFile[vehicleid]][Hood]);
INI_WriteInt(acc,"Weap1",vehicle[vehicleFile[vehicleid]][Weap1]);
INI_WriteInt(acc,"Weap2",vehicle[vehicleFile[vehicleid]][Weap2]);
INI_WriteInt(acc,"Weap3",vehicle[vehicleFile[vehicleid]][Weap3]);
INI_WriteInt(acc,"Weap4",vehicle[vehicleFile[vehicleid]][Weap4]);
INI_WriteInt(acc,"Weap5",vehicle[vehicleFile[vehicleid]][Weap5]);
INI_WriteInt(acc,"World",vehicle[vehicleFile[vehicleid]][VWorld]);
INI_WriteInt(acc,"Interior",vehicle[vehicleFile[vehicleid]][VInterior]);
INI_WriteInt(acc,"Trailer",vehicle[vehicleFile[vehicleid]][Trailer]);
INI_WriteInt(acc,"Tower",vehicle[vehicleFile[vehicleid]][Tower]);
INI_WriteInt(acc,"PanelsDamage",vehicle[vehicleFile[vehicleid]][PanelsDamage]);
INI_WriteInt(acc,"DoorsDamage",vehicle[vehicleFile[vehicleid]][DoorsDamage]);
INI_WriteInt(acc,"LightsDamage",vehicle[vehicleFile[vehicleid]][LightsDamage]);
INI_WriteInt(acc,"TiresDamage",vehicle[vehicleFile[vehicleid]][TiresDamage]);
INI_WriteInt(acc,"Component0",vehicle[vehicleFile[vehicleid]][Component0]);
INI_WriteInt(acc,"Component1",vehicle[vehicleFile[vehicleid]][Component1]);
INI_WriteInt(acc,"Component2",vehicle[vehicleFile[vehicleid]][Component2]);
INI_WriteInt(acc,"Component3",vehicle[vehicleFile[vehicleid]][Component3]);
INI_WriteInt(acc,"Component4",vehicle[vehicleFile[vehicleid]][Component4]);
INI_WriteInt(acc,"Component5",vehicle[vehicleFile[vehicleid]][Component5]);
INI_WriteInt(acc,"Component6",vehicle[vehicleFile[vehicleid]][Component6]);
INI_WriteInt(acc,"Component7",vehicle[vehicleFile[vehicleid]][Component7]);
INI_WriteInt(acc,"Component8",vehicle[vehicleFile[vehicleid]][Component8]);
INI_WriteInt(acc,"Component9",vehicle[vehicleFile[vehicleid]][Component9]);
INI_WriteInt(acc,"Component10",vehicle[vehicleFile[vehicleid]][Component10]);
INI_WriteInt(acc,"Component11",vehicle[vehicleFile[vehicleid]][Component11]);
INI_WriteInt(acc,"Component12",vehicle[vehicleFile[vehicleid]][Component12]);
INI_WriteInt(acc,"Component13",vehicle[vehicleFile[vehicleid]][Component13]);
INI_WriteFloat(acc,"Health",vehicleHealth[vehicleFile[vehicleid]]);
INI_WriteFloat(acc,"Posx",vehiclePosx[vehicleFile[vehicleid]]);
INI_WriteFloat(acc,"Posy",vehiclePosy[vehicleFile[vehicleid]]);
INI_WriteFloat(acc,"Posz",vehiclePosz[vehicleFile[vehicleid]]);
INI_WriteFloat(acc,"Posa",vehiclePosr[vehicleFile[vehicleid]]);
INI_Close(acc);
}
UpdateVehicleStatus(vehicleid)
{
new world;
world = GetVehicleVirtualWorld(vehicleid);
vehicle[vehicleFile[vehicleid]][VWorld]=world;
new trailer;
trailer = GetVehicleTrailer(vehicleid);
vehicle[vehicleFile[vehicleid]][Trailer]=vehicleFile[trailer];
new panelsd,doorsd,lightsd,tiresd;
GetVehicleDamageStatus(vehicleid,panelsd,doorsd,lightsd,tiresd);
vehicle[vehicleFile[vehicleid]][PanelsDamage]=panelsd;
vehicle[vehicleFile[vehicleid]][DoorsDamage]=doorsd;
vehicle[vehicleFile[vehicleid]][LightsDamage]=lightsd;
vehicle[vehicleFile[vehicleid]][TiresDamage]=tiresd;
new componentslot0;
componentslot0 = GetVehicleComponentInSlot(vehicleid,0);
vehicle[vehicleFile[vehicleid]][Component0]=componentslot0;
new componentslot1;
componentslot1 = GetVehicleComponentInSlot(vehicleid,1);
vehicle[vehicleFile[vehicleid]][Component1]=componentslot1;
new componentslot2;
componentslot2 = GetVehicleComponentInSlot(vehicleid,2);
vehicle[vehicleFile[vehicleid]][Component2]=componentslot2;
new componentslot3;
componentslot3 = GetVehicleComponentInSlot(vehicleid,3);
vehicle[vehicleFile[vehicleid]][Component3]=componentslot3;
new componentslot4;
componentslot4 = GetVehicleComponentInSlot(vehicleid,4);
vehicle[vehicleFile[vehicleid]][Component4]=componentslot4;
new componentslot5;
componentslot5 = GetVehicleComponentInSlot(vehicleid,5);
vehicle[vehicleFile[vehicleid]][Component5]=componentslot5;
new componentslot6;
componentslot6 = GetVehicleComponentInSlot(vehicleid,6);
vehicle[vehicleFile[vehicleid]][Component6]=componentslot6;
new componentslot7;
componentslot7 = GetVehicleComponentInSlot(vehicleid,7);
vehicle[vehicleFile[vehicleid]][Component7]=componentslot7;
new componentslot8;
componentslot8 = GetVehicleComponentInSlot(vehicleid,8);
vehicle[vehicleFile[vehicleid]][Component8]=componentslot8;
new componentslot9;
componentslot9 = GetVehicleComponentInSlot(vehicleid,9);
vehicle[vehicleFile[vehicleid]][Component9]=componentslot9;
new componentslot10;
componentslot10 = GetVehicleComponentInSlot(vehicleid,10);
vehicle[vehicleFile[vehicleid]][Component10]=componentslot10;
new componentslot11;
componentslot11 = GetVehicleComponentInSlot(vehicleid,11);
vehicle[vehicleFile[vehicleid]][Component11]=componentslot11;
new componentslot12;
componentslot12 = GetVehicleComponentInSlot(vehicleid,12);
vehicle[vehicleFile[vehicleid]][Component12]=componentslot12;
new componentslot13;
componentslot13 = GetVehicleComponentInSlot(vehicleid,13);
vehicle[vehicleFile[vehicleid]][Component13]=componentslot13;
new Float:vehhealth;
GetVehicleHealth(vehicleid,vehhealth);
vehicleHealth[vehicleFile[vehicleid]]=vehhealth;
GetVehiclePos(vehicleid,vnx,vny,vnz);
GetVehicleZAngle(vehicleid,vnr);
vehiclePosx[vehicleFile[vehicleid]]=vnx;
vehiclePosy[vehicleFile[vehicleid]]=vny;
vehiclePosz[vehicleFile[vehicleid]]=vnz;
vehiclePosr[vehicleFile[vehicleid]]=vnr;
}