When I type /exit, I am set the the last house on the Database.
#1

When I enter a house, it sets me into the interior. When I type /exit it sets me to the entrance of the last house on the database..... Except for the first....But the first house has a different interior to the rest and it works correctly. I'll show you the command I used to set the interior....

pawn Код:
CMD:sethouseint(playerid, params[])
{
    if(LoggedIn[playerid] == 0) return SendClientMessage(playerid, COLOUR_GREY, "You must be logged in to use this command.");
    if(AdminLevel[playerid] < 4) return SendClientMessage(playerid, COLOUR_GREY, "You are not authorized to use this command.");
    new id, intid, string[100];
    if(sscanf(params, "dd", id, intid)) return SendClientMessage(playerid, COLOUR_GREY, "Usage: /sethouseint [house id] [House Interior]");
    if(id < 1 || id > MAX_HOUSES) return SendClientMessage(playerid, COLOUR_GREY, "Invalid House ID.");

    if(intid == 1)
    {
        HouseIntX[id] = 1.6888;
        HouseIntY[id] = -3.2714;
        HouseIntZ[id] = 999.4284;
        HouseInt[id] = 2;
        MySQL_SetFloat(id, "HouseIntX", HouseIntX[id], "houses");
        MySQL_SetFloat(id, "HouseIntY", HouseIntY[id], "houses");
        MySQL_SetFloat(id, "HouseIntZ", HouseIntZ[id], "houses");
        MySQL_SetInteger(id, "HouseInt", 2, "houses");
        format(string, sizeof(string), "You have set house id: %d's Interior to 'Trailer'", id);
        SendClientMessage(playerid, COLOUR_WHITE, string);
    }
    if(intid == 2)
    {
        HouseIntX[id] = 2259.5920;
        HouseIntY[id] = -1135.8474;
        HouseIntZ[id] = 1050.6328;
        HouseInt[id] = 10;
        MySQL_SetFloat(id, "HouseIntX", HouseIntX[id], "houses");
        MySQL_SetFloat(id, "HouseIntY", HouseIntY[id], "houses");
        MySQL_SetFloat(id, "HouseIntZ", HouseIntZ[id], "houses");
        MySQL_SetInteger(id, "HouseInt", 10, "houses");
        format(string, sizeof(string), "You have set house id: %d's Interior to 'Medium Trailer.'", id);
        SendClientMessage(playerid, COLOUR_WHITE, string);
    }
    format(string, sizeof(string), "You changed house id %d's Interior.", id);
    SendClientMessage(playerid, COLOUR_LIGHTBLUE, string);
    return 1;
}


pawn Код:
CMD:enter(playerid, params[])
{
    for(new factionid=1;factionid<MAX_FACTIONS;factionid++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 5.0, FactionEntX[factionid], FactionEntY[factionid],FactionEntZ[factionid]))
        {
        SetPlayerPos(playerid, FactionIntX[factionid],FactionIntY[factionid],FactionIntZ[factionid]);
        SetPlayerInterior(playerid, FactionInt[factionid]);
        SetPlayerVirtualWorld(playerid, 0);
            }
        }
    if(IsPlayerInAnyVehicle(playerid) && Faction[playerid] == 3 && IsPlayerInRangeOfPoint(playerid, 5.0, 135.3096, 1955.0949, 19.4289))
        {
            new vehicleid = GetPlayerVehicleID(playerid);
            SetVehiclePos(vehicleid, 134.7745, 1934.1713, 19.2546);
            SetPlayerVirtualWorld(playerid, 0);
        }
    for(new houseid = 1; houseid < MAX_HOUSES; houseid++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 5.0, HouseEntX[houseid], HouseEntY[houseid],HouseEntZ[houseid]))
        {
        SetPlayerPos(playerid, HouseIntX[houseid],HouseIntY[houseid], HouseIntZ[houseid]);
        SetPlayerInterior(playerid, HouseInt[houseid]);
        SetPlayerVirtualWorld(playerid, 0);
            }
        }
   
    return 1;
}
    //IsPlayerInRangeOfPoint(playerid, 5.0, 135.3096, 1955.0949, 19.4289))
CMD:exit(playerid, params[])
{
    for(new factionid=1;factionid<MAX_FACTIONS;factionid++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 5.0, FactionIntX[factionid],FactionIntY[factionid],FactionIntZ[factionid]))
        {
        SetPlayerPos(playerid, FactionEntX[factionid],FactionEntY[factionid],FactionEntZ[factionid]);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
            }
        }
    if(IsPlayerInAnyVehicle(playerid) && IsPlayerInRangeOfPoint(playerid, 5.0, 134.7745, 1934.1713, 19.2546))
    {
        new vehicleid = GetPlayerVehicleID(playerid);
        SetVehiclePos(vehicleid, 135.3096, 1955.0949, 19.4289);
        SetPlayerVirtualWorld(playerid, 0);
        }
    for(new houseid=1;houseid<MAX_HOUSES;houseid++)
    {
    if(IsPlayerInRangeOfPoint(playerid, 5.0, HouseIntX[houseid],HouseIntY[houseid],HouseIntZ[houseid]))
        {
        SetPlayerPos(playerid, HouseEntX[houseid],HouseEntY[houseid],HouseEntZ[houseid]);
        SetPlayerInterior(playerid, 0);
        SetPlayerVirtualWorld(playerid, 0);
            }
        }
    return 1;
}
Reply


Messages In This Thread
When I type /exit, I am set the the last house on the Database. - by Dokins - 10.12.2011, 16:48
Re: When I type /exit, I am set the the last house on the Database. - by Dark_Kostas - 10.12.2011, 16:55

Forum Jump:


Users browsing this thread: 2 Guest(s)