10.09.2013, 13:10
This crash the server. WHY?!
pawn Код:
if(strcmp(cmd, "/fittaauto", true) == 0)//Trasfoma in dialog
{
//GameTextForPlayer(playerid, " ", 500, 4);
new vID = GetPlayerVehicleID(playerid);
if (!vID)
{
SendClientMessage(playerid, -1, "Non sei {3399CC}in nessun'{FFFFFF}auto!");
return 1;
}
if (!IsRentableCar(vID))
{
SendClientMessage(playerid, -1, "Quest'auto non и {3399CC}noleggiabile{FFFFFF}!");
return 1;
}
if (IsRentedCar(vID))
{
SendClientMessage(playerid, -1, "Quest'auto {3399CC}и giа stata{FFFFFF} noleggiata!");
return 1;
}
if (GetPVarInt(playerid, "Renting") == 1)
{
SendClientMessage(playerid, -1, "Hai giа {3399CC}noleggiato{FFFFFF} un'auto!");
return 1;
}
if (!CanAffordRental(playerid))
{
new String[128];
format(String, 128, "Non hai abbastanza soldi per noleggiare quest'auto{3399CC}(Costo: %d)", RENT_COST);
SendClientMessage(playerid, -1, String);
return 1;
}
IsRented[vID] = 1;
TogglePlayerControllable(playerid, 1);
SetPVarInt(playerid, "CarRentID", vID);
SetPVarInt(playerid, "Renting", 1);
new String[128];
format(String, 128, "~rNOLEGGIO LS~w~VEICOLO NOLEGGIATO", RENT_COST);
GameTextForPlayer(playerid, String, 4000, 4);
RentedBy[vID] = GetName(playerid);
GivePlayerMoney(playerid, -RENT_COST);
PlayerInfo[playerid][pCash] -= 25;
SendClientMessage(playerid, -1, "{3399CC}Veicolo noleggiato!{FFFFFF} Adesso puoi accendere il veicolo!");
return 1;
}