Detaljan opis problema: Pravio sam house system, i napravio sam komandu za kreiranje, i ulazak. Prilikom kreiranja se bira interijer, ali opet, kada uđem u kuću, ne postavlja mi taj interijer, nego samo padam.
Dio skripte: Komande:
YCMD:enter(playerid, params[], help)
{
for(new k=1; k {
if(IsPlayerInRangeOfPoint(playerid, 5.0, InformacijeKuce, InformacijeKuce, InformacijeKuce))
{
SetPlayerVirtualWorld(playerid, InformacijeKuce);
SetPlayerInterior(playerid, InformacijeKuce);
SetPlayerPos(playerid, InformacijeKuce, InformacijeKuce, InformacijeKuce);
}
}
return 1;
}
YCMD:createhouse(playerid, params[], help)
{
#pragma unused help
new id, cijena, level, int, vw, kb, vr, Float:PosX, Float:PosY, Float:PosZ, str, string;
if(!(InformacijeIgraca >= 3)) return scm(playerid,color_red, "[GREŠKA]"col_white" - Niste autorizirani za korištenje ove komande.");
if(sscanf(params, "iiiiiii", id, cijena, level, int, vw, kb, vr))
{
scm(playerid, color_red, "[GREŠKA]"col_white" - Korištenje komande: /createhouse [Virtual World] [Kućni broj] ");
scm(playerid, color_white, "- "col_skyblue"Pomoć pri biranju interijera.");
scm(playerid, color_white, "- Interijeri za male kuće: 1, 5, 10.");
scm(playerid, color_white, "- Interijeri za srednje kuće: 2, 3, 4, 5, 6, 9, 10, 15.");
scm(playerid, color_white, "- Interijeri za vile(veće kuće): 5, 6, 12");
return 1;
}
if(id >= houses) return scm(playerid, color_red, "[GREŠKA]"col_white" - Željeni ID kuće prelazi "#houses". Smanji ID, ili prijavi adminu da je broj kuća prešao 500.");
format(string, sizeof(string), kuce, id);
if(fexist(string)) return scm(playerid, color_red, "[GREŠKA]"col_white" - Kuća pod tim IDom već postoji.");
GetPlayerPos(playerid, PosX, PosY, PosZ);
CreateHouse(id, cijena, level, int, vw, kb, vr, PosX, PosY, PosZ);
format(str, sizeof(str), "Uspiješno ste kreirali kuću pod IDom %d.", id);
scm(playerid, color_admini, str);
return 1;
} CreateHouse stock:
stock CreateHouse(id, cijena, level, int, vw, kb, vr, Float:PosX, Float:PosY, Float:PosZ)
{
new kFile, string, str, zone;
new rand = random(5);
GetHouse2DZone(id, zone, 30);
format(kFile, 35, kuce, id);
new INI:File = INI_Open(kFile);
{
INI_WriteString(File, "Vlasnik", "Država");
INI_WriteFloat(File, "EnterX", PosX);
INI_WriteFloat(File, "EnterY", PosY);
INI_WriteFloat(File, "EnterZ", PosZ);
if(vr == 1 && int == 1)
{
INI_WriteFloat(File, "ExitX", 222.9252);
INI_WriteFloat(File, "ExitY", 1288.3846);
INI_WriteFloat(File, "ExitZ", 1082.1406);
}
else if(vr == 1 && int == 5)
{
INI_WriteFloat(File, "ExitX", 2233.8718);
INI_WriteFloat(File, "ExitY", -1113.8929);
INI_WriteFloat(File, "ExitZ", 1050.8828);
}
else if(vr == 1 && int == 10)
{
INI_WriteFloat(File, "ExitX", 2260.5527);
INI_WriteFloat(File, "ExitY", -1135.9375);
INI_WriteFloat(File, "ExitZ", 1050.6328);
}
else if(vr == 2 && int == 9)
{
if(rand == 1)
{
INI_WriteFloat(File, "ExitX", 2317.6772);
INI_WriteFloat(File, "ExitY", -1025.6970);
INI_WriteFloat(File, "ExitZ", 1050.2178);
}
else if(rand == 2)
{
INI_WriteFloat(File, "ExitX", 83.1032);
INI_WriteFloat(File, "ExitY", 1323.4178);
INI_WriteFloat(File, "ExitZ", 1083.8594);
}
}
else if(vr == 2 && int == 3)
{
if(rand == 1)
{
INI_WriteFloat(File, "ExitX", 235.1090);
INI_WriteFloat(File, "ExitY", 1189.7700);
INI_WriteFloat(File, "ExitZ", 1080.2578);
}
else if(rand == 2)
{
INI_WriteFloat(File, "ExitX", 2496.0549);
INI_WriteFloat(File, "ExitY", -1693.9139);
INI_WriteFloat(File, "ExitZ", 1014.7422);
}
}
else if(vr == 2 && int == 2)
{
if(rand == 1)
{
INI_WriteFloat(File, "ExitX", 225.7570);
INI_WriteFloat(File, "ExitY", 1240.0000);
INI_WriteFloat(File, "ExitZ", 1082.1406);
}
else if(rand == 2)
{
INI_WriteFloat(File, "ExitX", 447.0868);
INI_WriteFloat(File, "ExitY", 1399.6906);
INI_WriteFloat(File, "ExitZ", 1084.3047);
}
}
else if(vr == 2 && int == 15)
{
if(rand == 1)
{
INI_WriteFloat(File, "ExitX", 295.2662);
INI_WriteFloat(File, "ExitY", 1473.4937);
INI_WriteFloat(File, "ExitZ", 1080.2578);
}
else if(rand == 2)
{
INI_WriteFloat(File, "ExitX", -284.8645);
INI_WriteFloat(File, "ExitY", 1471.1700);
INI_WriteFloat(File, "ExitZ", 1084.3750);
}
}
else if(vr == 2 && int == 4)
{
if(rand == 1)
{
INI_WriteFloat(File, "ExitX", 260.9357);
INI_WriteFloat(File, "ExitY", 1285.9032);
INI_WriteFloat(File, "ExitZ", 1080.2578);
}
else if(rand == 2)
{
INI_WriteFloat(File, "ExitX", 221.9369);
INI_WriteFloat(File, "ExitY", 1141.4115);
INI_WriteFloat(File, "ExitZ", 1082.6094);
}
else if(rand == 3)
{
INI_WriteFloat(File, "ExitX", -262.1759);
INI_WriteFloat(File, "ExitY", 1456.6158);
INI_WriteFloat(File, "ExitZ", 1084.3672);
}
}
else if(vr == 2 && int == 10)
{
INI_WriteFloat(File, "ExitX", 24.3769);
INI_WriteFloat(File, "ExitY", 1341.1829);
INI_WriteFloat(File, "ExitZ", 1084.3750);
}
else if(vr == 2 && int == 5)
{
INI_WriteFloat(File, "ExitX", 22.9572);
INI_WriteFloat(File, "ExitY", 1404.5542);
INI_WriteFloat(File, "ExitZ", 1084.4297);
}
else if(vr == 2 && int == 6)
{
INI_WriteFloat(File, "ExitX", -68.7530);
INI_WriteFloat(File, "ExitY", 1353.1779);
INI_WriteFloat(File, "ExitZ", 1080.2109);
}
else if(vr == 3 && int == 5)
{
INI_WriteFloat(File, "ExitX", 228.3240);
INI_WriteFloat(File, "ExitY", 1114.1727);
INI_WriteFloat(File, "ExitZ", 1080.9922);
}
else if(vr == 3 && int == 12)
{
INI_WriteFloat(File, "ExitX", 2324.3933);
INI_WriteFloat(File, "ExitY", -1148.5806);
INI_WriteFloat(File, "ExitZ", 1050.7101);
}
else if(vr == 3 && int == 5)
{
INI_WriteFloat(File, "ExitX", 140.3611);
INI_WriteFloat(File, "ExitY", 1367.5953);
INI_WriteFloat(File, "ExitZ", 1083.8617);
}
else if(vr == 3 && int == 6)
{
INI_WriteFloat(File, "ExitX", 234.3069);
INI_WriteFloat(File, "ExitY", 1064.7493);
INI_WriteFloat(File, "ExitZ", 1084.2108);
}
INI_WriteInt(File, "Cijena renta", 0);
INI_WriteInt(File, "ZakljuÄana", 1);
INI_WriteInt(File, "Sef(droga1)", 0);
INI_WriteInt(File, "Sef(droga2)", 0);
INI_WriteInt(File, "Sef(droga3)", 0);
INI_WriteInt(File, "Sef(droga4)", 0);
INI_WriteInt(File, "Sef(droga5)", 0);
INI_WriteInt(File, "Kupljena", 0);
INI_WriteInt(File, "Interijer", int);
INI_WriteInt(File, "Sef(oružje1)", 0);
INI_WriteInt(File, "Sef(oružje2)", 0);
INI_WriteInt(File, "Sef(oružje3)", 0);
INI_WriteInt(File, "Sef(oružje4)", 0);
INI_WriteInt(File, "Sef(oružje5)", 0);
INI_WriteInt(File, "Cijena", cijena);
format(str,sizeof(str),"%s %d", zone, kb);
INI_WriteString(File, "Adresa", str);
INI_WriteInt(File, "Level", level);
INI_WriteInt(File, "Rent", 0);
INI_WriteInt(File, "Sef", 0);
INI_WriteInt(File, "Virtual World", vw);
INI_Close(File);
format(InformacijeKuce,48,"Država");
InformacijeKuce = PosX;
InformacijeKuce = PosY;
InformacijeKuce = PosZ;
if(vr == 1 && int == 1)
{
InformacijeKuce = 222.9252;
InformacijeKuce = 1288.3846;
InformacijeKuce = 1082.1406;
}
else if(vr == 1 && int == 5)
{
InformacijeKuce = 2233.8718;
InformacijeKuce = -1113.8929;
InformacijeKuce = 1050.8828;
}
else if(vr == 1 && int == 10)
{
InformacijeKuce = 2260.5527;
InformacijeKuce = -1135.9375;
InformacijeKuce = 1050.6328;
}
else if(vr == 2 && int == 9)
{
if(rand == 1)
{
InformacijeKuce = 2317.6772;
InformacijeKuce = -1025.6970;
InformacijeKuce = 1050.2178;
}
else if(rand == 2)
{
InformacijeKuce = 83.1032;
InformacijeKuce = 1323.4178;
InformacijeKuce = 1083.8594;
}
}
else if(vr == 2 && int == 3)
{
if(rand == 1)
{
InformacijeKuce = 235.1090;
InformacijeKuce = 1189.7700;
InformacijeKuce = 1080.2578;
}
else if(rand == 2)
{
InformacijeKuce = 2496.0549;
InformacijeKuce = -1693.9139;
InformacijeKuce = 1014.7422;
}
}
else if(vr == 2 && int == 2)
{
if(rand == 1)
{
InformacijeKuce = 225.7570;
InformacijeKuce = 1240.0000;
InformacijeKuce = 1082.1406;
}
else if(rand == 2)
{
InformacijeKuce = 447.0868;
InformacijeKuce = 1399.6906;
InformacijeKuce = 1084.3047;
}
}
else if(vr == 2 && int == 15)
{
if(rand == 1)
{
InformacijeKuce = 295.2662;
InformacijeKuce = 1473.4937;
InformacijeKuce = 1080.2578;
}
else if(rand == 2)
{
InformacijeKuce = -284.8645;
InformacijeKuce = 1471.1700;
InformacijeKuce = 1084.3750;
}
}
else if(vr == 2 && int == 4)
{
if(rand == 1)
{
InformacijeKuce = 260.9357;
InformacijeKuce = 1285.9032;
InformacijeKuce = 1080.2578;
}
else if(rand == 2)
{
InformacijeKuce = 221.9369;
InformacijeKuce = 1141.4115;
InformacijeKuce = 1082.6094;
}
else if(rand == 3)
{
InformacijeKuce = -262.1759;
InformacijeKuce = 1456.6158;
InformacijeKuce = 1084.3672;
}
}
else if(vr == 2 && int == 10)
{
InformacijeKuce = 24.3769;
InformacijeKuce = 1341.1829;
InformacijeKuce = 1084.3750;
}
else if(vr == 2 && int == 5)
{
InformacijeKuce = 22.9572;
InformacijeKuce = 1404.5542;
InformacijeKuce = 1084.4297;
}
else if(vr == 2 && int == 6)
{
InformacijeKuce = -68.7530;
InformacijeKuce = 1353.1779;
InformacijeKuce = 1080.2109;
}
else if(vr == 3 && int == 5)
{
InformacijeKuce = 228.3240;
InformacijeKuce = 1114.1727;
InformacijeKuce = 1080.9922;
}
else if(vr == 3 && int == 12)
{
InformacijeKuce = 2324.3933;
InformacijeKuce = -1148.5806;
InformacijeKuce = 1050.7101;
}
else if(vr == 3 && int == 5)
{
InformacijeKuce = 140.3611;
InformacijeKuce = 1367.5953;
InformacijeKuce = 1083.8617;
}
else if(vr == 3 && int == 6)
{
InformacijeKuce = 234.3069;
InformacijeKuce = 1064.7493;
InformacijeKuce = 1084.2108;
}
InformacijeKuce = 0;
InformacijeKuce = 1;
InformacijeKuce = 0;
InformacijeKuce = 0;
InformacijeKuce = 0;
InformacijeKuce = 0;
InformacijeKuce = 0;
InformacijeKuce = 0;
InformacijeKuce = int;
InformacijeKuce = 0;
InformacijeKuce = 0;
InformacijeKuce = 0;
InformacijeKuce = 0;
InformacijeKuce = 0;
InformacijeKuce = cijena;
format(InformacijeKuce,32,"%s %d", zone, kb);
InformacijeKuce = level;
InformacijeKuce = 0;
InformacijeKuce = 0;
InformacijeKuce = vw;
InformacijeKuce = CreateDynamicPickup(1273, 23, PosX,PosY,PosZ,-1,-1,-1,100.0);
format(string,sizeof(string),""col_kuce"Vlasnik: Država.\n"col_kuce"Cijena: $%d.\n"col_kuce"Level potreban za kupnju: %d.\n"col_kuce"Adresa: %s %d\n"col_kuce"Kucajte /buyhouse da kupite.", cijena, level, zone, kb);
InformacijeKuce = CreateDynamic3DTextLabel(string, 0xFFFFFF, PosX,PosY,PosZ, 100, INVALID_PLAYER_ID, INVALID_VEHICLE_ID, 0, -1, -1, -1, 100);
}
}