Jump to content
  • 0

pomoc Mapování


Oggymot

Dotaz

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

7 odpovědí na tuto otázku

Recommended Posts

  • 0
  • Globální moderátor

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]);

  • Líbí se mi to! (+1) 1
Link to comment
Share on other sites

  • 0

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

  • 0
  • Globální moderátor

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

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...