dcmd_createhouse(playerid, params[]){new cost, file[HOUSEFILE_LENGTH], h = GetFreeHouseID(), labeltext[150], hinterior;if(!IsPlayerAdmin(playerid)) return 0;if(sscanf(params, \"dD(\" #DEFAULT_H_INTERIOR \")\", cost, hinterior)) return SendClientMessage(playerid, COLOUR_SYSTEM, E_CMD_USAGE_CREATEHOUSE);if(h < 0){ShowInfoBox(playerid, INFORMATION_HEADER, E_TOO_MANY_HOUSES, MAX_HOUSES);}if(cost < MIN_HOUSE_VALUE || cost > MAX_HOUSE_VALUE) return SendClientMessage(playerid, COLOUR_SYSTEM, E_INVALID_HVALUE);else{ format(file, sizeof(file), FILEPATH, h); dini_Create(file);GetPlayerPos(playerid, X, Y, Z);GetPlayerFacingAngle(playerid, Angle);dini_FloatSet(file, \"CPOutX\", X);dini_FloatSet(file, \"CPOutY\", Y);dini_FloatSet(file, \"CPOutZ\", Z);dini_Set(file, \"HouseName\", DEFAULT_HOUSE_NAME);dini_Set(file, \"HouseOwner\", INVALID_HOWNER_NAME);dini_Set(file, \"HousePassword\", \"INVALID_HOUSE_PASSWORD\");dini_Set(file, \"HouseCreator\", pNick(playerid));dini_IntSet(file, \"HouseValue\", cost);dini_IntSet(file, \"HouseStorage\", 0);format(labeltext, sizeof(labeltext), LABELTEXT1, DEFAULT_HOUSE_NAME, cost, h);#if defined GH_USE_CPS HouseCPOut[h] = CreateDynamicCP(X, Y, Z, 1.5, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, 25.0); HouseCPInt[h] = CreateDynamicCP(2196.84, -1204.36, 1049.02, 1.5, (h + 1000), 6, -1, 100.0);#endif#if !defined GH_USE_CPS HousePickupOut[h] = CreateDynamicPickup(PICKUP_MODEL_OUT, PICKUP_TYPE, X, Y, Z, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, 15.0); HousePickupInt[h] = CreateDynamicPickup(PICKUP_MODEL_INT, PICKUP_TYPE, 2196.84, -1204.36, 1049.02, (h + 1000), 6, -1, 15.0);#endif#if defined GH_USE_MAPICONS HouseMIcon[h] = CreateDynamicMapIcon(X, Y, Z, 31, -1, GetPlayerVirtualWorld(playerid), GetPlayerInterior(playerid), -1, 50.0); #endifHouseLabel[h] = Create3DTextLabel(labeltext, COLOUR_GREEN, X, Y, Z+0.7, 25, GetPlayerVirtualWorld(playerid), 1);SendMSG(playerid, COLOUR_YELLOW, 128, I_H_CREATED, h);GetPosInFrontOfPlayer(playerid, X, Y, -2.5);dini_FloatSet(file, \"SpawnOutX\", X);dini_FloatSet(file, \"SpawnOutY\", Y);dini_FloatSet(file, \"SpawnOutZ\", Z);dini_FloatSet(file, \"SpawnOutAngle\", floatround((180 + Angle)));dini_IntSet(file, \"SpawnWorld\", GetPlayerVirtualWorld(playerid));dini_IntSet(file, \"SpawnInterior\", GetPlayerInterior(playerid));dini_IntSet(file, \"HouseInterior\", hinterior);switch(hinterior){ case 1: { dini_IntSet(file, \"HouseInteriorValue\", H_INT_1_VALUE); dini_Set(file, \"HouseInteriorName\", \"Shitty Shack\"); } case 2: { dini_IntSet(file, \"HouseInteriorValue\", H_INT_2_VALUE); dini_Set(file, \"HouseInteriorName\", \"Motel szoba\"); } case 3: { dini_IntSet(file, \"HouseInteriorValue\", H_INT_3_VALUE); dini_Set(file, \"HouseInteriorName\", \"Hotel szoba 1\"); } case 4: { dini_IntSet(file, \"HouseInteriorValue\", H_INT_4_VALUE); dini_Set(file, \"HouseInteriorName\", \"Hotel szoba 2\"); } case 5: { dini_IntSet(file, \"HouseInteriorValue\", H_INT_5_VALUE); dini_Set(file, \"HouseInteriorName\", \"Banda ház\"); } case 6: { dini_IntSet(file, \"HouseInteriorValue\", H_INT_6_VALUE); dini_Set(file, \"HouseInteriorName\", \"Normál ház\"); } case 0: { dini_IntSet(file, \"HouseInteriorValue\", H_INT_0_VALUE); dini_Set(file, \"HouseInteriorName\", \"Alapértelmezett Ház\"); } case 7: { dini_IntSet(file, \"HouseInteriorValue\", H_INT_7_VALUE); dini_Set(file, \"HouseInteriorName\", \"Közepes kastély\"); } case 8: { dini_IntSet(file, \"HouseInteriorValue\", H_INT_8_VALUE); dini_Set(file, \"HouseInteriorName\", \"Gazdag ház\"); } case 9: { dini_IntSet(file, \"HouseInteriorValue\", H_INT_9_VALUE); dini_Set(file, \"HouseInteriorName\", \"Hatalmas kastély\"); } case 10: { dini_IntSet(file, \"HouseInteriorValue\", H_INT_10_VALUE); dini_Set(file, \"HouseInteriorName\", \"Mad Dogg kastélya\"); }}dini_IntSet(\"/GarHouse/House.ini\", \"CurrentID\", dini_Int(\"/GarHouse/House.ini\", \"CurrentID\") + 1);dini_IntSet(\"/GarHouse/House.ini\", \"CurrentWorld\", dini_Int(\"/GarHouse/House.ini\", \"CurrentID\") + 1000);SetPVarInt(playerid, \"JustCreatedHouse\", 1);#if defined GH_DEBUGGING printf(DEBUG_OP_CMD1, pNick(playerid), playerid, h, cost, GetTotalHouses());#endif} return 1;}
if(sscanf(params, \"ii\", cost, hinterior))
if(sscanf(params, \"dD(\" #DEFAULT_H_INTERIOR \")\", cost, hinterior)) return SendClientMessage(playerid, COLOUR_SYSTEM, E_CMD_USAGE_CREATEHOUSE); if(sscanf(params, \"ii\", cost, hinterior))
Köszönöm,és egyben elnézést a hülye kérdésért,ezt hova tegyem,mármint én ide tettem és nem jó: if(sscanf(params, \"dD(\" #DEFAULT_H_INTERIOR \")\", cost, hinterior)) return SendClientMessage(playerid, COLOUR_SYSTEM, E_CMD_USAGE_CREATEHOUSE); if(sscanf(params, \"ii\", cost, hinterior))