27.02.2009, 20:51
This command make my server crash, any idea why?
This can help
Thanks in advance
pawn Код:
if(strcmp(cmd, "/installalarm", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(gAlarmKit[playerid] == 0) return SendClientMessage(playerid, COLOR_GREY, "Vous n'avez pas de kit alarme");
new car = GetPlayerVehicleID(playerid);
if(!IsPlayerInAnyVehicle(playerid) || (TmpCarKeys[playerid] != car && TmpCarKeys2[playerid] != car))
{
SendClientMessage(playerid, COLOR_GREY, "Vous n'кtes pas dans votre vйhicule");
return 1;
}
GetPlayerName(playerid, sendername, sizeof(sendername));
UnderscoreToSpace( sendername );
format(string, sizeof(string), "%s installe une alarme sur son vйhicule");
if(car == TmpCarKeys[playerid])
{
ProxDetector(30, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, "Alarme installйe.");
CarInfo[car][cAlarm] = gAlarmKit[playerid];
printf("alarm");
return 1;
}
else if(car == TmpCarKeys2[playerid])
{
ProxDetector(30, playerid, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
SendClientMessage(playerid, COLOR_WHITE, "Alarme installйe.");
CarInfo[car][cAlarm] = gAlarmKit[playerid];
printf("alarm");
return 1;
}
SaveSQLCar(car,TmpCarID[car]);
printf("savesqlcar");
}
return 1;
}
pawn Код:
public SaveSQLCar(idx, idx2)
{
new sql[128];
format(sql, sizeof(sql), "UPDATE cars2 SET color1=%d,color2=%d,alarm=%d,insurances=%d, tracker=%d WHERE id=%d",
CarInfo[idx][cColor1],
CarInfo[idx][cColor2],
CarInfo[idx][cAlarm],
CarInfo[idx][cInsurances],
CarInfo[idx][cTracker],
idx2 );
samp_mysql_query(sql);
return 1;
}