Jump to content
  • 0

Question

Posted

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) {

7 answers to this question

Recommended Posts

  • 0
Posted

@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;
}

  • 0
Posted
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

  • 0
Posted

@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, "", ""); */
        }

  • 0
Posted
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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • 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.