how can i [House system]
#1

so I made a house system .
witch allow normal houses to buy
free houses to enter like ((Safe zone))
and I want in this code if is possible to make if player have [GC] Tag in name he can enter
if not send message (You are not in [GC] Clan please Leave the Building to prevent Shoots from anywhere)

pawn Код:
AddGCHouse(houseid, Float:iconX, Float:iconY, Float:iconZ, Float:interiorX, Float:interiorY, Float:interiorZ, Costa, Sella, Interiora, virtualworld)
{
    new house[256];
    format(house, sizeof(house), "Houses/houseid%d",houseid);
    if(!dini_Exists(house))
    {
        dini_Create(house);
        hInfo[houseid][Interior] = Interiora;
        dini_IntSet(house, "Interior", Interiora);
        dini_IntSet(house, "Virtualworld", virtualworld);
        hInfo[houseid][Virtualworld] = virtualworld;
        hInfo[houseid][InteriorX] = interiorX;
        hInfo[houseid][InteriorY] = interiorY;
        hInfo[houseid][InteriorZ] = interiorZ;
        dini_FloatSet(house, "X", interiorX);
        dini_FloatSet(house, "Y", interiorY);
        dini_FloatSet(house, "Z", interiorZ);
        print("-");
        print("--------------House Created--------------");
        printf("- Houseid: %d", houseid);
        printf("- Buy Cost: %d", Costa);
        printf("- Sell Cost: %d", Sella);
        printf("- Interior: %d", Interiora);
        printf("- VirtualWorld: %d", virtualworld);
        print("-----------------------------------------");
        print("-");
    }
    else
    {
        hInfo[houseid][Interior] = dini_Int(house, "Interior");
        hInfo[houseid][Locked] = dini_Int(house, "Locked");
        hInfo[houseid][InteriorX] = dini_Float(house, "X");
        hInfo[houseid][InteriorY] = dini_Float(house, "Y");
        hInfo[houseid][InteriorZ] = dini_Float(house, "Z");
        hInfo[houseid][Virtualworld] = dini_Int(house, "Virtualworld");
    }
    hInfo[houseid][iconx]=iconX;
    hInfo[houseid][icony]=iconY;
    hInfo[houseid][iconz]=iconZ;
    format(house, sizeof(house), "Houses/houseid%d",houseid);
    if(strcmp(hInfo[houseid][Name],"ForSale",true)==0)
    {
        HousePickup[houseid] = CreatePickup(1273, 23, iconX, iconY, iconZ);//not bought
    }
    else
    {
        HousePickup[houseid] = CreatePickup(1272,23, iconX, iconY, iconZ);//bought
    }
}
Reply
#2

Quote:

I made a house system

You made a house system and you don't know to do that little thing ?...

There we go anyway ..

Код HTML:
// whem player enter house or somethin'

new Name[32]; // new array 'Name'
GetPlayerName(playerid, Name, sizeof(Name); // Get name in array named Name

if(strfind(Name, "[GC]", true)) // Search for [GC] in his name.
{
    // Stuff
}
else
{
    // Another stuff..
}
Reply
#3

so shall I put this in CMD:enter ?
or what
im so confused now
I got all those stuff
pawn Код:
AddHouse(houseid, Float:iconX, Float:iconY, Float:iconZ, Float:interiorX, Float:interiorY, Float:interiorZ, Cost, Sell, Interior, Virtualworld);
AddSafeHouse(houseid, Float:iconX, Float:iconY, Float:iconZ, Float:interiorX, Float:interiorY, Float:interiorZ, Cost, Sell, Interior, Virtualworld);
AddGCHouse(houseid, Float:iconX, Float:iconY, Float:iconZ, Float:interiorX, Float:interiorY, Float:interiorZ, Cost, Sell, Interior, Virtualworld);
this is the cmd when you enter
pawn Код:
dcmd_enter(playerid,params[])
{
    #pragma unused params
    new str1[255],pname[24],housenumber;
    housenumber = GetHouseID(playerid);
    GetPlayerPos(playerid, housex, housey, housez);
    format(str1, sizeof(str1), "Houses/houseid%d", housenumber);
    GetPlayerName(playerid, pname, 24);
    if(hInfo[housenumber][Locked]==1) return SendClientMessage(playerid, c_r, "This house is locked!");
    playerworld[playerid] = GetPlayerVirtualWorld(playerid);
    SendClientMessage(playerid, c_y, "You entered the house!");
    SetPlayerVirtualWorld(playerid, hInfo[housenumber][Virtualworld]);
    SetPlayerInterior(playerid, hInfo[housenumber][Interior]);
    SetPlayerPos(playerid, hInfo[housenumber][InteriorX], hInfo[housenumber][InteriorY], hInfo[housenumber][InteriorZ]);
    playerinterior[playerid] = hInfo[housenumber][Interior];
    return 1;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)