Beiträge von Jeffro Hernandez

    Hallo Liebe Sampler,
    Ich breuchte mal eure Hilfe. unzwar habe ich die frage wie erstellt man einen Textdraw ?
    Und was benötige ich dafür. Bitte erklärt das genau. Dancke im Vorraus



    Ps. Ja ich weiß habe mir heute viel vor genommen.

    Oooooo Wie sied dein Script aus ?
    Meine güde liebt ihr alle nicht euer Script ? Wiso ferkellt ihr alles einfach immer so hinn.
    da ist keine struktur drinne und nix. mal schaun wenn ich nacher lust habe rücke ich dir den Kramm mal bisel zurecht. :D

    Hallo Liebe sampler ich benötige eine übersetzung von Englisch auf Deutsch da ich kein Englisch kann :(
    als Gegenleistung werde ich euch in den Credits erwähnen.


    Dieses Tut pls übersetzen.


    [TUT]Creating Simple Buyable Houses!


    Well, I'm really bored right now so I thought I would make a long tutorial on how to make buyable houses using dini.
    First, we have to make all the boring defines


    #define MAX_HOUSES 200


    Defines the max houses which we will need for a loop later on, you can change the 200 limit.


    enum houseinfo
    {
    HouseNames[60], //To save into the file
    HouseCost, //The house cost
    HouseOwner[24], // The house owners Name
    Float:PickupX, // PickupX
    Float:PickupY, //PickupY
    Float:PickupZ, //PickupZ
    Float:TeleX, //The house location
    Float:TeleY, //The house location
    Float:TeleZ, //The house location
    Interior, //The house Interior
    HouseSell, //House sell price
    Owned, //1 if the house is owned, 0 if it isn't
    Virtual// The virtual world set when you enter a house so you can have multiple houses with the same interior.
    }


    new HouseInfo[MAX_HOUSES][houseinfo]; //It saves all the info in this variable.
    new HouseCount = -1; //House count
    new PickupID[MAX_HOUSES]; //The pickup ID's
    new InHouse[MAX_PLAYERS] = -1; // Checks if the player is in the house for a /exit command :)


    OK, now that we got all those defines out of the way, time to create the houses!


    stock CreateHouse(Filename[], Cost, Float:Pickupx, Float:Pickupy, Float:Pickupz, Float:Telex, Float:Teley, Float:Telez, interior, sell)
    {
    return 1;
    }


    FileName - The filename which the house will save as.
    Cost - The cost of the house
    Pickupx - The X location of the pickup infront of the house
    Pickupy - The Y location of the pickup infront of the house
    Pickupz - The Z location of the pickup infront of the house
    Telex - The X location that you tele into the house
    Teley - The Y location that you tele into the house
    Telez - The Z location that you tele into the house
    interior - The Interior that you tele into the house
    sell - The sale price of the house


    Formats the file name to check if the file exists or not (For saving).
    It will save into your scriptfiles directory under Owners.ini.


    stock CreateHouse(Filename[], Cost, Float:Pickupx, Float:Pickupy, Float:Pickupz, Float:Telex, Float:Teley, Float:Telez, interior, sell)
    {
    new file[55];
    format(file, sizeof(file), "Owners.ini", Filename);
    return 1;
    }


    Saved all the variables and created the pickup. That part is now done.


    stock CreateHouse(Filename[], Cost, Float:Pickupx, Float:Pickupy, Float:Pickupz, Float:Telex, Float:Teley, Float:Telez, interior, sell)
    {
    if(!dini_Exists("Owners.ini"))
    {
    dini_Create("Owners.ini");
    }
    HouseCount ++;
    new ID = HouseCount; //HouseID
    format(HouseInfo[ID][HouseNames], 60, "%s", Filename); //Saves the HouseName into a variable
    HouseInfo[ID][HouseCost] = Cost;
    HouseInfo[ID][PickupX] = Pickupx;
    HouseInfo[ID][Virtual] = 2000000 + ID;
    HouseInfo[ID][PickupY] = Pickupy;
    HouseInfo[ID][PickupZ] = Pickupz;
    HouseInfo[ID][TeleX] = Telex;
    HouseInfo[ID][TeleY] = Teley;
    HouseInfo[ID][TeleZ] = Telez;
    HouseInfo[ID][Interior] = interior;
    HouseInfo[ID][HouseSell] = sell;
    format(HouseInfo[ID][HouseOwner], 24, "gj9043jg-er((23");
    if(strlen(dini_Get("Owners.ini", Filename))) //This is to see if there is any owner.
    {
    format(HouseInfo[ID][HouseOwner], 24, "%s", dini_Get("Owners.ini", Filename));
    HouseInfo[ID][Owned] = 1;
    }
    PickupID[ID] = CreatePickup(1273, 23, Pickupx, Pickupy, Pickupz, -1); //Creates the pickup :).
    Create3DTextLabel("House", 0x00A0F6AA, Pickupx, Pickupy, Pickupz + 0.75, 15.0, 0, 1);
    }
    }


    This checks if the pickup is one of the house ones.


    public OnPlayerPickUpPickup(playerid, pickupid) //Pickup callback
    {
    for(new J; J<MAX_HOUSES; J++) //Loops through all houses
    {
    if(pickupid == PickupID[J]) //If the pickupid is one of our house ones
    {
    }
    }
    return 1;
    }


    Now for the part where we decide what happens when the player picks up that pickup.


    public OnPlayerPickUpPickup(playerid, pickupid) //Pickup callback
    {
    for(new J; J<MAX_HOUSES; J++) //Loops through all houses
    {
    if(pickupid == PickupID[J]) //If the pickupid is one of our house ones
    {
    new str[75];
    if(HouseInfo[J][Owned] == 1)
    {
    format(str, sizeof(str), "~r~House Info~n~~g~Owner: ~w~%s", HouseInfo[J][HouseOwner]);
    }
    if(HouseInfo[J][Owned] == 0)
    {
    format(str, sizeof(str), "~r~House Info~n~~g~Owner: ~w~Nobody");
    SendClientMessage(playerid, 0x67F6F6AA, "This house is up for sale! Type /buy to buy it");
    }
    new str2[100];
    format(str2, sizeof(str2), "~g~Cost price:~w~ %d ~n~~g~Sell Price:~w~ %d", HouseInfo[J][HouseCost], HouseInfo[J][HouseSell]);
    new str3[150];
    format(str3, sizeof(str3), "%s~n~%s", str, str2);
    GameTextForPlayer(playerid, str3, 3500, 3);
    return 1;
    }
    }
    return 1;
    }


    Now that all that is out of the way, we need a buy and sell command!


    The /buy command and the /sell command!


    public OnPlayerCommandText(playerid, cmdtext)
    {
    if (strcmp("/buy", cmdtext, true, 10) == 0)
    {
    for(new i; i<MAX_HOUSES; i++)
    {
    if(!IsPlayerInRangeOfPoint(playerid, 3, HouseInfo[i][PickupX], HouseInfo[i][PickupY], HouseInfo[i][PickupZ])) continue;

    new Pname[24]; GetPlayerName(playerid, Pname, 24);
    for(new S; S<MAX_HOUSES; S++)
    {
    if(!strcmp(dini_Get("Owned.ini", HouseInfo[S][HouseNames]), Pname)) return SendClientMessage(playerid, 0xF60000AA, "You already have a house!");
    }
    if(GetPlayerMoney(playerid) < HouseInfo[i][HouseCost]) return SendClientMessage(playerid, 0xF60000AA, "You don't have enough money to buy this house");
    if(HouseInfo[i][Owned] == 1) return SendClientMessage(playerid, 0xF60000AA, "This house is already owned!");
    GivePlayerMoney(playerid, - HouseInfo[i][HouseCost]);
    GameTextForPlayer(playerid, "~r~House Purchased!", 2000, 3);
    HouseInfo[i][Owned] = 1;
    GetPlayerName(playerid, Pname, 24);
    format(HouseInfo[i][HouseOwner], 24, "%s", Pname);
    dini_Set("Owners.ini", HouseInfo[i][HouseNames], Pname);
    return 1;
    }
    SendClientMessage(playerid, 0xF60000AA, "You are not close enough to a house");
    return 1;
    }
    if (strcmp("/sell", cmdtext, true, 10) == 0)
    {
    for(new i; i<MAX_HOUSES; i++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 3, HouseInfo[i][PickupX], HouseInfo[i][PickupY], HouseInfo[i][PickupZ]))
    {
    new Pname[24]; GetPlayerName(playerid, Pname, 24);
    if(strcmp(Pname, HouseInfo[i][HouseOwner])) return SendClientMessage(playerid, 0xF60000AA, "You don't own this house!");
    GivePlayerMoney(playerid, HouseInfo[i][HouseSell]);
    GameTextForPlayer(playerid, "~r~House Sold!", 2000, 3);
    HouseInfo[i][Owned] = 0;
    format(HouseInfo[i][HouseOwner], 24, "0943jt3u9*egjlfd");
    dini_Unset("Owners.ini", HouseInfo[i][HouseNames]);
    return 1;
    }
    }
    SendClientMessage(playerid, 0xF60000AA, "You are not close enough to a house");
    return 1;
    }
    return 0;
    }


    Now lastly, the /enter and /exit commands!


    public OnPlayerCommandText(playerid, cmdtext)
    {
    if (strcmp("/enter", cmdtext, true, 10) == 0)
    {
    for(new i; i<MAX_HOUSES; i++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 3, HouseInfo[i][PickupX], HouseInfo[i][PickupY], HouseInfo[i][PickupZ]))
    {
    new Pname[24]; GetPlayerName(playerid, Pname, 24);
    if(strcmp(Pname, HouseInfo[i][HouseOwner])) return SendClientMessage(playerid, 0xF60000AA, "You don't own this house!");
    SetPlayerPos(playerid, HouseInfo[i][TeleX], HouseInfo[i][TeleY], HouseInfo[i][TeleZ]);
    SetPlayerInterior(playerid, HouseInfo[i][Interior]);
    InHouse[playerid] = i;
    SetPlayerVirtualWorld(playerid, HouseInfo[i][Virtual]);
    SendClientMessage(playerid, 0x00C4F6AA, "You have entered your house");
    return 1;
    }
    }
    SendClientMessage(playerid, 0xF60000AA, "You are not close enough to a house");
    return 1;
    }
    if (strcmp("/exit", cmdtext, true, 10) == 0)
    {
    if(InHouse[playerid] == -1) return SendClientMessage(playerid, 0xF60000AA, "You are not in a house");
    SetPlayerPos(playerid, HouseInfo[InHouse[playerid]][PickupX], HouseInfo[InHouse[playerid]][PickupY], HouseInfo[InHouse[playerid]][PickupZ]);
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 0);
    SendClientMessage(playerid, 0x00C4F6AA, "You have exited your house");
    InHouse[playerid] = -1;
    return 1;
    }


    So overall your script should look like this (I really don't care if you use exactly this):


    #include <a_samp>
    #include <dini>
    #define MAX_HOUSES 200
    #pragma unused strtok


    enum houseinfo
    {
    HouseNames[60], //To save into the file
    HouseCost, //The house cost
    HouseOwner[24], // The house owners Name
    Float:PickupX, // PickupX
    Float:PickupY, //PickupY
    Float:PickupZ, //PickupZ
    Float:TeleX, //The house location
    Float:TeleY, //The house location
    Float:TeleZ, //The house location
    Interior, //The house Interior
    HouseSell, //House sell price
    Owned,
    Virtual
    }


    new HouseInfo[MAX_HOUSES][houseinfo]; //It saves all the info in this variable.
    new HouseCount = -1; //House count
    new PickupID[MAX_HOUSES];
    new InHouse[MAX_PLAYERS] = -1;


    stock CreateHouse(Filename[], Cost, Float:Pickupx, Float:Pickupy, Float:Pickupz, Float:Telex, Float:Teley, Float:Telez, interior, sell)
    {
    if(!dini_Exists("Owners.ini"))
    {
    dini_Create("Owners.ini");
    }
    HouseCount ++;
    new ID = HouseCount; //HouseID
    format(HouseInfo[ID][HouseNames], 60, "%s", Filename); //Saves the HouseName into a variable
    HouseInfo[ID][HouseCost] = Cost;
    HouseInfo[ID][PickupX] = Pickupx;
    HouseInfo[ID][Virtual] = 2000000 + ID;
    HouseInfo[ID][PickupY] = Pickupy;
    HouseInfo[ID][PickupZ] = Pickupz;
    HouseInfo[ID][TeleX] = Telex;
    HouseInfo[ID][TeleY] = Teley;
    HouseInfo[ID][TeleZ] = Telez;
    HouseInfo[ID][Interior] = interior;
    HouseInfo[ID][HouseSell] = sell;
    format(HouseInfo[ID][HouseOwner], 24, "gj9043jg-er((23");
    if(strlen(dini_Get("Owners.ini", Filename))) //This is to see if there is any owner.
    {
    format(HouseInfo[ID][HouseOwner], 24, "%s", dini_Get("Owners.ini", Filename));
    HouseInfo[ID][Owned] = 1;
    }
    PickupID[ID] = CreatePickup(1273, 23, Pickupx, Pickupy, Pickupz, -1); //Creates the pickup :).
    Create3DTextLabel("House", 0x00A0F6AA, Pickupx, Pickupy, Pickupz + 0.75, 15.0, 0, 1);
    }


    public OnPlayerPickUpPickup(playerid, pickupid) //Pickup callback
    {
    for(new J; J<MAX_HOUSES; J++) //Loops through all houses
    {
    if(pickupid == PickupID[J]) //If the pickupid is one of our house ones
    {
    new str[75];
    if(HouseInfo[J][Owned] == 1)
    {
    format(str, sizeof(str), "~r~House Info~n~~g~Owner: ~w~%s", HouseInfo[J][HouseOwner]);
    }
    if(HouseInfo[J][Owned] == 0)
    {
    format(str, sizeof(str), "~r~House Info~n~~g~Owner: ~w~Nobody");
    SendClientMessage(playerid, 0x67F6F6AA, "This house is up for sale! Type /buy to buy it");
    }
    new str2[100];
    format(str2, sizeof(str2), "~g~Cost price:~w~ %d ~n~~g~Sell Price:~w~ %d", HouseInfo[J][HouseCost], HouseInfo[J][HouseSell]);
    new str3[175];
    format(str3, sizeof(str3), "%s~n~%s", str, str2);
    GameTextForPlayer(playerid, str3, 3500, 3);
    return 1;
    }
    }
    return 1;
    }
    public OnPlayerCommandText(playerid, cmdtext[])
    {
    public OnPlayerCommandText(playerid, cmdtext)
    {
    if (strcmp("/buy", cmdtext, true, 10) == 0)
    {
    for(new i; i<MAX_HOUSES; i++)
    {
    if(!IsPlayerInRangeOfPoint(playerid, 3, HouseInfo[i][PickupX], HouseInfo[i][PickupY], HouseInfo[i][PickupZ])) continue;

    new Pname[24]; GetPlayerName(playerid, Pname, 24);
    for(new S; S<MAX_HOUSES; S++)
    {
    if(!strcmp(dini_Get("Owned.ini", HouseInfo[S][HouseNames]), Pname)) return SendClientMessage(playerid, 0xF60000AA, "You already have a house!");
    }
    if(GetPlayerMoney(playerid) < HouseInfo[i][HouseCost]) return SendClientMessage(playerid, 0xF60000AA, "You don't have enough money to buy this house");
    if(HouseInfo[i][Owned] == 1) return SendClientMessage(playerid, 0xF60000AA, "This house is already owned!");
    GivePlayerMoney(playerid, - HouseInfo[i][HouseCost]);
    GameTextForPlayer(playerid, "~r~House Purchased!", 2000, 3);
    HouseInfo[i][Owned] = 1;
    GetPlayerName(playerid, Pname, 24);
    format(HouseInfo[i][HouseOwner], 24, "%s", Pname);
    dini_Set("Owners.ini", HouseInfo[i][HouseNames], Pname);
    return 1;
    }
    SendClientMessage(playerid, 0xF60000AA, "You are not close enough to a house");
    return 1;
    }
    if (strcmp("/sell", cmdtext, true, 10) == 0)
    {
    for(new i; i<MAX_HOUSES; i++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 3, HouseInfo[i][PickupX], HouseInfo[i][PickupY], HouseInfo[i][PickupZ]))
    {
    new Pname[24]; GetPlayerName(playerid, Pname, 24);
    if(strcmp(Pname, HouseInfo[i][HouseOwner])) return SendClientMessage(playerid, 0xF60000AA, "You don't own this house!");
    GivePlayerMoney(playerid, HouseInfo[i][HouseSell]);
    GameTextForPlayer(playerid, "~r~House Sold!", 2000, 3);
    HouseInfo[i][Owned] = 0;
    format(HouseInfo[i][HouseOwner], 24, "0943jt3u9*egjlfd");
    dini_Unset("Owners.ini", HouseInfo[i][HouseNames]);
    return 1;
    }
    }
    SendClientMessage(playerid, 0xF60000AA, "You are not close enough to a house");
    return 1;
    }
    if (strcmp("/enter", cmdtext, true, 10) == 0)
    {
    for(new i; i<MAX_HOUSES; i++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 3, HouseInfo[i][PickupX], HouseInfo[i][PickupY], HouseInfo[i][PickupZ]))
    {
    new Pname[24]; GetPlayerName(playerid, Pname, 24);
    if(strcmp(Pname, HouseInfo[i][HouseOwner])) return SendClientMessage(playerid, 0xF60000AA, "You don't own this house!");
    SetPlayerPos(playerid, HouseInfo[i][TeleX], HouseInfo[i][TeleY], HouseInfo[i][TeleZ]);
    SetPlayerInterior(playerid, HouseInfo[i][Interior]);
    InHouse[playerid] = i;
    SetPlayerVirtualWorld(playerid, HouseInfo[i][Virtual]);
    SendClientMessage(playerid, 0x00C4F6AA, "You have entered your house");
    return 1;
    }
    }
    SendClientMessage(playerid, 0xF60000AA, "You are not close enough to a house");
    return 1;
    }
    if (strcmp("/exit", cmdtext, true, 10) == 0)
    {
    if(InHouse[playerid] == -1) return SendClientMessage(playerid, 0xF60000AA, "You are not in a house");
    SetPlayerPos(playerid, HouseInfo[InHouse[playerid]][PickupX], HouseInfo[InHouse[playerid]][PickupY], HouseInfo[InHouse[playerid]][PickupZ]);
    SetPlayerInterior(playerid, 0);
    SetPlayerVirtualWorld(playerid, 0);
    SendClientMessage(playerid, 0x00C4F6AA, "You have exited your house");
    InHouse[playerid] = -1;
    return 1;
    }
    return 0;
    }


    I've tested it and it works 100 percent for me, please inform me about any errors in the script so I can update this tutorial.




    Here are some example houses:



    CreateHouse("TestHouse1", 1, 2317.130615, 692.398498, 11.460937, 266.857757, 305.001586, 999.148437, 2, 1);
    CreateHouse("TestHouse2", 1, 2346.872802, 692.999267, 11.460937, 266.857757, 305.001586, 999.148437, 2, 1);
    CreateHouse("TestHouse3", 1, 2396.482666, 691.487060, 11.453125, 2196.850341, -1204.343261, 1049.023437, 6, 1);
    CreateHouse("TestHouse4", 1, 2398.476074, 735.344665, 11.460937, 2196.850341, -1204.343261, 1049.023437, 6, 1);
    CreateHouse("TestHouse5", 1, 2368.863525, 733.627502, 11.460937, 2196.850341, -1204.343261, 1049.023437, 6, 1);
    CreateHouse("TestHouse6", 1, 2013.253906, 731.041870, 11.453125, 266.857757, 305.001586, 999.148437, 5, 1);
    CreateHouse("TestHouse7", 1, 2449.826660, 742.588806, 11.460937, 266.857757, 305.001586, 999.148437, 5, 1);
    CreateHouse("TestHouse8", 1, 2449.662353, 714.210693, 11.468292, 266.857757, 305.001586, 999.148437, 5, 1);


    They are located in south LV .




    Here is the example filterscript: http://thekiller.pastebin.com/ff793d52

    Ich kapiere nur Bahnhof :wacko:
    Also noch mal in kla Text also ich habe alle Läden zugänglich gemacht und möchte in den Interiors ein Maker haben an dem ich Essen bestellen kann. So also in die Läden komme ich reihn aber es ist kein Maker da um etwas zu bestellen.
    Und so habe ich die zugänglich gemacht.


    1.)new BsnenterTemple;
    new BsnexitTemple;


    2.) Bei public OnGameModeInit()
    BsnexitTemple=CreatePickup(1559,23,362.8914,-75.1857,1001.5078);
    BsnenterTemple=CreatePickup(1559,23,1199.2013,-918.1477,43.1235);
    Create3DTextLabel("Burger Shot Temple\n Eingang",Blau,1199.2013,-918.1477,43.1235,20,0);
    Create3DTextLabel("Burger Shot Temple\n Ausgang",Blau,362.8914,-75.1857,1001.5078,20,0);


    3.) Bei public OnPlayerPickUpPickup(playerid, pickupid)
    if(pickupid==BsnenterTemple)
    {
    SetPlayerPos(playerid,364.0990,-73.7360,1001.5078);
    SetPlayerFacingAngle(playerid,316.4602);
    SetCameraBehindPlayer(playerid);
    SetPlayerInterior(playerid,10);
    GameTextForPlayer(playerid,"~y~Herzlich Willkommen ~n~~y~im Burger Shot Temple.",4500,4);
    }
    if(pickupid==BsnexitTemple)
    {
    SetPlayerPos(playerid,1199.6311,-920.1727,43.1094);
    SetPlayerFacingAngle(playerid,190.4104);
    SetCameraBehindPlayer(playerid);
    SetPlayerInterior(playerid,0);
    GameTextForPlayer(playerid,"~y~Vielen Dank das sie uns besucht haben. ~n~~y~Besuchen sie uns bald wieder",4500,4);
    }


    So und so habe ich jeden 1zelnen Laden gemacht.
    Nun schreibst du mir gerade ich soll bei
    public OnPlayerPickUpPickup(playerid, pickupid)
    {
    switch(pickupid)
    {
    case DEINPICKUPNAME:
    {
    ShowPlayerDialog(playerid, DEINDIALOGNAME, DIALOG_STYLE_LIST, "Speisekarte", "Bitte wählen Sie eine Bestellung", "Hamburger\nCheesburger\nChickenburger\nPommes Frites\nChicken McNuggets", "Bestellen", "Abbrechen");


    machen. Aber wie also wie Integriere ich as zeug ?
    Und muss ich das bei jedem 1zelnen laden machen ?

    Hallo Liebe Sampler,


    Ich habe ein kleines Problem.
    Unzwar habe ich alle Fast Fod läden zugänglich gemacht.
    Nun möchte ich aber zb im Bsn einen Maker haben um mir Essen zu bestellen.
    Den immoment kann man nur reingehen aber nichts bestellen.
    Wäre echt suppi wenn ihr mir helfen könntet bzw ein beispil macht.

    Hallo Liebe Comunity,
    Ich habe mir gerade von MiniYoda den Gamemode heruntergeladen.
    Ich habe es mir angeschaut und mir wurde kla das ich in diesem Script keine Chongse habe den Überblick zu behalten.
    Das Script Gehört MiniYoda und hat 26820 Zeilen !!!


    Ich würde gerne das Script Complet löschen bis auf sein Adminsystem.
    Nun stellt sich die frage DARF ICH DAS OHNE LIZENZ ? und wenn ja könnte mir das einer machen ?
    Denn ich komm in dem Script nicht kla ;( natürlich werde ich drozdem Miniyodas Credits drinne lassen weil ja das Adminsystem auch von ihm ist und eure werde ich ebenfalls mit rein tuhn als gegenleistung.