DestroyObject
#1

This is the CreateObject code :
PHP код:
CMD:cbarrier(playerid,params[])
{
        new 
Float:xFloat:yFloat:z;
        new 
Float:a;
    
GetPlayerPos(playeridxyz);
    
GetPlayerFacingAngle(playerida);
    
CreateObject(1422x+5,y,z,0,0,a); // change the object id
    
SendClientMessage(playerid, -1"You have spawned a barrier.");
    return 
1;

And the DestroyObject code:
PHP код:
CMD:rbarrier(playerid,params[])
{
DestroyObject(1422); // change the object id
SendClientMessage(playerid, -1"You have removed a barrier");
return 
1;

The CreateObject command works but the DestroyObject one doesn't work.
Please Help !!
Reply
#2

You have to use the actual id of the object to destroy it, not the model-id.

pawn Код:
new Object1;

Object1 = CreateObject(blablabla);

DestroyObject(Object1);
Reply
#3

Another thing how to prevent player from making more than one object untill he removed the other ??
Reply
#4

I thought i told you already
Reply
#5

Yea but there was a problem in DestroyObject as i said and you didn't tell me about max object but thank you btw
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)