Aww my little capture system aint working :'(
#1

I just made a Capture system but i got several problems. One is when the timer is finished it still aint destroyed (Like the timer keeps continuing to -1:99 which i dont want) and Secondly One main textdraw is being hidden. I'm not very sure whats wrong.

heres my code:
pawn Код:
forward BombCounterAtCP1();
public BombCounterAtCP1()
{
    BombCountAtCP1 --;
    new tmp[256];
    TextDrawDestroy(Text:CCP1);
    format(tmp, sizeof tmp, "~r~The bomb is exploding in:~y~~n~%s", TimeConvert(BombCountAtCP1)

    CCP1 = TextDrawCreate(234.0, 361.0, tmp);
    TextDrawSetShadow(Text:CCP1, 0);
    TextDrawSetOutline(Text:CCP1, 1);
    TextDrawShowForAll(Text:CCP1);
    if (IsDefusedAtCP1) {
        TextDrawDestroy(Text:CCP1);
    }
    else if (BombCountAtCP1 == 0) {
        TextDrawDestroy(Text:CCP1);
    }
}
Aww wtf is wrong Help me out pls
Reply
#2

1) If 'BombCountAtCP1' is what checks the time left, you might use if(BombCountAtCP1 == 0) or something like that
2) AFAIK, you don't need to do TextDrawDestroy(Text:CCP1), correct me if I'm wrong
3) You're creating textdraw CCP1, but later it looks like you're destroying it:

pawn Код:
CCP1 = TextDrawCreate(234.0, 361.0, tmp);
    if (IsDefusedAtCP1) {
        TextDrawDestroy(Text:CCP1);
    }
    else if (BombCountAtCP1 == 0) {
        TextDrawDestroy(Text:CCP1);
    }
}
Can you do something with that?
Reply
#3

Quote:
Originally Posted by Hiddos
Посмотреть сообщение
1) If 'BombCountAtCP1' is what checks the time left, you might use if(BombCountAtCP1 == 0) or something like that
2) AFAIK, you don't need to do TextDrawDestroy(Text:CCP1), correct me if I'm wrong
3) You're creating textdraw CCP1, but later it looks like you're destroying it:

pawn Код:
CCP1 = TextDrawCreate(234.0, 361.0, tmp);
    if (IsDefusedAtCP1) {
        TextDrawDestroy(Text:CCP1);
    }
    else if (BombCountAtCP1 == 0) {
        TextDrawDestroy(Text:CCP1);
    }
}
Can you do something with that?
I tryed all your ways, none possibly worked.
Reply
#4

When the variable 'BombCountAtCP1' reaches 0 you should destroy the timer.
pawn Код:
if(BombCountAtCP1 == 0) KillTimer(BombCountTimerID);
You also have an error here:
pawn Код:
format(tmp, sizeof tmp, "~r~The bomb is exploding in:~y~~n~%s", TimeConvert(BombCountAtCP1)
It should be:
pawn Код:
format(tmp, sizeof(tmp), "~r~The bomb is exploding in:~y~~n~%s", TimeConvert(BombCountAtCP1));
Reply
#5

Quote:
Originally Posted by Alexander_Varela
Посмотреть сообщение
When the variable 'BombCountAtCP1' reaches 0 you should destroy the timer.
pawn Код:
if(BombCountAtCP1 == 0) KillTimer(BombCountTimerID);
You also have an error here:
pawn Код:
format(tmp, sizeof tmp, "~r~The bomb is exploding in:~y~~n~%s", TimeConvert(BombCountAtCP1)
It should be:
pawn Код:
format(tmp, sizeof(tmp), "~r~The bomb is exploding in:~y~~n~%s", TimeConvert(BombCountAtCP1));
Those 2 bottom one, Yeah i had it like that but maybe when i pasted it didnt do shit?
Ill try it after

Edit: still dont work.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)