Beiträge von Move

    Nightstream mein Guter xD (Diesel)




    ocmd:sellbenzin(playerid,params[])
    {
    new vehicleid = GetPlayerVehicleID(playerid);
    new model = GetVehicleModel(vehicleid);
    if(model==403)
    {
    if(!IsTrailerAttachedToVehicle(GetPlayerVehicleID(playerid)))
    {
    SendClientMessage(playerid,COLOR_WEISS,"Du brauchst einen Anhänger");
    return 1;
    }
    else
    {
    tankeid[playerid] = 0;
    if(IsPlayerInRangeOfPoint(playerid,10,1003.5693,-938.2118,42.1797))//Tanke am BSN
    {
    tankeid[playerid] = 1;
    }
    if(IsPlayerInRangeOfPoint(playerid,10,-2029.5404,156.8674,28.8359))//Tanke an der Fahrschule
    {
    tankeid[playerid] = 2;
    }
    if(IsPlayerInRangeOfPoint(playerid,10,2202.1765,2475.5571,11.4266))//Tanke an der FBI Base
    {
    tankeid[playerid] = 3;
    }
    if(IsPlayerInRangeOfPoint(playerid,10,1942.3713,-1772.6071,13.6406))//Tanke nähe GS-BASE
    {
    tankeid[playerid] = 4;
    }
    if(IsPlayerInRangeOfPoint(playerid,14,-86.0925,-1176.1245,2.6736))//Tanke nach der Zollbrücke
    {
    tankeid[playerid] = 5;
    }
    if(IsPlayerInRangeOfPoint(playerid,10,-1675.5923,414.9839,7.1797))//Tanke SF nähe SFPD
    {
    tankeid[playerid] = 6;
    }
    if(IsPlayerInRangeOfPoint(playerid,10,-2410.0371,976.2311,45.4255))//Tanke
    {
    tankeid[playerid] = 7;
    }
    if(IsPlayerInRangeOfPoint(playerid,10,-1472.5558,1864.2587,32.6328))//Tanke
    {
    tankeid[playerid] = 8;
    }
    if(IsPlayerInRangeOfPoint(playerid,10,-1327.5145,2677.3347,50.0625))//Tanke
    {
    tankeid[playerid] = 9;
    }
    if(IsPlayerInRangeOfPoint(playerid,10,2114.6160,919.9354,10.8203))//Tanke
    {
    tankeid[playerid] = 10;
    }
    if(IsPlayerInRangeOfPoint(playerid,10,618.7733,1688.2094,7.1875))//Tanke
    {
    tankeid[playerid] = 11;
    }
    if(IsPlayerInRangeOfPoint(playerid,10,655.0226,-563.9221,16.3359))//Tanke
    {
    tankeid[playerid] = 12;
    }
    if(IsPlayerInRangeOfPoint(playerid,10,-1605.5310,-2714.1438,48.5335))//Tanke
    {
    tankeid[playerid] = 13;
    }
    if(IsPlayerInRangeOfPoint(playerid,10,2147.1450,2747.9507,10.8203))//Tanke
    {
    tankeid[playerid] = 14;
    }
    if(IsPlayerInRangeOfPoint(playerid,10,2638.9692,1106.6760,10.8203))//Tanke
    {
    tankeid[playerid] = 15;
    }
    if(IsPlayerInRangeOfPoint(playerid,10,1381.4858,459.6880,20.3452))//Tanke
    {
    tankeid[playerid] = 16;
    }
    if(IsPlayerInRangeOfPoint(playerid,10,-2244.1311,-2560.8872,31.9219))//Tanke
    {
    tankeid[playerid] = 17;
    }
    if(IsPlayerInRangeOfPoint(playerid,10,-2068.1462,1374.8856,7.1007))//Tanke in SF /HELI TANKE
    {
    tankeid[playerid] = 18;
    }
    if(IsPlayerInRangeOfPoint(playerid,10,1596.7278,2198.3574,10.8203))//Tanke
    {
    tankeid[playerid] = 19;
    }
    if(tankeid[playerid] == 0)
    {
    SendClientMessage(playerid,COLOR_WEISS,"Du bist an keiner Tanke !");
    return 1;
    }
    new zahl,String[128];
    if(sscanf(params,"d",zahl))return SendClientMessage(playerid,0xFF0000,"Info:/sellbenzin [Menge]");
    if(zahl > 501)
    {
    SendClientMessage(playerid,COLOR_WEISS,"Das geht so nicht !");
    return 1;
    }
    if(zahl < 0)
    {
    SendClientMessage(playerid,COLOR_WEISS,"Das geht so nicht !");
    return 1;
    }
    new max_m = 2500 - TankeInfo[tankeid[playerid]][Benzin];
    new geld = zahl * TankeInfo[tankeid[playerid]][Verkauf];
    if(max_m >= zahl)
    {
    if(zahl > BenzinTanker[vehicleid])
    {
    SendClientMessage(playerid,COLOR_WEISS,"So viel hast du nicht dabei");
    format(String, sizeof(String), "%d/500",BenzinTanker[vehicleid]);
    SendClientMessage(playerid,COLOR_WEISS,String);
    return 1;
    }
    TankeInfo[tankeid[playerid]][Benzin] = TankeInfo[tankeid[playerid]][Benzin]+zahl;
    GivePlayerMoney(playerid,geld);
    format(String, sizeof(String), "Du hast %d Liter an die Tanke für %d $ Verkauft.",zahl,geld);
    SendClientMessage(playerid,COLOR_WEISS,String);
    SendClientMessage(playerid,COLOR_WEISS,"Das Geld wird beim PayDay ausgezahlt!");
    BenzinTanker[vehicleid] = BenzinTanker[vehicleid]-zahl;
    format(String, sizeof(String), "%d/500",BenzinTanker[vehicleid]);
    SendClientMessage(playerid,COLOR_WEISS,String);

    format(String, sizeof(String), "Tankstelle\nBenzin: %d Liter\nPreis pro Liter: %d \nAnkauf %d $ pro Liter",TankeInfo[tankeid[playerid]][Benzin],TankeInfo[tankeid[playerid]][Kosten],TankeInfo[tankeid[playerid]][Verkauf]);
    Update3DTextLabelText(TankeInfo[tankeid[playerid]][TankeLabel], 0x00FFA0FF, String);
    format(String, sizeof(String), "Tanken/Tanke%d.ini", tankeid[playerid]);
    if(dini_Exists(String))
    {
    dini_IntSet(String, "Benzin",TankeInfo[tankeid[playerid]][Benzin]);
    }
    return 1;
    }
    else
    {
    SendClientMessage(playerid,COLOR_WEISS,"Die Tanke kann dir nicht so viel abkaufen !");
    return 1;
    }

    }
    }
    else
    {
    SendClientMessage(playerid,COLOR_WEISS,"Du musst in einem LKW sein !");
    return 1;
    }
    }