DestroyObject Problem -
zombieking - 02.06.2012
At First, Hello All! Here is my problem:
Here is my code:
pawn Код:
new sirenturn1;
new sirenturn2;
new sirenturn3;
So I've declared 3 NEWs...
pawn Код:
sirenturn1 = CreateObject( 19419,0,0,0,0,0,0,80 );
sirenturn2 = CreateObject( 19419,0,0,0,0,0,0,80 );
sirenturn3 = CreateObject( 19419,0,0,0,0,0,0,80 );
I assigned them to objects...
pawn Код:
if (newkeys & KEY_CROUCH)
{
DestroyObject(sirenturn1);
DestroyObject(sirenturn2);
DestroyObject(sirenturn3);
}
No errors at compiling... But it does NOT destroy the objects.. Why?
Thanks in advance!
Re: DestroyObject Problem -
Sandiel - 02.06.2012
Show more code....
If no one can help you, try to change them to CreatePlayerObject, and DestroyPlayerObject.
Re: DestroyObject Problem -
zombieking - 02.06.2012
I do not have more code to show.. That is simply for testing.. A blank GM in which I added that code.. Nothing more
Re: DestroyObject Problem -
Sandiel - 02.06.2012
Hmm, I dunno about the GetPlayerKeys.....
but try to change the key, or make a CMD instead, or even try to see if the key exists?
Re: DestroyObject Problem -
MadeMan - 02.06.2012
Quote:
Originally Posted by zombieking
pawn Код:
sirenturn1 = CreateObject( 19419,0,0,0,0,0,0,80 ); sirenturn2 = CreateObject( 19419,0,0,0,0,0,0,80 ); sirenturn3 = CreateObject( 19419,0,0,0,0,0,0,80 );
I assigned them to objects...
|
Where?
Re: DestroyObject Problem -
leonardo1434 - 02.06.2012
pawn Код:
// on top of the game mode.
#define PRESSED(%0) \
(((newkeys & (%0)) == (%0)) && ((oldkeys & (%0)) != (%0)))
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
if (PRESSED(KEY_CROUCH)
{
DestroyObject(sirenturn1);
DestroyObject(sirenturn2);
DestroyObject(sirenturn3);
}
return 1;
}
Re: DestroyObject Problem -
zombieking - 03.06.2012
No man.. I tried with a command too.... not working
Re: DestroyObject Problem -
newbienoob - 03.06.2012
pawn Код:
if (newkeys == KEY_CROUCH)
Re: DestroyObject Problem -
zombieking - 03.06.2012
WHAT YOU DIDN'T UNDERSTAND !? IT IS
NOT WORKING EVEN IN A COMMAND , WHY SHOULD I TRY THAT?
Re: DestroyObject Problem -
Azazelo - 03.06.2012
This 3 object are on same cord and may be you destroy one of them but you get a graphic bug,
Quote:
sirenturn1 = CreateObject( 19419,0,0,0,0,0,0,80 );
sirenturn2 = CreateObject( 19419,0,0,0,0,0,0,80 );
sirenturn3 = CreateObject( 19419,0,0,0,0,0,0,80 );
|
A question are you define global or local this 3 object ?
Quote:
new sirenturn1;
new sirenturn2;
new sirenturn3;
|