Why this crash GTA SA? URGENT!
#1

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;
    }
Reply
#2

Download crashdetect, load the plugin and if your server crashes, then show us what it prints in the console/server log.
Reply
#3

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
Download crashdetect, load the plugin and if your server crashes, then show us what it prints in the console/server log.
It non crashes the server, crash GTA SA.
Reply
#4

Oh, I misunderstood. Anyways, your mistake is:
pawn Код:
format(String, 128, "~rNOLEGGIO LS~w~VEICOLO NOLEGGIATO", RENT_COST);
See ~r

you forgot you close the color like that: ~r~
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)