SA-MP Forums Archive
Object won't destroy - 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: Object won't destroy (/showthread.php?tid=559357)



Object won't destroy - Riso135 - 22.01.2015

Hello there sa:mp scripters.

I have a problem with one of my scripts. I used CreatePlayerObject and when i chose in dialog to destroy that PlayerObject (DestroyPlayerObject function) it didn't work - the object is at his x,y,z position. So that's why i created this thread hoping that you might help me.


Re: Object won't destroy - Riso135 - 22.01.2015

any suggestions?


Re: Object won't destroy - Ironboy - 22.01.2015

No one can help you out without seeing the way you scripted, mind posting the code


Re: Object won't destroy - Riso135 - 22.01.2015

for example like this - its in onplayerdisconnect - tested in game, object didin't disappear

Код:
for(new i; i<MAX_PLAYERS_EX; i++)
{
DestroyPlayerObject(i,Item[playerid]);
}
//the Item is Item[playerid]=Create... when player choose in dialog


Re: Object won't destroy - Anuris - 22.01.2015

Show the whole code.


Re: Object won't destroy - Riso135 - 22.01.2015

this one is for destroy
Код:
for(new i; i<MAX_PLAYERS_EX; i++)
{
DestroyPlayerObject(i,Item[playerid]);
}
this one is for create
Код:
new Float:x, Float:y, Float:z;
GetPlayerPos(playerid, x, y, z);
for(new i; i<MAX_PLAYERS_EX; i++)
{
Item[playerid] = CreatePlayerObject(i,ItemID[playerid],x,y,z-1,0,0,0,0.0);
}



Re: Object won't destroy - Anuris - 22.01.2015

pawn Код:
for(new i; i<MAX_PLAYERS_EX; i++)
{
Item[i] = CreatePlayerObject(i,ItemID[i],x,y,z-1,0,0,0,0.0);
}
pawn Код:
for(new i; i<MAX_PLAYERS_EX; i++)
{
DestroyPlayerObject(i,Item[i]);
}



Re: Object won't destroy - Riso135 - 22.01.2015

This is bullshit coz it will destroy everyones Item. I just need when the current player destroys it (via dialog), it will change the HaveItem = 0 (done) and other player won't see that Item-Object anymore. At this part when player does it(destroys object) it do not disappear.


Re: Object won't destroy - Riso135 - 23.01.2015

bump, any help?


Re: Object won't destroy - Riso135 - 23.01.2015

bump