29.03.2011, 18:28
I don't know what is wrong with this code but this is crashing the server
pawn Код:
if(strcmp(x_v,"buyinsurance",true) == 0)
{
new carkey = playerinfo[playerid][vkey];
if(IsPlayerInVehicle(playerid, carkey))
{
vehicleinfo[carkey][Insurances] = (vehicleinfo[carkey][Insurances] +1);
vehicleinfo[carkey][InsurancePrice] = (vehicleinfo[carkey][InsurancePrice] +500);
format(query, sizeof(query),"UPDATE vehicles SET Insurances=%d,InsurancePrice=%d WHERE carid=%d",
vehicleinfo[currentplayervehicle[playerid]][Insurances],vehicleinfo[currentplayervehicle[playerid]][InsurancePrice],currentplayervehicle[playerid]);
mysql_query(query);
new xstring[120];
format(xstring, sizeof(xstring),"%s you bought a new insurance for your vehicle.",playerinfo[playerid][Name]);
SendClientMessage(playerid, COLOR_GREEN, string);
}
}