Beiträge von Audifire

    Ich habe jetzt Mad's VIlla genommen, habe die Häuser an 2 verschiedenen Punkten aber wenn ich bei Haus 1 rein gehe komm ich mit /exit bei Haus 2 wieder raus.
    Die VirtualWorlds funzen das hab ich schon getestet. Hier mal mein /exit;
    if(strcmp(cmd, "/exit", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    for(new i = 0; i < sizeof(HouseInfo); i++)
    {
    //printf("House :%d",i);
    if (PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
    {
    SetPlayerInterior(playerid,0);
    SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
    SetPlayerVirtualWorld(playerid, 0);
    PlayerInfo[playerid][pVirtualWorld] = 0;
    PlayerInfo[playerid][pInt] = 0;
    PlayerInfo[playerid][pLocal] = 255;
    if(HouseInfo[i][hHel] == 1)
    {
    new Float:tempheal;
    GetPlayerHealth(playerid,tempheal);
    if(tempheal < 100.0)
    {
    SetPlayerHealth(playerid,100.0);
    }
    }
    }
    }
    Bitte eine Korrektion reinstellen.

    Also ich habe das jetzt so: nimmt der da jetzt die Houseid???


    if(strcmp(cmd, "/enter", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    for(new i = 0; i < sizeof(HouseInfo); i++)
    {
    if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
    {
    //printf("Found House :%d",i);
    if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
    {
    new idx;
    while (idx < sizeof(HouseInfo))
    SetPlayerInterior(playerid,HouseInfo[i][hInt]);
    SetPlayerVirtualWorld(playerid,idx); // VirtualWorld = Hausid
    SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
    GameTextForPlayer(playerid, "~w~Willkommen Home", 5000, 1);
    PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
    PlayerInfo[playerid][pLocal] = i;
    }
    else
    {
    GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
    }
    }
    }

    Wie kann ich die Häüser in meiner property.cfg mit einer Virtual World eintragen.
    z.B. ich habe 2 Häuser aber die selbe einrichtung. Aber wenn ein anderer in das 1 Haus reingeht kommt er rein und wenn einer in das 2. Haus geht kommt man auch bei den 1. raus.
    Be mir sieht das so aus aber es funzt nicht:
    enum hInfo
    {
    Float:hEntrancex,
    Float:hEntrancey,
    Float:hEntrancez,
    Float:hExitx,
    Float:hExity,
    Float:hExitz,
    hHealthx,
    hHealthy,
    hHealthz,
    hArmourx,
    hArmoury,
    hArmourz,
    hOwner[MAX_PLAYER_NAME],
    hDiscription[MAX_PLAYER_NAME],
    hValue,
    hHel,
    hArm,
    hInt,
    hLock,
    hOwned,
    hRooms,
    hRent,
    hRentabil,
    hTakings,
    hVec,
    hVcol1,
    hVcol2,
    hDate,
    hLevel,
    hVirtualWorld,
    };


    new HouseInfo[35][hInfo];
    public LoadProperty()
    {
    new arrCoords[30][64];
    new strFromFile2[256];
    new File: file = fopen("property.cfg", io_read);
    if (file)
    {
    new idx;
    while (idx < sizeof(HouseInfo))
    {
    fread(file, strFromFile2);
    split(strFromFile2, arrCoords, ',');
    HouseInfo[idx][hEntrancex] = floatstr(arrCoords[0]);
    HouseInfo[idx][hEntrancey] = floatstr(arrCoords[1]);
    HouseInfo[idx][hEntrancez] = floatstr(arrCoords[2]);
    HouseInfo[idx][hExitx] = floatstr(arrCoords[3]);
    HouseInfo[idx][hExity] = floatstr(arrCoords[4]);
    HouseInfo[idx][hExitz] = floatstr(arrCoords[5]);
    HouseInfo[idx][hHealthx] = strval(arrCoords[6]);
    HouseInfo[idx][hHealthy] = strval(arrCoords[7]);
    HouseInfo[idx][hHealthz] = strval(arrCoords[8]);
    HouseInfo[idx][hArmourx] = strval(arrCoords[9]);
    HouseInfo[idx][hArmoury] = strval(arrCoords[10]);
    HouseInfo[idx][hArmourz] = strval(arrCoords[11]);
    //printf("HouseInfo hEntrancez %f",HouseInfo[idx][hEntrancez]);
    strmid(HouseInfo[idx][hOwner], arrCoords[12], 0, strlen(arrCoords[12]), 255);
    strmid(HouseInfo[idx][hDiscription], arrCoords[13], 0, strlen(arrCoords[13]), 255);
    HouseInfo[idx][hValue] = strval(arrCoords[14]);
    HouseInfo[idx][hHel] = strval(arrCoords[15]);
    HouseInfo[idx][hArm] = strval(arrCoords[16]);
    HouseInfo[idx][hInt] = strval(arrCoords[17]);
    HouseInfo[idx][hLock] = strval(arrCoords[18]);
    HouseInfo[idx][hOwned] = strval(arrCoords[19]);
    HouseInfo[idx][hRooms] = strval(arrCoords[20]);
    HouseInfo[idx][hRent] = strval(arrCoords[21]);
    HouseInfo[idx][hRentabil] = strval(arrCoords[22]);
    HouseInfo[idx][hTakings] = strval(arrCoords[23]);
    HouseInfo[idx][hVec] = strval(arrCoords[24]);
    if(HouseInfo[idx][hVec] == 457)
    {
    HouseInfo[idx][hVec] = 411;
    }
    HouseInfo[idx][hVcol1] = strval(arrCoords[25]);
    HouseInfo[idx][hVcol2] = strval(arrCoords[26]);
    HouseInfo[idx][hDate] = strval(arrCoords[27]);
    HouseInfo[idx][hLevel] = strval(arrCoords[28]);
    HouseInfo[idx][hVirtualWorld] = strval(arrCoords[29]);
    printf("HouseInfo:%d Owner:%s hTakings %d hVec %d",idx,HouseInfo[idx][hOwner],HouseInfo[idx][hTakings],HouseInfo[idx][hVec]);
    idx++;
    }
    fclose(file);
    }
    return 1;
    }

    if(strcmp(cmd, "/enter", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    for(new i = 0; i < sizeof(HouseInfo); i++)
    {
    if (PlayerToPoint(3, playerid,HouseInfo[i][hEntrancex], HouseInfo[i][hEntrancey], HouseInfo[i][hEntrancez]))
    {
    //printf("Found House :%d",i);
    if(PlayerInfo[playerid][pPhousekey] == i || HouseInfo[i][hLock] == 0)
    {
    SetPlayerVirtualWorld(playerid,HouseInfo[i][hVirtualWorld]);
    SetPlayerInterior(playerid,HouseInfo[i][hInt]);
    SetPlayerPos(playerid,HouseInfo[i][hExitx],HouseInfo[i][hExity],HouseInfo[i][hExitz]);
    GameTextForPlayer(playerid, "~w~Willkommen Home", 5000, 1);
    PlayerInfo[playerid][pVirtualWorld] = HouseInfo[idx][hVirtualWorld];
    PlayerInfo[playerid][pInt] = HouseInfo[i][hInt];
    PlayerInfo[playerid][pLocal] = i;
    }
    else
    {
    GameTextForPlayer(playerid, "~r~Locked", 5000, 1);
    }
    }
    }
    if(strcmp(cmd, "/exit", true) == 0)
    {
    if(IsPlayerConnected(playerid))
    {
    for(new i = 0; i < sizeof(HouseInfo); i++)
    {
    //printf("House :%d",i);
    if (PlayerToPoint(3, playerid,HouseInfo[i][hExitx], HouseInfo[i][hExity], HouseInfo[i][hExitz]))
    {
    SetPlayerInterior(playerid,0);
    SetPlayerPos(playerid,HouseInfo[i][hEntrancex],HouseInfo[i][hEntrancey],HouseInfo[i][hEntrancez]);
    PlayerInfo[playerid][pVirtualWorld] = 0;
    PlayerInfo[playerid][pInt] = 0;
    PlayerInfo[playerid][pLocal] = 255;
    if(HouseInfo[i][hHel] == 1)
    {
    new Float:tempheal;
    GetPlayerHealth(playerid,tempheal);
    if(tempheal < 100.0)
    {
    SetPlayerHealth(playerid,100.0);
    }
    }
    }
    }