sile Posted June 29, 2019 Share Posted June 29, 2019 Cand creez de exemplu o casa imi arata ca are id 0 si cand dau edithouse id 0 merge insa in baza de date scrie ca are id 1, cum rezolv ca atunci cand fac o casa sa inceapa de la id 1? Link to comment Share on other sites More sharing options...
Filip Posted June 29, 2019 Share Posted June 29, 2019 pune loadhouse aici sau cum se numeste functia ta Link to comment Share on other sites More sharing options...
Gabi23 Posted June 29, 2019 Share Posted June 29, 2019 Păi, în primul rând, pune auto increment la ID în tabelul house, apoi, la /createhouse. pur și simplu iei cache insert id-ul ăla. Caută pe google. Link to comment Share on other sites More sharing options...
sile Posted June 29, 2019 Author Share Posted June 29, 2019 CMD:makehouse(playerid, params[]) { if(!CheckAdmin(playerid, ADMIN_LEVEL_5)) return SendErrorMessage(playerid,"Nu ai acces la aceasta comanda sau nu esti ON-DUTY!"); new houseid, level, price, clases, Float:x, Float:y, Float:z; if(sscanf(params,"iii", level, clases, price)) return SendSyntaxMessage(playerid, "/makehouse [level] [Type house: 1-small, 2-medium, 3-big] [price]"); if(level < 0 || level > 35) return SendErrorMessage(playerid, "House level: 0-35."); if(clases < 1 || clases > 3) return SendErrorMessage(playerid, "Type house: 1-small, 2-medium, 3-big."); if(price < 1 || price > 2000000) return SendErrorMessage(playerid, "Invalid house price. Max price: 2kk"); if((houseid = GetNextHouseID()) == -1) return SendErrorMessage(playerid, "Maximum number of houses reached."); GetPlayerPos(playerid, x, y, z); new vw = GetWorld(playerid), interior = GetInterior(playerid); HouseInfo[houseid][hPosX] = x; HouseInfo[houseid][hPosY] = y; HouseInfo[houseid][hPosZ] = z; HouseInfo[houseid][hPosVW] = vw; HouseInfo[houseid][hPosInt] = interior; HouseInfo[houseid][hExitX] = 0.0; HouseInfo[houseid][hExitY] = 0.0; HouseInfo[houseid][hExitZ] = 0.0; HouseInfo[houseid][hExitVW] = 5000 + houseid; SetHouseInterior(houseid, 0); HouseInfo[houseid][hCheckPosX] = 0.0000; HouseInfo[houseid][hCheckPosY] = 0.0000; HouseInfo[houseid][hCheckPosZ] = 0.0000; HouseInfo[houseid][hLevelbuy] = level; HouseInfo[houseid][hPrice] = price; HouseInfo[houseid][hOwnerID] = 0; HouseInfo[houseid][hLocked] = 1; HouseInfo[houseid][hCash] = 0; HouseInfo[houseid][hRadio] = 0; HouseInfo[houseid][hClass] = clases-1; HouseInfo[houseid][hHeal] = 0; HouseInfo[houseid][hHealAmount] = 0; HouseInfo[houseid][hCupboard] = 0; HouseInfo[houseid][hFurnitureRadius] = 7.0; new door[11]; switch(HouseInfo[houseid][hDoor]) { case 0: door = "Normal"; case 1: door = "Wooden"; case 2: door = "Iron"; } new classes_name[3][10] = {"Small", "Medium", "Big"}; UpdateHouseText(houseid); HouseInfo[houseid][hCheckPoint] = CreateDynamicCP(x, y, z, 1.0, HouseInfo[houseid][hPosVW], -1, -1, 2.0); AddHouseToFile(houseid, clases-1, level, price, x, y, z, 5000 + houseid, vw, interior); SendClientMessageEx(playerid,COLOR_GREEN,"House successfully created: Purchase level: %i, Price: %i, Name: %s. Type house: %s(%i).", level, price, classes_name[clases-1], clases); return 1; } Link to comment Share on other sites More sharing options...
Matt Posted June 29, 2019 Share Posted June 29, 2019 Topic-ul a fost șters deoarece nu ai respectat modelul de postare. Te rugăm sa revii cu alt topic in care să respecți modelul. Topic șters! Respecta si vei fi respectat. BigInt Pawn: Pacman C++: Snake C++: Minesweeper C++: mattbb.cash leaks.ro Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now