DestroyObject Problem
#1

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!
Reply
#2

Show more code....
If no one can help you, try to change them to CreatePlayerObject, and DestroyPlayerObject.
Reply
#3

I do not have more code to show.. That is simply for testing.. A blank GM in which I added that code.. Nothing more
Reply
#4

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?
Reply
#5

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?
Reply
#6

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;
}
Reply
#7

No man.. I tried with a command too.... not working
Reply
#8

pawn Код:
if (newkeys == KEY_CROUCH)
Reply
#9

WHAT YOU DIDN'T UNDERSTAND !? IT IS NOT WORKING EVEN IN A COMMAND , WHY SHOULD I TRY THAT?
Reply
#10

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;

Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)