01.01.2011, 10:54
Hi
I'm trying to make dynamic house system.
I'm using dini for saving and loading houses, and every house have a one file.
But my command for adding houses doesn't work:
I type /malakuca and get response Koristite: /malakuca [ID interijera (1-], because no params.
But if I type /malakuca 1 (or any else number) i get message SERVER: Unknown command.
Where is mistake!?
I'm trying to make dynamic house system.
I'm using dini for saving and loading houses, and every house have a one file.
But my command for adding houses doesn't work:
pawn Code:
if(strcmp(cmd, "/malakuca", true) == 0)
{
if(PlayerInfo[playerid][pAdmin] >= 6 || IsPlayerAdmin(playerid))
{
new x_nr[20];
x_nr = strtok(cmdtext, idx);
if(!strlen(x_nr))
{
SendClientMessage(playerid, COLOR_GRAD2, "Koristite: /malakuca [ID interijera (1-8)]");
return 1;
}
new idkuce = 1;
new Float:X, Float:Y, Float:Z;
new Fajl[64];
new string2[128];
GetPlayerPos(playerid, X, Y, Z);
for(new kuca = 1; kuca < sizeof(HouseInfo); kuca++)
{
format(Fajl, sizeof(Fajl), "Kuce/%d.ini", kuca);
if(dini_Exists(Fajl))
{
idkuce++;
}
}
new str1[32];
format(str1, sizeof str1, "Kuce/%d.ini", idkuce);
dini_Create(str1);
if(strcmp(x_nr,"1",true) == 0)
{
HouseInfo[idkuce][hExitx] = 2251.850097; HouseInfo[idkuce][hExity] = -1138.160034; HouseInfo[idkuce][hExitz] = 1050.630004;
HouseInfo[idkuce][hInt] = 9; HouseInfo[idkuce][hVirtual] = idkuce;
}
if(strcmp(x_nr,"2",true) == 0)
{
HouseInfo[idkuce][hExitx] = 2262.830078; HouseInfo[idkuce][hExity] = -1137.709960; HouseInfo[idkuce][hExitz] = 1050.630004;
HouseInfo[idkuce][hInt] = 10; HouseInfo[idkuce][hVirtual] = idkuce;
}
if(strcmp(x_nr,"3",true) == 0)
{
HouseInfo[idkuce][hExitx] = 244.411987; HouseInfo[idkuce][hExity] = 305.032989; HouseInfo[idkuce][hExitz] = 999.148437;
HouseInfo[idkuce][hInt] = 1; HouseInfo[idkuce][hVirtual] = idkuce;
}
if(strcmp(x_nr,"4",true) == 0)
{
HouseInfo[idkuce][hExitx] = 271.884979; HouseInfo[idkuce][hExity] = 306.631988; HouseInfo[idkuce][hExitz] = 999.148437;
HouseInfo[idkuce][hInt] = 2; HouseInfo[idkuce][hVirtual] = idkuce;
}
if(strcmp(x_nr,"5",true) == 0)
{
HouseInfo[idkuce][hExitx] = 300.168212; HouseInfo[idkuce][hExity] = 309.652893; HouseInfo[idkuce][hExitz] = 1003.304687;
HouseInfo[idkuce][hInt] = 4; HouseInfo[idkuce][hVirtual] = idkuce;
}
if(strcmp(x_nr,"6",true) == 0)
{
HouseInfo[idkuce][hExitx] = 344.070587; HouseInfo[idkuce][hExity] = 304.934600; HouseInfo[idkuce][hExitz] = 999.148376;
HouseInfo[idkuce][hInt] = 6; HouseInfo[idkuce][hVirtual] = idkuce;
}
if(strcmp(x_nr,"7",true) == 0)
{
HouseInfo[idkuce][hExitx] = 225.756989; HouseInfo[idkuce][hExity] = 1240.000000; HouseInfo[idkuce][hExitz] = 1082.149902;
HouseInfo[idkuce][hInt] = 2; HouseInfo[idkuce][hVirtual] = idkuce;
}
if(strcmp(x_nr,"8",true) == 0)
{
HouseInfo[idkuce][hExitx] = 2468.403100; HouseInfo[idkuce][hExity] = -1698.402600; HouseInfo[idkuce][hExitz] = 1013.507800;
HouseInfo[idkuce][hInt] = 2; HouseInfo[idkuce][hVirtual] = idkuce;
}
HouseInfo[idkuce][hEntrancex] = X; HouseInfo[idkuce][hEntrancey] = Y; HouseInfo[idkuce][hEntrancez] = Z;
HouseInfo[idkuce][hHealthx] = 0; HouseInfo[idkuce][hHealthy] = 0; HouseInfo[idkuce][hHealthz] = 0;
HouseInfo[idkuce][hArmourx] = 0; HouseInfo[idkuce][hArmoury] = 0; HouseInfo[idkuce][hArmourz] = 0;
strmid(HouseInfo[idkuce][hOwner], "Drzava", 0, strlen("Drzava"), 255);
strmid(HouseInfo[idkuce][hDiscription], "Mala kuca", 0, strlen("Mala kuca"), 255);
HouseInfo[idkuce][hValue] = 15000; HouseInfo[idkuce][hHel] = 0; HouseInfo[idkuce][hArm] = 0; HouseInfo[idkuce][hLock] = 1; HouseInfo[idkuce][hOwned] = 0;
HouseInfo[idkuce][hRooms] = 10; HouseInfo[idkuce][hRent] = 100; HouseInfo[idkuce][hRentabil] = 1; HouseInfo[idkuce][hTakings] = 0;
HouseInfo[idkuce][hVec] = 418; HouseInfo[idkuce][hVcol1] = -1; HouseInfo[idkuce][hVcol2] = -1; HouseInfo[idkuce][hDate] = 0; HouseInfo[idkuce][hLevel] = 4;
HouseInfo[idkuce][hDroga] = 0; HouseInfo[idkuce][hMaterijali] = 0; HouseInfo[idkuce][hOruzje1] = 0; HouseInfo[idkuce][hMunicija1] = 0;
HouseInfo[idkuce][hOruzje2] = 0; HouseInfo[idkuce][hMunicija2] = 0; HouseInfo[idkuce][hOruzje3] = 0; HouseInfo[idkuce][hMunicija3] = 0;
HouseInfo[idkuce][hOruzje4] = 0; HouseInfo[idkuce][hMunicija4] = 0; HouseInfo[idkuce][hOruzje5] = 0; HouseInfo[idkuce][hMunicija5] = 0;
HouseInfo[idkuce][hOruzje6] = 0; HouseInfo[idkuce][hMunicija6] = 0; HouseInfo[idkuce][hOruzje7] = 0; HouseInfo[idkuce][hMunicija7] = 0;
format(string2,sizeof(string2),"Kuca na prodaju! \nID Kuce: %d\n Vrsta kuce: %s \n Cena: $%d | Nivo: %d\nZa kupovinu upisite /kupikucu", HouseInfo[idkuce][hVirtual], HouseInfo[idkuce][hDiscription], HouseInfo[idkuce][hValue], HouseInfo[idkuce][hLevel]);
HouseLabel[idkuce] = Create3DTextLabel(string2 ,0x00FF00AA,X,Y,Z,25, 0, 1);
HousePickup[idkuce] = CreateDynamicPickup(1273, 1, HouseInfo[idkuce][hEntrancex], HouseInfo[idkuce][hEntrancey], HouseInfo[idkuce][hEntrancez]);
format(string2, sizeof(string2), "{FF0000}| NLG | : {FFFF00} Dinamicko spremanje kuce uspesno. Mala kuca je snimljena na ovom mestu.");
SendClientMessage(playerid, COLOR_YELLOW, string2);
format(string2, sizeof(string), "ID: %d | Int: %d | Cena: $%d | Pozicija: (%f - %f - %f)",
idkuce, HouseInfo[idkuce][hInt], HouseInfo[idkuce][hValue], X, Y, Z);
SendClientMessage(playerid, COLOR_YELLOW, string2);
new y, m, d;
new h,mi,s;
new hIme[MAX_PLAYER_NAME];
getdate(y,m,d);
gettime(h,mi,s);
GetPlayerName(playerid, hIme, sizeof(hIme));
format(string, sizeof(string), "(%d/%d/%d)[%d:%d:%d] Vrsta: Mala kuca | ID: %d | Int: %d | Cena: $%d | Pozicija: (%f - %f - %f) | Dodao: %s",
d, m, y, h, mi, s, idkuce, HouseInfo[idkuce][hInt], HouseInfo[idkuce][hValue], X, Y, Z, hIme);
DynVlasnistvaLog(string);
//SacuvajKuce();
}
else
{
SendClientMessage(playerid, COLOR_GRAD2, " (greska) Niste autorizovani da koristite ovu komandu!");
}
return 1;
}
I type /malakuca and get response Koristite: /malakuca [ID interijera (1-], because no params.
But if I type /malakuca 1 (or any else number) i get message SERVER: Unknown command.
Where is mistake!?