[Pomoc] Pravljenje kuca,stanova ingame

Započeo [MCRP]Stander, Avgust 22, 2012, 17:22:06 POSLE PODNE

prethodna tema - sledeća tema

0 članova i 1 gost pregledaju ovu temu.

Ovako imam ovu funkciju da pravim ingame te stvari,ali problem je u tome sto to moze raditi i obican igrac,a trebalo bi da moze samo ADMIN 1338,unaprijed hvala.
Evo kod(valjda je ovaj),ako neko zna da ispravi gdje je greska:


CMD:vila(playerid, params[])
{
    new string[128];
    new NewHouseID = SpawnedHouses+1;

    GetPlayerPos(playerid, Houses[NewHouseID][hExteriorX], Houses[NewHouseID][hExteriorY], Houses[NewHouseID][hExteriorZ]);

    PlayerInfo[playerid][pHouseExterior]++;

    format( string, sizeof( string ), "Exterijer postavljen (X: %f, Y: %f, Z: %f).", Houses[NewHouseID][hExteriorX], Houses[NewHouseID][hExteriorY], Houses[NewHouseID][hExteriorZ]);
    SendClientMessage( playerid, WHITE, string);
    GetPlayerPos(playerid, Houses[NewHouseID][hInteriorX], Houses[NewHouseID][hInteriorY], Houses[NewHouseID][hInteriorZ]);

    PlayerInfo[playerid][pHouseInterior]++;

    Houses[NewHouseID][hInteriorID] = GetPlayerInterior( playerid );

    format( string, sizeof( string ), "interijer postavljen! (X: %f, Y: %f, Z: %f).",Houses[NewHouseID][hInteriorX], Houses[NewHouseID][hInteriorY], Houses[NewHouseID][hInteriorZ]);
    SendClientMessage( playerid, WHITE, string);

    if(NewHouseID >= MAX_HOUSES) {
        SendClientMessage( playerid, WHITE, "Vec ima previse kuca!" );
    }
    else {
        format( string, sizeof( string ), "Houses/House_%d.ini", NewHouseID);

        if(!fexist( string) ) {
            new id;
            SpawnedHouses++;
            Houses[NewHouseID][HousePrice] = 350000;
            Houses[NewHouseID][hLevel] = 10;
            strmid(Houses[NewHouseID][hOpis], "Vila", 0, strlen("Vila"), 255);
            Houses[NewHouseID][hVec] = 418;
            Houses[NewHouseID][hType] = 4;
            Houses[NewHouseID][hOwned] = 0;
            format(Houses[NewHouseID][hOwner], 255, "Niko" );
            Houses[NewHouseID][LockStatus] = 0;
            Houses[NewHouseID][HPickupID] = AddStaticPickup(1273, 1, Houses[NewHouseID][hExteriorX], Houses[NewHouseID][hExteriorY], Houses[NewHouseID][hExteriorZ]);

            dini_Create( string);
            dini_IntSet( string, "InteriorID", Houses[NewHouseID][hInteriorID]);
            dini_FloatSet( string, "InteriorX", Houses[NewHouseID][hInteriorX]);
            dini_FloatSet( string, "InteriorY", Houses[NewHouseID][hInteriorY]);
            dini_FloatSet( string, "InteriorZ", Houses[NewHouseID][hInteriorZ]);

            dini_IntSet( string, "HousePrice", 350000 );

            dini_IntSet( string, "ExteriorID", 0 );
            dini_FloatSet( string, "ExteriorX", Houses[NewHouseID][hExteriorX]);
            dini_FloatSet( string, "ExteriorY", Houses[NewHouseID][hExteriorY]);
            dini_FloatSet( string, "ExteriorZ", Houses[NewHouseID][hExteriorZ]);

            dini_IntSet( string, "VaultMoney", -1);

            dini_IntSet( string, "HouseCocaine", -1);
            dini_IntSet( string, "HousePot", -1);
            dini_IntSet( string, "HouseMaterials", -1);

            dini_Set( string, "Owner", "Niko" );
            dini_IntSet(string, "Level", 10);

            dini_IntSet( string, "LockStatus", Houses[NewHouseID][LockStatus]);
            dini_IntSet( string, "hVec", Houses[NewHouseID][hVec]);
            dini_IntSet( string, "hVcol1", Houses[NewHouseID][hVcol1]);
            dini_IntSet( string, "hVcol2", Houses[NewHouseID][hVcol2]);
            dini_Set( string, "Addres", Houses[NewHouseID][hAddres]);
            dini_Set( string, "Opis", Houses[NewHouseID][hOpis]);
            dini_IntSet( string, "Owned", Houses[NewHouseID][hOwned]);
            PlayerInfo[playerid][pHouseExterior]--;
            PlayerInfo[playerid][pHouseInterior]--;
            OnPropTextdrawUpdate(1,id);
            format(string, sizeof(string), "Uspjesno postavljena kuca | ID: %i",NewHouseID);
            SendClientMessage(playerid, WHITE, string);
            return 1;
        }
    }
    return 1;
}

