Oggymot 2 Odesláno: 6. Červen, 2017 Share Odesláno: 6. Červen, 2017 Popis problému: Zdravím, mám tu problém. Dělám FS, který by měl po reloadu zaktualizovat mapu. Ale když tam je něco vytvořeno předtím, tak to tam zůstane. Je nějaký způsob jak vytvořené objekty smazat? Děkuji. Chyby/varování kompilátoru a při běhu: -- Kód: #include #include #define COLOR_GREEN 0x33AA33AA #define COLOR_YELLOW 0xFFFF00AA #define COLOR_WHITE 0xFFFFFFAA public OnFilterScriptInit() { SendClientMessageToAll( COLOR_YELLOW, "(( Byla vydána nová verze mapy. Pro aktivaci zadejte {FFFFFF}/updatemap{FFFF00} ))"); // CASINO CreateObject(19425, -2148.96436, 226.33920, 34.37090, 0.00000, 0.00000, 0.00000);//RETARDER CreateObject(19425, -2144.27832, 226.33920, 34.37090, 0.00000, 0.00000, 0.00000);//RETARDER CreateObject(19425, -2144.21606, 301.49869, 34.16520, 0.00000, 0.00000, 0.00000);//RETARDER CreateObject(19425, -2149.11450, 301.49850, 34.16520, 0.00000, 0.00000, 0.00000);//RETARDER CreateObject(1622, -2156.48657, 235.22380, 38.98770, 0.00000, 0.00000, 180.00000);//KAMERA CreateObject(1622, -2158.03394, 285.93820, 39.60920, 0.00000, 0.00000, 270.41110);//KAMERA-PARKOVIŠTĚ CreateObject(11727, -2161.75806, 263.00772, 36.90320, 0.00000, 0.00000, 0.00000);//Světla vchod PRAVO CreateObject(11727, -2164.25806, 263.00769, 36.90320, 0.00000, 0.00000, 0.00000);//Světla vchod PRAVO CreateObject(11727, -2166.75806, 263.00769, 36.90320, 0.00000, 0.00000, 0.00000);//Světla vchod PRAVO CreateObject(11727, -2169.25806, 263.00769, 36.90320, 0.00000, 0.00000, 0.00000);//Světla vchod PRAVO CreateObject(11727, -2171.75806, 263.00769, 36.90320, 0.00000, 0.00000, 0.00000);//Světla vchod PRAVO CreateObject(11727, -2171.75806, 241.00771, 36.90320, 0.00000, 0.00000, 180.00000);//Světla vchod LEVO CreateObject(11727, -2169.25806, 241.00771, 36.90320, 0.00000, 0.00000, 180.00000);//Světla vchod LEVO CreateObject(11727, -2166.75806, 241.00771, 36.90320, 0.00000, 0.00000, 180.00000);//Světla vchod LEVO CreateObject(11727, -2164.25806, 241.00771, 36.90320, 0.00000, 0.00000, 180.00000);//Světla vchod LEVO CreateObject(11727, -2161.75806, 241.00771, 36.90320, 0.00000, 0.00000, 180.00000);//Světla vchod LEVO CreateObject(11389, -2048.1172, 166.7188, 30.9766, 0.0000, 0.0000, 0.0000);//Bendýnka return 1; } public OnFilterScriptExit() { return 1; } public OnPlayerConnect(playerid) { RemoveBuildingForPlayer(playerid, 11360, -2038.8672, 170.3203, 29.9375, 0.25); RemoveBuildingForPlayer(playerid, 956, -2229.1875, 286.4141, 34.7031, 0.25); //DELETE automat na kolu parkoviste kasino RemoveBuildingForPlayer(playerid, 1226, -2150.8984, 240.6563, 38.0391, 0.25); RemoveBuildingForPlayer(playerid, 10987, -2137.8203, 264.2813, 35.7813, 0.25); //Delete TUNEL CreateObject(19425, -2148.96436, 226.33920, 34.16520, 0.00000, 0.00000, 0.00000); //RETARDER CreateObject(19425, -2144.27832, 226.33920, 34.16520, 0.00000, 0.00000, 0.00000); //RETARDER CreateObject(19425, -2144.21606, 301.49869, 34.16520, 0.00000, 0.00000, 0.00000); //RETARDER CreateObject(19425, -2149.11450, 301.49850, 34.16520, 0.00000, 0.00000, 0.00000); //RETARDER CreateObject(1622, -2156.48657, 235.22380, 38.98770, 0.00000, 0.00000, 180.00000); //KAMERA CreateObject(1622, -2158.03394, 285.93820, 39.60920, 0.00000, 0.00000, 270.41110); //KAMERA-PARKOVIŠTĚ CreateObject(11727, -2161.75806, 263.00772, 36.90320, 0.00000, 0.00000, 0.00000); //Světla vchod PRAVO CreateObject(11727, -2164.25806, 263.00769, 36.90320, 0.00000, 0.00000, 0.00000); //Světla vchod PRAVO CreateObject(11727, -2166.75806, 263.00769, 36.90320, 0.00000, 0.00000, 0.00000); //Světla vchod PRAVO CreateObject(11727, -2169.25806, 263.00769, 36.90320, 0.00000, 0.00000, 0.00000); //Světla vchod PRAVO CreateObject(11727, -2171.75806, 263.00769, 36.90320, 0.00000, 0.00000, 0.00000); //Světla vchod PRAVO CreateObject(11727, -2171.75806, 241.00771, 36.90320, 0.00000, 0.00000, 180.00000); //Světla vchod LEVO CreateObject(11727, -2169.25806, 241.00771, 36.90320, 0.00000, 0.00000, 180.00000); //Světla vchod LEVO CreateObject(11727, -2166.75806, 241.00771, 36.90320, 0.00000, 0.00000, 180.00000); //Světla vchod LEVO CreateObject(11727, -2164.25806, 241.00771, 36.90320, 0.00000, 0.00000, 180.00000); //Světla vchod LEVO CreateObject(11727, -2161.75806, 241.00771, 36.90320, 0.00000, 0.00000, 180.00000); //Světla vchod LEVO CreateObject(11389, -2048.1172, 166.7188, 30.9766, 0.0000, 0.0000, 0.0000);//Bendýnka return 1; } public OnPlayerCommandText(playerid, cmdtext[]) { if (strcmp("/updatemap", cmdtext, true, 10) == 0) { // Fáze 1 - Remove RemoveBuildingForPlayer(playerid, 11360, -2038.8672, 170.3203, 29.9375, 0.25); RemoveBuildingForPlayer(playerid, 956, -2229.1875, 286.4141, 34.7031, 0.25); //DELETE automat na kolu parkoviste kasino RemoveBuildingForPlayer(playerid, 1226, -2150.8984, 240.6563, 38.0391, 0.25); RemoveBuildingForPlayer(playerid, 10987, -2137.8203, 264.2813, 35.7813, 0.25); //Delete TUNEL CreateObject(19425, -2148.96436, 226.33920, 34.16520, 0.00000, 0.00000, 0.00000); //RETARDER CreateObject(19425, -2144.27832, 226.33920, 34.16520, 0.00000, 0.00000, 0.00000); //RETARDER CreateObject(19425, -2144.21606, 301.49869, 34.16520, 0.00000, 0.00000, 0.00000); //RETARDER CreateObject(19425, -2149.11450, 301.49850, 34.16520, 0.00000, 0.00000, 0.00000); //RETARDER CreateObject(1622, -2156.48657, 235.22380, 38.98770, 0.00000, 0.00000, 180.00000); //KAMERA CreateObject(1622, -2158.03394, 285.93820, 39.60920, 0.00000, 0.00000, 270.41110); //KAMERA-PARKOVIŠTĚ CreateObject(11727, -2161.75806, 263.00772, 36.90320, 0.00000, 0.00000, 0.00000); //Světla vchod PRAVO CreateObject(11727, -2164.25806, 263.00769, 36.90320, 0.00000, 0.00000, 0.00000); //Světla vchod PRAVO CreateObject(11727, -2166.75806, 263.00769, 36.90320, 0.00000, 0.00000, 0.00000); //Světla vchod PRAVO CreateObject(11727, -2169.25806, 263.00769, 36.90320, 0.00000, 0.00000, 0.00000); //Světla vchod PRAVO CreateObject(11727, -2171.75806, 263.00769, 36.90320, 0.00000, 0.00000, 0.00000); //Světla vchod PRAVO CreateObject(11727, -2171.75806, 241.00771, 36.90320, 0.00000, 0.00000, 180.00000); //Světla vchod LEVO CreateObject(11727, -2169.25806, 241.00771, 36.90320, 0.00000, 0.00000, 180.00000); //Světla vchod LEVO CreateObject(11727, -2166.75806, 241.00771, 36.90320, 0.00000, 0.00000, 180.00000); //Světla vchod LEVO CreateObject(11727, -2164.25806, 241.00771, 36.90320, 0.00000, 0.00000, 180.00000); //Světla vchod LEVO CreateObject(11727, -2161.75806, 241.00771, 36.90320, 0.00000, 0.00000, 180.00000); //Světla vchod LEVO SendClientMessage(playerid, COLOR_GREEN , "(( Mapa byla zaktualizována. ))"); return 1; } return 0; } Dodatečné poznámky: -- Link to comment Share on other sites More sharing options...
0 Globální moderátor HighPrint 177 Odesláno: 6. Červen, 2017 Globální moderátor Share Odesláno: 6. Červen, 2017 Načíst ty objekty někam do pole a v OnFilterScriptExit je vymazat... new objs[2]; objs[0] = CreateObject(...); objs[1] = CreateObject(...); DestroyObject(objs[0]); DestroyObject(objs[1]); 1 Link to comment Share on other sites More sharing options...
0 Oggymot 2 Odesláno: 6. Červen, 2017 Author Share Odesláno: 6. Červen, 2017 Děkuji, a ještě jsem se chtěl zeptat, zda lze nějak smazat (RemoveBuildingForPlayer) objekty pro všechny hráče naráz a taky mě to nefunguje u OnPlayerConnect.Děkuji za odpovědi. Link to comment Share on other sites More sharing options...
0 Globální moderátor HighPrint 177 Odesláno: 6. Červen, 2017 Globální moderátor Share Odesláno: 6. Červen, 2017 Mělo by to normálně fungovat v connectu Link to comment Share on other sites More sharing options...
0 Oggymot 2 Odesláno: 6. Červen, 2017 Author Share Odesláno: 6. Červen, 2017 Zkusím to, a jde nějak smazat objekt pro všechny? Abych tam nemusel uvádět playerid? Link to comment Share on other sites More sharing options...
0 Lukasz 336 Odesláno: 6. Červen, 2017 Share Odesláno: 6. Červen, 2017 Pro vsechny bez playerid ne. Link to comment Share on other sites More sharing options...
0 Invouk 91 Odesláno: 6. Červen, 2017 Share Odesláno: 6. Červen, 2017 for(new i=0;i<MAX_PLAYERS; i++) RemoBuildingForPlayer(i, XYZ);A môžeš to dať aj do CMD mne to funguje keby sa našiel niekto 2 Link to comment Share on other sites More sharing options...
0 Globální moderátor HighPrint 177 Odesláno: 6. Červen, 2017 Globální moderátor Share Odesláno: 6. Červen, 2017 Na příkaz bych to nedával: When removing the same object for a player, they will crash. Commonly, players crash when reconnecting to the server because the server removes buildings on OnPlayerConnect. Link to comment Share on other sites More sharing options...
Dotaz
Oggymot 2
Popis problému:
Zdravím,
mám tu problém. Dělám FS, který by měl po reloadu zaktualizovat mapu. Ale když tam je něco vytvořeno předtím, tak to tam zůstane. Je nějaký způsob jak vytvořené objekty smazat?
Děkuji.
Chyby/varování kompilátoru a při běhu:
--
Kód:
Dodatečné poznámky:
--
Link to comment
Share on other sites
7 odpovědí na tuto otázku
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