Objects Attaching help
#1

Hello,

So I have created an object and this is how it looks.

pawn Код:
new shark;
- Above OnGameModeInit

pawn Код:
shark = CreateObject(1608,blabla);
pawn Код:
if(strcmp(cmdtext, "/shark", true) == 0)
    {
    AttachObjectToPlayer(shark, playerid,0,0,0,0,0,0);
    return 1;
    }
I left it like this, but when I died, the object was where I died, left alone( :P ). So I added this

pawn Код:
DestroyObject(shark)
- I added OnPlayerDisconnect and OnPlayerDeath.

But then I can't type shark anymore. I know it's because I destroyed it but how can I make it that I can type again ?
( without removing the DestroyObject(shark) ofcourse )

What must I add ? [MAX_PLAYERS] somewhere or what ?
I tried but I got multiple errors ( because I have more than just the shark ), therefore I decided to post it here.
Reply
#2

pawn Код:
if(strcmp(cmdtext, "/shark", true) == 0)
    {
shark = CreateObject(1608,blabla);
    AttachObjectToPlayer(shark, playerid,0,0,0,0,0,0);
    return 1;
    }
Reply
#3

Oh god, why didn't I think of creating the object when you type so xD

Thanks dice, really
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)