26.08.2010, 10:59
i made this code:
First, the system should take info from the file of the owner, and then check which car he blows up, and then update it in vehicle file.
The problem in first part. its not load the "TrunkGun1" to "insurance1[playerid]"
What the problem?
pawn Код:
stock insurancedelete(vehicleid, playerid)
{
new house[256];
format(house, sizeof(house), "%s.ini",VehicleInfo[vehicleid][vOwner]);
printf("%s.ini", VehicleInfo[vehicleid][vOwner]);
if(dini_Exists(house))
{
insurance1[playerid] = dini_Int(house, "TrunkGun1");
insurance2[playerid] = dini_Int(house, "TrunkGun2");
insurance3[playerid] = dini_Int(house, "TrunkGun3");
insurance4[playerid] = dini_Int(house, "TrunkGun4");
insurance5[playerid] = dini_Int(house, "TrunkGun5");
printf("Load.....");
}
new str[255],str1[255];
format(str1, sizeof(str1), "vehicles/%s.cfg", VehicleInfo[vehicleid][vOwner]);
printf("vehicles/%s.cfg", VehicleInfo[vehicleid][vOwner]);
if(dini_Exists(str1))
{
printf("Search for..");
if(vehicleid == insurance1[playerid])
{
VehicleInfo[vehicleid][vW] -= 1;
SendClientMessage(playerid, COLOR_LIGHTRED, "Vehicle Destroy");
printf("Success");
}
else if(vehicleid == insurance2[playerid])
{
VehicleInfo[vehicleid][vW2] -= 1;
SendClientMessage(playerid, COLOR_LIGHTRED, "Vehicle Destroy");
printf("Success");
}
else if(vehicleid == insurance3[playerid])
{
VehicleInfo[vehicleid][vW3] -= 1;
SendClientMessage(playerid, COLOR_LIGHTRED, "Vehicle Destroy");
printf("Success");
}
else if(vehicleid == insurance4[playerid])
{
VehicleInfo[vehicleid][vW4] -= 1;
SendClientMessage(playerid, COLOR_LIGHTRED, "Vehicle Destroy");
printf("Success");
}
else if(vehicleid == insurance5[playerid])
{
VehicleInfo[vehicleid][vW5] -= 1;
SendClientMessage(playerid, COLOR_LIGHTRED, "Vehicle Destroy");
printf("Success");
}
}
}
The problem in first part. its not load the "TrunkGun1" to "insurance1[playerid]"
What the problem?