Jump to content
  • 0

warning 225: unreachable code


Eclari

Question

Codul este:

public OnPlayerDisconnect(playerid, reason)
{
    KillTimer(E@_Timer[playerid]);
    return CallLocalFunction("E@_OnPlayerDisconnect", "id", playerid, reason);

    if(RentVehicle[playerid] != INVALID_VEHICLE_ID) {
        DestroyVehicle(RentVehicle[playerid]);
        RentTimer[playerid] = 0;
        RentVehicle[playerid] = INVALID_VEHICLE_ID;
    }
    playersOn[playerid] --;
    return 1;
}

warning 225: unreachable code, linia la care imi spune ca este eroarea este:     if(RentVehicle[playerid] != INVALID_VEHICLE_ID) {

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

@VLM
YCMD:rentcar(playerid, params[], help) {
    if(RentVehicle[playerid] != INVALID_VEHICLE_ID) return SCM(playerid, COLOR_GREY, "You already have an vehicle from rent.");
    if(!IsPlayerInRangeOfPoint(playerid, 4.0, 2162.9246,1402.0781,10.8203)) return SCM(playerid, COLOR_GREY, "Nu esti in preajma unui business de tip 'Rent Car'.");
    new dialog[1024], string[80];
    strcat(dialog, "Vehicle\tPrice\n");
    for(new i = 0; i < 4; i++) {
        format(string, sizeof(string), "{FFFFFF}%s\t$%s\n", VehicleRentName(i), formatNumber(VehicleRentPrice(i)));
        strcat(dialog, string);
    }
    ShowPlayerDialog(playerid, DIALOG_RENTVEH, DIALOG_STYLE_TABLIST_HEADERS, "Rent Vehicle", dialog, "Rent", "Close");
    return 1;
}

Link to comment
Share on other sites

  • 0
3 minutes ago, Eclari said:

@VLM
YCMD:rentcar(playerid, params[], help) {
    if(RentVehicle[playerid] != INVALID_VEHICLE_ID) return SCM(playerid, COLOR_GREY, "You already have an vehicle from rent.");
    if(!IsPlayerInRangeOfPoint(playerid, 4.0, 2162.9246,1402.0781,10.8203)) return SCM(playerid, COLOR_GREY, "Nu esti in preajma unui business de tip 'Rent Car'.");
    new dialog[1024], string[80];
    strcat(dialog, "Vehicle\tPrice\n");
    for(new i = 0; i < 4; i++) {
        format(string, sizeof(string), "{FFFFFF}%s\t$%s\n", VehicleRentName(i), formatNumber(VehicleRentPrice(i)));
        strcat(dialog, string);
    }
    ShowPlayerDialog(playerid, DIALOG_RENTVEH, DIALOG_STYLE_TABLIST_HEADERS, "Rent Vehicle", dialog, "Rent", "Close");
    return 1;
}

arata DIALOG_RENTVEH

#retras

Link to comment
Share on other sites

  • 0

@VLM
 

        case DIALOG_RENTVEH: {
            if(!response) return 1;
            if(GetPlayerMoney(playerid) < VehicleRentPrice(listitem)) return SCM(playerid, COLOR_GREY, "You don't have enough money.");

            new Float:x, Float:y, Float:z, Float:angle, color1 = random(128), color2 = random(128);
            GetPlayerPos(playerid, x, y, z);
            GetPlayerFacingAngle(playerid, angle);
            RentVehicle[playerid] = AddStaticVehicle(VehicleRentID(listitem), x, y, z, angle, color1, color2);
            giveMoney(playerid, -VehicleRentPrice(listitem));
            Update(playerid, pMoney);
            PutPlayerInVehicle(playerid, RentVehicle[playerid], 0);
            format(string, sizeof string, "{FFC000}(Rent Vehicle): {FFFFFF}You pay %s$ for an %s from rent.", formatNumber(VehicleRentPrice(listitem)), VehicleRentName(listitem));
            SCM(playerid, COLOR_WHITE, string);
            format(string, sizeof string, "{FFC000}(Rent Vehicle): {FFFFFF}When you leave the car for 5 minutes, this dissapear.");
            SCM(playerid, COLOR_WHITE, string);
            RentTimer[playerid] = 300;
            /*new str2[256];
            BizzInfo[31][bTill] += VehicleRentPrice(listitem);
            mysql_format(SQL, str2, sizeof(str2), "UPDATE `bizz` SET `Till`='%d' WHERE `ID`='31'", BizzInfo[31][bTill]);
            mysql_tquery(SQL, str2, "", ""); */
        }

Link to comment
Share on other sites

  • 0
2 minutes ago, Eclari said:

@VLM
 

        case DIALOG_RENTVEH: {
            if(!response) return 1;
            if(GetPlayerMoney(playerid) < VehicleRentPrice(listitem)) return SCM(playerid, COLOR_GREY, "You don't have enough money.");

            new Float:x, Float:y, Float:z, Float:angle, color1 = random(128), color2 = random(128);
            GetPlayerPos(playerid, x, y, z);
            GetPlayerFacingAngle(playerid, angle);
            RentVehicle[playerid] = AddStaticVehicle(VehicleRentID(listitem), x, y, z, angle, color1, color2);
            giveMoney(playerid, -VehicleRentPrice(listitem));
            Update(playerid, pMoney);
            PutPlayerInVehicle(playerid, RentVehicle[playerid], 0);
            format(string, sizeof string, "{FFC000}(Rent Vehicle): {FFFFFF}You pay %s$ for an %s from rent.", formatNumber(VehicleRentPrice(listitem)), VehicleRentName(listitem));
            SCM(playerid, COLOR_WHITE, string);
            format(string, sizeof string, "{FFC000}(Rent Vehicle): {FFFFFF}When you leave the car for 5 minutes, this dissapear.");
            SCM(playerid, COLOR_WHITE, string);
            RentTimer[playerid] = 300;
            /*new str2[256];
            BizzInfo[31][bTill] += VehicleRentPrice(listitem);
            mysql_format(SQL, str2, sizeof(str2), "UPDATE `bizz` SET `Till`='%d' WHERE `ID`='31'", BizzInfo[31][bTill]);
            mysql_tquery(SQL, str2, "", ""); */
        }

add discord si te rezolv mai repede, VLM#7273

#retras

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.