Beiträge von malE


    if(strcmp(cmd, "/fill", true) == 0)
    {
    new veh = GetPlayerVehicleID(playerid);
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,COLOR_YELLOW, "Du bist in Keinem Fahrzeug:");
    if(IsANoTachoVehicle(veh))return SendClientMessage(playerid,COLOR_YELLOW," Ein Fahrrad hat doch keinen Tank.");


    if(IsAtGasStation(playerid))
    {
    for(new i = 0; i < sizeof(TankstellenInfo); i ++)
    {


    if(IsPlayerInRangeOfPoint(playerid,10.0, TankstellenInfo[i][tsEntranceX], TankstellenInfo[i][tsEntranceY], TankstellenInfo[i][tsEntranceZ]))
    {
    if(GetPlayerMoney(playerid) < TankstellenInfo[i][tsEntranceCost])return GameTextForPlayer(playerid, "~r~Du hast nicht genug Geld", 5000, 1);
    {
    if(PlayerInfo[playerid][pPtankkey] != 0)
    {
    if(TankstellenInfo[i][tsLocked] == 1)return SendClientMessage(playerid,COLOR_RED, "Die Tanke hat geschlossen");
    if(TankstellenInfo[i][tsProducts] == 5000)return SendClientMessage(playerid,COLOR_RED, "Die Tankstelle hat kein Benzin mehr");
    if(Refueling[playerid] == 1)return SendClientMessage(playerid, COLOR_RED, "Du bist gerade am tanken...");


    Refueling[playerid] = 1;
    FreezePlayer(playerid);
    SetTimerEx("Fillup",RefuelWait,0, "ii", playerid, i);
    SendClientMessage(playerid,COLOR_WHITE," Dein Fahrzeug wird betankt, Bitte warten....");
    }
    }
    }
    }
    }
    }
    else if(IsPlayerInRangeOfPoint(playerid,90.0, 78.8584, -291.3175, 1.5781))
    {
    new tmpcar = GetPlayerVehicleID(playerid);
    new compcost2 = 50;

    if(PlayerInfo[playerid][pJob] != 22)return SendClientMessage(playerid, COLOR_WHITE, "du bist kein Trucker");
    if(!strlen(tmp))return SendClientMessage(playerid, COLOR_GRAD1, "FEHLER: /fill [Menge]");


    new vehicleid = GetPlayerVehicleID(playerid);
    if(!IsATruck2(tmpcar))return SendClientMessage(playerid, TEAM_GROVE_COLOR, "Dieses Fahrzeug kann keine Benzin ausliefern.");
    if(!IsTrailerAttachedToVehicle(vehicleid))return SendClientMessage(playerid, COLOR_RED, "Du hast keinen anhänger dran");


    new typ=GetPlayerHaul(tmpcar);
    if(PlayerHaul2[typ][pLoad2] < PlayerHaul2[typ][pCapasity2])
    {
    new amount;
    amount = strval(tmp);
    if(amount < 1 || amount > 1500)return SendClientMessage(playerid, COLOR_GREY, " Die Menge muss zwischen 1 und 1500 sein !");


    new check= PlayerHaul2[typ][pLoad2] + amount;
    if(check > PlayerHaul2[typ][pCapasity2])
    {
    format(string, sizeof(string), " Du hast das Limit mit %d Benzin erreicht, Benzin: %d.",PlayerHaul2[typ][pCapasity2],PlayerHaul2[typ][pLoad2]);
    return SendClientMessage(playerid, COLOR_GREY, string);
    }

    new cost = amount*compcost2;
    if(GetPlayerMoney(playerid) >= cost)
    {
    PlayerHaul2[typ][pLoad2] += amount;
    format(string, sizeof(string), "Benzin: %d/%d.", PlayerHaul2[typ][pLoad2],PlayerHaul2[typ][pCapasity2]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Du hast %d Benzin für $%d gekauft.", amount,cost);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    GivePlayerMoney(playerid,-cost);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    return 1;
    }
    else
    {
    format(string, sizeof(string), "Du kannst nicht %d Benzin für $%d anfordern!", amount,cost);
    return 1SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    }
    }
    else
    {
    format(string, sizeof(string), "Benzin: %d/%d.", PlayerHaul2[typ][pLoad2],PlayerHaul2[typ][pCapasity2]);
    return SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    }
    }
    else
    {
    return SendClientMessage(playerid, COLOR_YELLOW,"Du bist an keiner Tankstelle!");
    }
    return 1;
    }

    Stimmt, habe etwas vergessen.

    if(strcmp(cmd, "/fill", true) == 0)
    {
    new veh = GetPlayerVehicleID(playerid);
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,COLOR_YELLOW, "Du bist in Keinem Fahrzeug:");
    if(IsANoTachoVehicle(veh))return SendClientMessage(playerid,COLOR_YELLOW," Ein Fahrrad hat doch keinen Tank.");


    if(IsAtGasStation(playerid))
    {
    for(new i = 0; i < sizeof(TankstellenInfo); i ++)
    {


    if(IsPlayerInRangeOfPoint(playerid,10.0, TankstellenInfo[i][tsEntranceX], TankstellenInfo[i][tsEntranceY], TankstellenInfo[i][tsEntranceZ]))
    {
    if(GetPlayerMoney(playerid) < TankstellenInfo[i][tsEntranceCost])return GameTextForPlayer(playerid, "~r~Du hast nicht genug Geld", 5000, 1);
    {
    if(PlayerInfo[playerid][pPtankkey] != 0)
    {
    if(TankstellenInfo[i][tsLocked] == 1)return SendClientMessage(playerid,COLOR_RED, "Die Tanke hat geschlossen");
    if(TankstellenInfo[i][tsProducts] == 5000)return SendClientMessage(playerid,COLOR_RED, "Die Tankstelle hat kein Benzin mehr");
    if(Refueling[playerid] == 1)return SendClientMessage(playerid, COLOR_RED, "Du bist gerade am tanken...");


    Refueling[playerid] = 1;
    FreezePlayer(playerid);
    SetTimerEx("Fillup",RefuelWait,0, "ii", playerid, i);
    SendClientMessage(playerid,COLOR_WHITE," Dein Fahrzeug wird betankt, Bitte warten....");
    }
    }
    }
    }
    }
    }
    if(IsPlayerInRangeOfPoint(playerid,90.0, 78.8584, -291.3175, 1.5781))
    {
    new tmpcar = GetPlayerVehicleID(playerid);
    new compcost2 = 50;

    if(PlayerInfo[playerid][pJob] != 22)return SendClientMessage(playerid, COLOR_WHITE, "du bist kein Trucker");
    if(!strlen(tmp))return SendClientMessage(playerid, COLOR_GRAD1, "FEHLER: /fill [Menge]");


    new vehicleid = GetPlayerVehicleID(playerid);
    if(!IsATruck2(tmpcar))return SendClientMessage(playerid, TEAM_GROVE_COLOR, "Dieses Fahrzeug kann keine Benzin ausliefern.");
    if(!IsTrailerAttachedToVehicle(vehicleid))return SendClientMessage(playerid, COLOR_RED, "Du hast keinen anhänger dran");


    new typ=GetPlayerHaul(tmpcar);
    if(PlayerHaul2[typ][pLoad2] < PlayerHaul2[typ][pCapasity2])
    {
    new amount;
    amount = strval(tmp);
    if(amount < 1 || amount > 1500)return SendClientMessage(playerid, COLOR_GREY, " Die Menge muss zwischen 1 und 1500 sein !");


    new check= PlayerHaul2[typ][pLoad2] + amount;
    if(check > PlayerHaul2[typ][pCapasity2])
    {
    format(string, sizeof(string), " Du hast das Limit mit %d Benzin erreicht, Benzin: %d.",PlayerHaul2[typ][pCapasity2],PlayerHaul2[typ][pLoad2]);
    return SendClientMessage(playerid, COLOR_GREY, string);
    }

    new cost = amount*compcost2;
    if(GetPlayerMoney(playerid) >= cost)
    {
    PlayerHaul2[typ][pLoad2] += amount;
    format(string, sizeof(string), "Benzin: %d/%d.", PlayerHaul2[typ][pLoad2],PlayerHaul2[typ][pCapasity2]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Du hast %d Benzin für $%d gekauft.", amount,cost);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    GivePlayerMoney(playerid,-cost);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    return 1;
    }
    else
    {
    format(string, sizeof(string), "Du kannst nicht %d Benzin für $%d anfordern!", amount,cost);
    return 1SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    }
    }
    else
    {
    format(string, sizeof(string), "Benzin: %d/%d.", PlayerHaul2[typ][pLoad2],PlayerHaul2[typ][pCapasity2]);
    return SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    }
    }
    else
    {
    return SendClientMessage(playerid, COLOR_YELLOW,"Du bist an keiner Tankstelle!");
    }
    return 1;
    }

    So vielleicht?

    if(strcmp(cmd, "/fill", true) == 0)
    {
    new veh = GetPlayerVehicleID(playerid);
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,COLOR_YELLOW, "Du bist in Keinem Fahrzeug:");
    if(IsANoTachoVehicle(veh))return SendClientMessage(playerid,COLOR_YELLOW," Ein Fahrrad hat doch keinen Tank.");


    if(IsAtGasStation(playerid))
    {
    for(new i = 0; i < sizeof(TankstellenInfo); i ++)
    {


    if(IsPlayerInRangeOfPoint(playerid,10.0, TankstellenInfo[i][tsEntranceX], TankstellenInfo[i][tsEntranceY], TankstellenInfo[i][tsEntranceZ]))
    {
    if(GetPlayerMoney(playerid) >= TankstellenInfo[i][tsEntranceCost])return GameTextForPlayer(playerid, "~r~Du hast nicht genug Geld", 5000, 1);
    {
    if(PlayerInfo[playerid][pPtankkey] != 0)
    {
    if(TankstellenInfo[i][tsLocked] == 1)return SendClientMessage(playerid,COLOR_RED, "Die Tanke hat geschlossen");
    if(TankstellenInfo[i][tsProducts] == 5000)return SendClientMessage(playerid,COLOR_RED, "Die Tankstelle hat kein Benzin mehr");
    if(Refueling[playerid] == 1)return SendClientMessage(playerid, COLOR_RED, "Du bist gerade am tanken...");


    Refueling[playerid] = 1;
    FreezePlayer(playerid);
    SetTimerEx("Fillup",RefuelWait,0, "ii", playerid, i);
    SendClientMessage(playerid,COLOR_WHITE," Dein Fahrzeug wird betankt, Bitte warten....");
    }
    }
    }
    }
    }
    }
    else if(IsPlayerInRangeOfPoint(playerid,90.0, 78.8584, -291.3175, 1.5781))
    {
    new tmpcar = GetPlayerVehicleID(playerid);
    new compcost2 = 50;

    if(PlayerInfo[playerid][pJob] != 22)return SendClientMessage(playerid, COLOR_WHITE, "du bist kein Trucker");
    if(!strlen(tmp))return SendClientMessage(playerid, COLOR_GRAD1, "FEHLER: /fill [Menge]");


    new vehicleid = GetPlayerVehicleID(playerid);
    if(!IsATruck2(tmpcar))return SendClientMessage(playerid, TEAM_GROVE_COLOR, "Dieses Fahrzeug kann keine Benzin ausliefern.");
    if(!IsTrailerAttachedToVehicle(vehicleid))return SendClientMessage(playerid, COLOR_RED, "Du hast keinen anhänger dran");


    new typ=GetPlayerHaul(tmpcar);
    if(PlayerHaul2[typ][pLoad2] < PlayerHaul2[typ][pCapasity2])
    {
    new amount;
    amount = strval(tmp);
    if(amount < 1 || amount > 1500)return SendClientMessage(playerid, COLOR_GREY, " Die Menge muss zwischen 1 und 1500 sein !");


    new check= PlayerHaul2[typ][pLoad2] + amount;
    if(check > PlayerHaul2[typ][pCapasity2])
    {
    format(string, sizeof(string), " Du hast das Limit mit %d Benzin erreicht, Benzin: %d.",PlayerHaul2[typ][pCapasity2],PlayerHaul2[typ][pLoad2]);
    return SendClientMessage(playerid, COLOR_GREY, string);
    }

    new cost = amount*compcost2;
    if(GetPlayerMoney(playerid) >= cost)
    {
    PlayerHaul2[typ][pLoad2] += amount;
    format(string, sizeof(string), "Benzin: %d/%d.", PlayerHaul2[typ][pLoad2],PlayerHaul2[typ][pCapasity2]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Du hast %d Benzin für $%d gekauft.", amount,cost);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    GivePlayerMoney(playerid,-cost);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    return 1;
    }
    else
    {
    format(string, sizeof(string), "Du kannst nicht %d Benzin für $%d anfordern!", amount,cost);
    return 1SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    }
    }
    else
    {
    format(string, sizeof(string), "Benzin: %d/%d.", PlayerHaul2[typ][pLoad2],PlayerHaul2[typ][pCapasity2]);
    return SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    }
    }
    else
    {
    return SendClientMessage(playerid, COLOR_YELLOW,"Du bist an keiner Tankstelle!");
    }
    return 1;
    }

    Empfehle dir außerdem "sscanf" zu benutzen.

    So?

    ocmd:motor(playerid,params[])
    {
    if(GetPlayerState(playerid)!=PLAYER_STATE_DRIVER)return 1;
    new vID=GetPlayerVehicleID(playerid);
    if(!HatFahrzeugEinMotor(GetVehicleModel(vID)))return SendClientMessage(playerid, -1, "Dieses Fahrzeug hat kein Motor.");
    new tmp_motor,tmp_licht,tmp_alarm,tmp_tuer,tmp_mhaube,tmp_kraum,tmp_objective;
    GetVehicleParamsEx(vID,tmp_motor,tmp_licht,tmp_alarm,tmp_tuer,tmp_mhaube,tmp_kraum,tmp_objective);
    if(tmp_motor==1)
    {
    tmp_motor =0;
    }
    else
    {
    tmp_motor=1;
    }
    SetVehicleParamsEx(vID,tmp_motor,tmp_licht,tmp_alarm,tmp_tuer,tmp_mhaube,tmp_kraum,tmp_objective);
    return 1;
    }


    stock HatFahrzeugEinMotor(vehicleid)
    {
    for(new i=0; i < sizeof(VehOhneMotor); i++) {
    if(vehicleid != VehOhneMotor[i]) continue;
    return false;
    }
    return true;
    }

    So?

    if(strcmp(cmd, "/fill", true) == 0)
    {
    new veh = GetPlayerVehicleID(playerid);
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    if(!IsPlayerInAnyVehicle(playerid))return SendClientMessage(playerid,COLOR_YELLOW, "Du bist in Keinem Fahrzeug:");
    if(IsANoTachoVehicle(veh))return SendClientMessage(playerid,COLOR_YELLOW," Ein Fahrrad hat doch keinen Tank.");


    if(IsAtGasStation(playerid))
    {
    for(new i = 0; i < sizeof(TankstellenInfo); i ++)
    {
    if(IsPlayerInRangeOfPoint(playerid,10.0, TankstellenInfo[i][tsEntranceX], TankstellenInfo[i][tsEntranceY], TankstellenInfo[i][tsEntranceZ]))
    {
    if(GetPlayerMoney(playerid) < TankstellenInfo[i][tsEntranceCost]) return GameTextForPlayer(playerid, "~r~Du hast nicht genug Geld", 5000, 1);
    if(PlayerInfo[playerid][pPtankkey] != 0)
    {
    if(TankstellenInfo[i][tsLocked] == 1)return SendClientMessage(playerid,COLOR_RED, "Die Tanke hat geschlossen");
    if(TankstellenInfo[i][tsProducts] == 5000)return SendClientMessage(playerid,COLOR_RED, "Die Tankstelle hat kein Benzin mehr");
    if(Refueling[playerid] == 1)return SendClientMessage(playerid, COLOR_RED, "Du bist gerade am tanken...");


    Refueling[playerid] = 1;
    FreezePlayer(playerid);
    SetTimerEx("Fillup",RefuelWait,0, "ii", playerid, i);
    SendClientMessage(playerid,COLOR_WHITE," Dein Fahrzeug wird betankt, Bitte warten....");
    }
    }
    }

    }
    else if(IsPlayerInRangeOfPoint(playerid,90.0, 78.8584, -291.3175, 1.5781))
    {
    new tmpcar = GetPlayerVehicleID(playerid);

    new compcost2 = 50;
    if(PlayerInfo[playerid][pJob] != 22)return SendClientMessage(playerid, COLOR_WHITE, "du bist kein Trucker");
    if(!strlen(tmp))return SendClientMessage(playerid, COLOR_GRAD1, "FEHLER: /fill [Menge]");


    new vehicleid = GetPlayerVehicleID(playerid);
    if(!IsATruck2(tmpcar))return SendClientMessage(playerid, TEAM_GROVE_COLOR, "Dieses Fahrzeug kann kein Benzin ausliefern.");
    if(!IsTrailerAttachedToVehicle(vehicleid))return SendClientMessage(playerid, COLOR_RED, "Du hast keinen anhänger dran");


    new typ=GetPlayerHaul(tmpcar);
    if(PlayerHaul2[typ][pLoad2] < PlayerHaul2[typ][pCapasity2])
    {
    new amount;
    amount = strval(tmp);
    if(amount < 1 || amount > 1500)return SendClientMessage(playerid, COLOR_GREY, " Die Menge muss zwischen 1 und 1500 sein !");


    new check= PlayerHaul2[typ][pLoad2] + amount;
    if(check > PlayerHaul2[typ][pCapasity2])
    {
    format(string, sizeof(string), " Du hast das Limit mit %d Benzin erreicht, Benzin: %d.",PlayerHaul2[typ][pCapasity2],PlayerHaul2[typ][pLoad2]);
    return SendClientMessage(playerid, COLOR_GREY, string);
    }

    new cost = amount*compcost2;
    if(GetPlayerMoney(playerid) >= cost)
    {
    PlayerHaul2[typ][pLoad2] += amount;
    format(string, sizeof(string), "Benzin: %d/%d.", PlayerHaul2[typ][pLoad2],PlayerHaul2[typ][pCapasity2]);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    format(string, sizeof(string), "Du hast %d Benzin für $%d gekauft.", amount,cost);
    SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    GivePlayerMoney(playerid,-cost);
    PlayerPlaySound(playerid, 1052, 0.0, 0.0, 0.0);
    return 1;
    }
    else
    {
    format(string, sizeof(string), "Du kannst nicht %d Benzin für $%d anfordern!", amount,cost);
    return SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    }
    }
    else
    {
    format(string, sizeof(string), "Benzin: %d/%d.", PlayerHaul2[typ][pLoad2],PlayerHaul2[typ][pCapasity2]);
    return SendClientMessage(playerid, TEAM_GROVE_COLOR, string);
    }
    }
    else
    {
    return SendClientMessage(playerid, COLOR_YELLOW,"Du bist an keiner Tankstelle!");
    }
    }
    return 1;
    }

    Weil du den Motor dann ausschaltest!
    Du startest den Motor automatisch, sobald du in ein Fahrzeug einsteigst, welches du in deinem Array (VehOhneMotor[]) definiert hast (siehe public OnPlayerStateChange(...)). Ich nehme mal an, dass du die ID des Fahrrads auch im Array definiert hast.



    Die Parkstreifen direkt vor dem Gebäude würde ich durch Sitzmöglichkeiten etc. ersetzen. Außerdem ist mir aufgefallen, dass auf dem Parkplatz überhaupt keine Beleuchtung ist.
    Ansonsten wirklich eine sehr schöne Map, gefällt mir wirklich gut!

    Falls du die Buchstaben jeweils immer großgeschrieben haben möchtest, kannst du noch ein toupper() hinzufügen.

    format(plate, sizeof(plate), "%c%c %d", toupper(username[0]), toupper(username[1]), random(500000)+1);

    Klar

    enum enum_Items
    {
    itemID,
    itemName[36],
    Float:itemWeight,
    Float:itemMunitionWeight
    }
    new Items[][enum_Items] = {
    {0, "LEER", 0.0, 0.0},
    {1, "Wasserflasche", 0.75, 0.0},
    {2, "Mariuana", 0.01, 0.0},
    {3, "AK-47", 4.5, 0.096},
    {4, "Desert Eagle", 2.5, 0.075},
    {5, "Schrotflinte", 4.5, 0.3},
    {6, "Scharfschützengewehr", 8.5, 0.46}
    };

    Abend,


    hat jemand eine Idee weshalb ich hier ein Error bekomme?



    stock Float:GetItemWeight(itemid, menge)
    {
    new Float:weight = 0.0;
    if(menge > 0)
    if(itemid >= 1 && <= 46) {
    weight = menge + (menge * Items[itemid][itemMunitionWeight]);
    }
    weight = menge * Items[itemid][itemWeight]; // error 010: invalid function or declaration
    }
    return weight;
    }