Nisi postavio po pravilima ali ajde evo ti,evo ti pa procitaj http://balkan-samp.com/forum/index.php?topic=11453.0CMD:vila(playerid, params[])
{
if(PlayerInfo[playerid][pAdmin] >= 1338)
{
    new string[128];
    new NewHouseID = SpawnedHouses+1;

    GetPlayerPos(playerid, Houses[NewHouseID][hExteriorX], Houses[NewHouseID][hExteriorY], Houses[NewHouseID][hExteriorZ]);

    PlayerInfo[playerid][pHouseExterior]++;

    format( string, sizeof( string ), "Exterijer postavljen (X: %f, Y: %f, Z: %f).", Houses[NewHouseID][hExteriorX], Houses[NewHouseID][hExteriorY], Houses[NewHouseID][hExteriorZ]);
    SendClientMessage( playerid, WHITE, string);
    GetPlayerPos(playerid, Houses[NewHouseID][hInteriorX], Houses[NewHouseID][hInteriorY], Houses[NewHouseID][hInteriorZ]);

    PlayerInfo[playerid][pHouseInterior]++;

    Houses[NewHouseID][hInteriorID] = GetPlayerInterior( playerid );

    format( string, sizeof( string ), "interijer postavljen! (X: %f, Y: %f, Z: %f).",Houses[NewHouseID][hInteriorX], Houses[NewHouseID][hInteriorY], Houses[NewHouseID][hInteriorZ]);
    SendClientMessage( playerid, WHITE, string);

    if(NewHouseID >= MAX_HOUSES) {
        SendClientMessage( playerid, WHITE, "Vec ima previse kuca!" );
    }
    else {
        format( string, sizeof( string ), "Houses/House_%d.ini", NewHouseID);

        if(!fexist( string) ) {
            new id;
            SpawnedHouses++;
            Houses[NewHouseID][HousePrice] = 350000;
            Houses[NewHouseID][hLevel] = 10;
            strmid(Houses[NewHouseID][hOpis], "Vila", 0, strlen("Vila"), 255);
            Houses[NewHouseID][hVec] = 418;
            Houses[NewHouseID][hType] = 4;
            Houses[NewHouseID][hOwned] = 0;
            format(Houses[NewHouseID][hOwner], 255, "Niko" );
            Houses[NewHouseID][LockStatus] = 0;
            Houses[NewHouseID][HPickupID] = AddStaticPickup(1273, 1, Houses[NewHouseID][hExteriorX], Houses[NewHouseID][hExteriorY], Houses[NewHouseID][hExteriorZ]);

            dini_Create( string);
            dini_IntSet( string, "InteriorID", Houses[NewHouseID][hInteriorID]);
            dini_FloatSet( string, "InteriorX", Houses[NewHouseID][hInteriorX]);
            dini_FloatSet( string, "InteriorY", Houses[NewHouseID][hInteriorY]);
            dini_FloatSet( string, "InteriorZ", Houses[NewHouseID][hInteriorZ]);

            dini_IntSet( string, "HousePrice", 350000 );

            dini_IntSet( string, "ExteriorID", 0 );
            dini_FloatSet( string, "ExteriorX", Houses[NewHouseID][hExteriorX]);
            dini_FloatSet( string, "ExteriorY", Houses[NewHouseID][hExteriorY]);
            dini_FloatSet( string, "ExteriorZ", Houses[NewHouseID][hExteriorZ]);

            dini_IntSet( string, "VaultMoney", -1);

            dini_IntSet( string, "HouseCocaine", -1);
            dini_IntSet( string, "HousePot", -1);
            dini_IntSet( string, "HouseMaterials", -1);

            dini_Set( string, "Owner", "Niko" );
            dini_IntSet(string, "Level", 10);

            dini_IntSet( string, "LockStatus", Houses[NewHouseID][LockStatus]);
            dini_IntSet( string, "hVec", Houses[NewHouseID][hVec]);
            dini_IntSet( string, "hVcol1", Houses[NewHouseID][hVcol1]);
            dini_IntSet( string, "hVcol2", Houses[NewHouseID][hVcol2]);
            dini_Set( string, "Addres", Houses[NewHouseID][hAddres]);
            dini_Set( string, "Opis", Houses[NewHouseID][hOpis]);
            dini_IntSet( string, "Owned", Houses[NewHouseID][hOwned]);
            PlayerInfo[playerid][pHouseExterior]--;
            PlayerInfo[playerid][pHouseInterior]--;
            OnPropTextdrawUpdate(1,id);
            format(string, sizeof(string), "Uspesno postavljena kuca | ID: %i",NewHouseID);
            SendClientMessage(playerid, WHITE, string);
            return 1;
        }
      }
    }
    return 1;
}

koristi sledeci format:
Skripta koju koristim:
Detaljan opis problema:
Dio skripte:
Neke slike/video za lakse dobivanje pomoci(neobavezno):