Guten Tag Brotfischer,
Ich habe mir hier einen Befehl gemacht der Ingame Häuser erstellen soll, soweit funktioniert er auch doch wie mache ich das ich die im Script oben aufgelisteten Innenräume verwenden kann?
Hier meine Häuser oben im Script:
new Houses[24][4] = {
//Interior - PosX - PosY - PosZ
{3,1527.0468, -12.0236, 1002.0971},
{2,1523.5098, -47.8211, 1002.2699},
{3,512.9291, -11.6929, 1001.565},
{2,2447.8704, -1704.4509, 1013.5078},
{1,2527.0176, -1679.2076, 1015.4986},
{5,1267.8407, -776.9587, 1091.9063},
{2,2536.5322, -1294.8425, 1044.125},
{3,234.6087, 1187.8195, 1080.2578},
{2,225.5707, 1240.0643, 1082.1406},
{1,224.288, 1289.1907, 1082.1406},
{5,239.2819, 1114.1991, 1080.9922},
{15,295.1391, 1473.3719, 1080.2578},
{4,261.1165, 1287.2197, 1080.2578},
{10,24.3769, 1341.1829, 1084.375},
{4,-262.1759, 1456.6158, 1084.36728},
{5,22.861, 1404.9165, 1084.4297},
{5,140.3679, 1367.8837, 1083.8621},
{6,234.2826, 1065.229, 1084.2101},
{6,-68.5145, 1353.8485, 1080.2109},
{15,-285.2511, 1471.197, 1084.375},
{8,-42.5267, 1408.23, 1084.4297},
{9,84.9244, 1324.2983, 1083.8594},
{9,260.7421, 1238.2261, 1084.2578},
{2,447.0000, 1400.3000, 1084.3047}
};
Hier mein Befehl:
ocmd:createhouse(playerid, params[])
{
new Level, Kosten, Interior, VirtualWorld, string[128],query[365],hTyp;
if(PlayerInfo[playerid][pAdmin] >= 1337)
{
if(sscanf(params, "iiiii",hTyp, Level, Kosten, Interior, VirtualWorld)) return SendClientMessage(playerid, COLOR_GREY,"Info: /createhouse [Housetyp] [Level] [Kosten] [Interior] [VirtualW]");
else
{
new Float:AX,Float:AY,Float:AZ;
GetPlayerPos(playerid, AX, AY, AZ);
format(query, sizeof(query), "INSERT INTO `houses` (Entrancex,Entrancey,Entrancez,Exitx,Exity,Exitz,Level,Cost,Owner,Owned,Interior,VirtualW) VALUES ('%f','%f','%f','%f','%f','%f','%d','%d','0','0','%d','%d')",
AX,AY,AZ,AX,AY,AZ,Level,Kosten,Interior,VirtualWorld);
mysql_query(query);
new house = mysql_insert_id();
printf("[HAUS] --- %d --- [HAUS]", house);
HouseInfo[house][hEntrancex] = AX;
HouseInfo[house][hEntrancey] = AY;
HouseInfo[house][hEntrancez] = AZ;
HouseInfo[house][hExitx] = AX;
HouseInfo[house][hExity] = AY;
HouseInfo[house][hExitz] = AZ;
HouseInfo[house][hLevel] = Level;
HouseInfo[house][hCost] = Kosten;
HouseInfo[house][hOwner] = 0;
HouseInfo[house][hOwned] = 0;
HouseInfo[house][hInt] = Interior;
HouseInfo[house][hVirtualW] = VirtualWorld;
HouseInfo[house][hLock] = 1;
HouseInfo[house][hPickup] = CreateDynamicPickup(1273, 23, HouseInfo[house][hEntrancex], HouseInfo[house][hEntrancey], HouseInfo[house][hEntrancez], -1);
format(string, sizeof(string),"Besitzer: Niemand\nLevel: %d\nKosten: %d\nTippe /enter um das Haus zu betreten", HouseInfo[house][hLevel], HouseInfo[house][hCost]);
CreateDynamic3DTextLabel(string, COLOR_GREEN, HouseInfo[house][hEntrancex], HouseInfo[house][hEntrancey], HouseInfo[house][hEntrancez], 20.0, INVALID_PLAYER_ID, INVALID_VEHICLE_ID,-1,-1,-1,-1,100.0);
}
}
else return SendClientMessage(playerid, COLOR_LIGHTRED, "{FF003F}SERVER: {FFFFFF}Du darfst diesen Befehl nicht benutzen!");
return 1;
}
Bei "Housetyp" sollte das Haus ausgesucht werden!
Ich bedanke mich schonmal im vorraus.