Jump to content
  • 0

Problema comanda Fuelcars


Adrian FW

Question

Nu modifica fuel-ul la masini gen daca masina are 75% si dau /fuelcars e la fel

CMD:fuelcars(playerid, params[])
{
    if(pInfo[playerid][pAdmin] < 3) return SendClientMessage(playerid, COLOR_DARKGRAY, AdminError);
    for(new i = 0; i <= RLBike[10]; i++) vVar[3] = GasMax;
    format(AdminWText, sizeof(AdminWText), "AdmCmd: %s has filled all cars with fuel.", GetName(playerid));
    SendAdminMessage(playerid, COLOR_ADMWARNING, AdminWText);
    return 1;
}

Link to comment
Share on other sites

3 answers to this question

Recommended Posts

  • 0
10 minutes ago, iKoGames said:

Tu ai doar 10 masini pe server?

 

CMD:fill(playerid, params [])
{
    if(!IsPlayerInAnyVehicle(playerid)) return SendClientMessage(playerid, COLOR_DARKGRAY, "You're not in a vehicle.");
    if(GetPlayerState(playerid) != PLAYER_STATE_DRIVER) return SendClientMessage(playerid, COLOR_DARKGRAY, "You're not the driver.");
    if(vVar[3][pInfo[playerid][aVar][1]] >= 100) return SendClientMessage(playerid, COLOR_DARKGRAY, "The vehicle has a full tank.");
    if(pInfo[playerid][pGasCan] == 2 && (!(IsPlayerInRangeOfPoint(playerid, 6.9, 1004.3961,-939.5698,42.1797) || IsPlayerInRangeOfPoint(playerid, 8.9, 1942.3723,-1772.9437,13.6406) || IsPlayerInRangeOfPoint(playerid, 10.9, -91.8198,-1169.6456,2.4338)
        || IsPlayerInRangeOfPoint(playerid, 30.0, -1606.7369,-2713.9268,48.5391) || IsPlayerInRangeOfPoint(playerid, 40.0, 2202.2053,2475.7173,10.8203) || IsPlayerInRangeOfPoint(playerid, 60.0, 614.4914,1692.8192,7.1875)
        || IsPlayerInRangeOfPoint(playerid, 45.0, 2114.2112,920.2231,10.8203) || IsPlayerInRangeOfPoint(playerid, 40.0, 2146.8569,2747.8384,10.8203) || IsPlayerInRangeOfPoint(playerid, 15.0, -2244.1155,-2560.7141,31.9219)
        || IsPlayerInRangeOfPoint(playerid, 30.0, -1328.4288,2677.9236,50.0625) || IsPlayerInRangeOfPoint(playerid, 40.0, 2639.5413,1106.5266,10.8203) || IsPlayerInRangeOfPoint(playerid, 40.0, 1596.5918,2198.9167,10.8203)
        || IsPlayerInRangeOfPoint(playerid, 30.0, -1472.5554,1864.1527,32.6328) || IsPlayerInRangeOfPoint(playerid, 20.0, 655.6916,-565.3945,16.3359)
        || IsPlayerInRangeOfPoint(playerid, 20.0, 1381.3810,459.2968,20.3452))))
    {
        if(vVar[3][pInfo[playerid][aVar][1]]+20 > 100) return SendClientMessage(playerid, COLOR_DARKGRAY, "Does not fit so much fuel in your tank.");
        vVar[3][pInfo[playerid][aVar][1]] += 20, pInfo[playerid][pGasCan] = 1, SendClientMessage(playerid, COLOR_LIGHTBLUE, "* Vehicle filled up from Gas Can.");
        return 1;
    }
    if(!(IsPlayerInRangeOfPoint(playerid, 6.9, 1004.3961,-939.5698,42.1797) || IsPlayerInRangeOfPoint(playerid, 8.9, 1942.3723,-1772.9437,13.6406) || IsPlayerInRangeOfPoint(playerid, 10.9, -91.8198,-1169.6456,2.4338)
        || IsPlayerInRangeOfPoint(playerid, 30.0, -1606.7369,-2713.9268,48.5391) || IsPlayerInRangeOfPoint(playerid, 40.0, 2202.2053,2475.7173,10.8203) || IsPlayerInRangeOfPoint(playerid, 60.0, 614.4914,1692.8192,7.1875)
        || IsPlayerInRangeOfPoint(playerid, 45.0, 2114.2112,920.2231,10.8203) || IsPlayerInRangeOfPoint(playerid, 40.0, 2146.8569,2747.8384,10.8203) || IsPlayerInRangeOfPoint(playerid, 15.0, -2244.1155,-2560.7141,31.9219)
        || IsPlayerInRangeOfPoint(playerid, 30.0, -1328.4288,2677.9236,50.0625) || IsPlayerInRangeOfPoint(playerid, 40.0, 2639.5413,1106.5266,10.8203) || IsPlayerInRangeOfPoint(playerid, 40.0, 1596.5918,2198.9167,10.8203)
        || IsPlayerInRangeOfPoint(playerid, 30.0, -1472.5554,1864.1527,32.6328) || IsPlayerInRangeOfPoint(playerid, 20.0, 655.6916,-565.3945,16.3359)
        || IsPlayerInRangeOfPoint(playerid, 20.0, 1381.3810,459.2968,20.3452)))
        return SendClientMessage(playerid, COLOR_DARKGRAY, "You are not at the Gas Station.");
    if(pInfo[playerid][aVar][3] == 1) return 1;
    GetVehicleParamsEx(pInfo[playerid][aVar][1], vParams[0], vParams[1], vParams[2], vParams[3], vParams[4], vParams[5], vParams[6]);
    if(vParams[0] != 0) return SendClientMessage(playerid, COLOR_DARKGRAY, "You must stop your engine in order to refuel your vehicle.");
    GameTextForPlayer(playerid, "~w~re-fueling vehicle, please wait...", 5000, 3), pInfo[playerid][aVar][95] = 100-vVar[3][pInfo[playerid][aVar][1]];
    pInfo[playerid][aVar][40] = SetTimerEx("Fillup", 13000, 0, "i", playerid), pInfo[playerid][aVar][3] = 1;
    return 1;

 

Ma poti ajuta si la aceasta ?

 

Link to comment
Share on other sites

  • 0
Acum 10 ore, Adrian FW a spus:

Ma poti ajuta si la aceasta ?

 

CMD:fil(playerid, params[])
{
    if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "You need to login first.");
    new idcar = GetPlayerVehicleID(playerid);
    if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
    {
        if(GetPVarInt(playerid, "Engine") == 0)
        {
            if(IsAtGasStation(playerid))
            {
                TogglePlayerControllable(playerid, 0);
                GameTextForPlayer(playerid,"~w~~n~~n~~n~~n~~n~~n~~n~~n~~n~Re-Fueling Vehicle, please wait",2000,3);
                SetTimerEx("Fillup",RefuelWait,0,"i",playerid);
                Refueling[playerid] = 1;
            }
            else
            {
                if(PlayerInfo[playerid][pFuel] > 0)
                {
                    SendClientMessage(playerid, COLOR_DARKPINK, "* You filled your car with 20% fuel from your gas can.");
                    if(Gas[idcar] < 80)
                    {
                        Gas[idcar] += 20;
                    }
                    else
                    {
                        Gas[idcar] = 100;
                    }
                    PlayerInfo[playerid][pFuel] = 0;
                    new str[128];
                    mysql_format(SQL,str,sizeof(str),"UPDATE users SET `Fuel`='0' WHERE `name`='%s'",PlayerInfo[playerid][pNormalName]);
                    mysql_tquery(SQL,str,"","");
                    TogglePlayerControllable(playerid, 1);
                }
                return 1;
            }
        }
        else
        {
            SendClientMessage(playerid,COLOR_WHITE,"You need to stop your engine before reffueling!");
        }
    }
    return 1;
}

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.