[Suche] Suche ein Auto Kauf und Verkauf system (das man user sein auto verkaufen kann)

Wichtiger Hinweis: Bitte ändert nicht manuell die Schriftfarbe auf schwarz sondern belasst es bei der Standardeinstellung. Somit tragt ihr dazu bei dass euer Text auch bei Verwendung unseren dunklen Forenstils noch lesbar ist!

Tipp: Ihr wollt längere Codeausschnitte oder Logfiles bereitstellen? Benutzt unseren eigenen PasteBin-Dienst Link
  • Das GodFather-Script weißt so eine Funktion vor. (/sellcar)
    Schau da einfach mal rein, wenn das dass ist, was du suchst. :thumbup:
    Hier einmal die betreffenden Zeilen für dich:


    if(strcmp(cmd,"/sellcar",true)==0)
    {
    if(IsPlayerConnected(playerid))
    {
    if(!IsPlayerInAnyVehicle(playerid))
    {
    SendClientMessage(playerid,COLOR_GREY," You are not in a Car !");
    return 1;
    }
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sellcar [playerid/PartOfName] [price]");
    return 1;
    }
    //giveplayerid = strval(tmp);
    giveplayerid = ReturnUser(tmp);
    tmp = strtok(cmdtext, idx);
    if(!strlen(tmp))
    {
    SendClientMessage(playerid, COLOR_WHITE, "USAGE: /sellcar [playerid/PartOfName] [price]");
    return 1;
    }
    new money = strval(tmp);
    if(money < 1 || money > 99999) { SendClientMessage(playerid, COLOR_GREY, " Price not below $1 or above $99999 !"); return 1; }
    if (IsPlayerConnected(giveplayerid))
    {
    if(giveplayerid != INVALID_PLAYER_ID)
    {
    if (ProxDetectorS(8.0, playerid, giveplayerid))
    {
    if(giveplayerid == playerid)
    {
    SendClientMessage(playerid, COLOR_GREY, " Cant sell to yourself!");
    return 1;
    }
    if(CarCalls[giveplayerid] > 0)
    {
    SendClientMessage(playerid, COLOR_GREY, " That player has already bought a car, has to use /callcar first !");
    return 1;
    }
    GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
    GetPlayerName(playerid, sendername, sizeof(sendername));
    format(string, sizeof(string), "* You offerd %s to buy your Car for $%d .", giveplayer, money);
    SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
    format(string, sizeof(string), "* Car Dealer %s wants to sell you his Car for $%d, (type /accept car) to buy.", sendername, money);
    SendClientMessage(giveplayerid, COLOR_LIGHTBLUE, string);
    CarOffer[giveplayerid] = playerid;
    CarPrice[giveplayerid] = money;
    CarID[giveplayerid] = GetPlayerVehicleID(playerid);
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " That player is not near you !");
    }
    }
    }
    else
    {
    SendClientMessage(playerid, COLOR_GREY, " Invalid ID/Name !");
    return 1;
    }
    }
    return 1;
    }


    /e: zeilen angefügt.