streamer - DestroyDynamicObject - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: streamer - DestroyDynamicObject (
/showthread.php?tid=655037)
streamer - DestroyDynamicObject -
Dreandor - 11.06.2018
Hello Guys,
I want to destroy objects, what is create with CreateDynamicObject.
Код:
enum ItemSpawns{
itemid,
Float:i_x,
Float:i_y,
Float:i_z
}
new iInfo[][ItemSpawns] = {
{19165, -1571.1134, -2731.9644, 47.5438}
};
Код:
OnGameModeInit
for(new i=0; i < sizeof(iInfo); i++)
{
CreateDynamicObject(iInfo[i][itemid],iInfo[i][i_x],iInfo[i][i_y],iInfo[i][i_z], 0.0, 0.0, 0.0, 0);
}
Код:
for(new i=0; i<sizeof(iInfo); i++)
{
if(!IsPlayerInRangeOfPoint(playerid, 2, iInfo[i][i_x], iInfo[i][i_y], iInfo[i][i_z]))continue;
if(GetObjectModel(iInfo[i][itemid] == 19165))
{
if(PlayerInfo[playerid][pMap] == 1)
{
SendClientMessage(playerid, Color_Red, "You have already a map!");
}
else
{
DestroyDynamicObject(iInfo[i][itemid]);
PlayerInfo[playerid][pMap] = 1;
GangZoneHideForPlayer(playerid, blackmap);
}
}
}
but with this code it doesn't work
Re: streamer - DestroyDynamicObject -
Dreandor - 11.06.2018
I fixed it. I made
and then
Код:
for(new i=0; i < sizeof(iInfo); i++)
{
obj[i] = CreateDynamicObject(iInfo[i][itemid],iInfo[i][i_x],iInfo[i][i_y],iInfo[i][i_z], 0.0, 0.0, 0.0, 0);
}
Код:
if(GetObjectModel(iInfo[i][itemid] == 19165))
{
if(PlayerInfo[playerid][pMap] == 1)
{
SendClientMessage(playerid, Color_Red, "Du hast bereits eine Karte!");
}
else
{
DestroyDynamicObject(obj[i]);
PlayerInfo[playerid][pMap] = 1;
GangZoneHideForPlayer(playerid, blackmap);
}
}