27.08.2010, 07:35
pawn Код:
public OnVehicleDeath(vehicleid, killerid)
{
for(new i=0; i<MAX_PLAYERS; i++)
{
new str[255],str1[255];
new giveplayer[MAX_PLAYER_NAME];
format(str1, sizeof(str1), "Insurances/%s.ini", VehicleInfo[vehicleid][vOwner]);
printf("Insurance/%s.ini", VehicleInfo[vehicleid][vOwner]);
if(dini_Exists(str1))
{
printf("Search for..");
if(dini_Int(str1, "Vehicle1") == vehicleid)
{
new ins = dini_Int(str1, "Ins1");
insurance1[killerid] = ins-1;
dini_IntSet(str1, "Ins1", insurance1[killerid]);
format(str1, sizeof(str1), "You destroy %s's vehicle. %d insurance left", VehicleInfo[vehicleid][vOwner], insurance1[killerid]);
SendClientMessage(killerid, COLOR_LIGHTRED, str1);
printf("Success");
}
else if(dini_Int(str1, "Vehicle2") == vehicleid)
{
new ins = dini_Int(str1, "Ins2");
insurance2[killerid] = ins-1;
dini_IntSet(str1, "Ins2", insurance2[killerid]);
format(str1, sizeof(str1), "You destroy %s's vehicle. %d insurance left", VehicleInfo[vehicleid][vOwner], insurance2[killerid]);
SendClientMessage(killerid, COLOR_LIGHTRED, str1);
printf("Success");
}
else if(dini_Int(str1, "Vehicle3") == vehicleid)
{
new ins = dini_Int(str1, "Ins3");
insurance3[killerid] = ins-1;
dini_IntSet(str1, "Ins3", insurance3[killerid]);
format(str1, sizeof(str1), "You destroy %s's vehicle. %d insurance left", VehicleInfo[vehicleid][vOwner], insurance3[killerid]);
SendClientMessage(killerid, COLOR_LIGHTRED, str1);
printf("Success");
}
else if(dini_Int(str1, "Vehicle4") == vehicleid)
{
new ins = dini_Int(str1, "Ins4");
insurance4[killerid] = ins-1;
dini_IntSet(str1, "Ins4", insurance4[killerid]);
format(str1, sizeof(str1), "You destroy %s's vehicle. %d insurance left", VehicleInfo[vehicleid][vOwner], insurance4[killerid]);
SendClientMessage(killerid, COLOR_LIGHTRED, str1);
printf("Success");
}
else if(dini_Int(str1, "Vehicle5") == vehicleid)
{
new ins = dini_Int(str1, "Ins5");
insurance5[killerid] = ins-1;
dini_IntSet(str1, "Ins5", insurance5[killerid]);
format(str1, sizeof(str1), "You destroy %s's vehicle. %d insurance left", VehicleInfo[vehicleid][vOwner], insurance5[killerid]);
SendClientMessage(killerid, COLOR_LIGHTRED, str1);
printf("Success");
}
}
}
}