Why object don't destroy? DestroyDynamicObject
#1

Hi, i have a script and it almost works... the object is created in game but when i call it with cmd its not destroying..
i read about add DestroyPlayerObject(playerid, objectid); but i dont want to use playerid id becouse i want to remove object for all players? what its the problem guys? :S


PHP Code:
//The Object Create is working
    
GetPlayerPos(playerid,x,y,z);
    
CreateDynamicObject(Object2,x,y,z,0,0,0); 
PHP Code:
When i call it from CMD no..
    
Delete3DTextLabel(Text2);
    
DestroyDynamicObject(Object2); 
Reply
#2

Define that object, put on top

PHP Code:
new object;

object CreateDynamicObject(ID OF OBJECT,x,y,z,0,0,0); //on create to define "object"

DestroyDynamicObject(object);  //destroying defined "object" 
Reply
#3

By what I understand from your small little snippet, you're trying to destroy an object by the variable Object2, however, you're creating an object with the model Object2... seems to me you're entering a model ID instead of object ID.

edit: awww, daniel was a second quicker than me ;(
Reply
#4

Quote:
Originally Posted by DBZdabIt3Bro7
View Post
By what I understand from your small little snippet, you're trying to destroy an object by the variable Object2, however, you're creating an object with the model Object2... seems to me you're entering a model ID instead of object ID.

edit: awww, daniel was a second quicker than me ;(
maybe he has somewhere defined Object2 as some ID of object yes...

who is daniel?
Reply
#5

Quote:
Originally Posted by David (Sabljak)
View Post
maybe he has somewhere defined Object2 as some ID of object yes...

who is daniel?
this is daniel


Reply
#6

Quote:
Originally Posted by DBZdabIt3Bro7
View Post
this is daniel


I can't define the object to create on gamemode init, the object have to create when a player die!!
Then i when i cmd, the object has to destroy, now you understand me? :S
Reply
#7

Quote:
Originally Posted by R3SpaWn0
View Post
I can't define the object to create on gamemode init, the object have to create when a player die!!
Then i when i cmd, the object has to destroy, now you understand me? :S
not at all. not even close.
Reply
#8

I'm pretty sure you're going to have trouble if you can't actually take note of the advice you are being given.

Use an array, you're just chopping and changing in the vain effort to FLUKE a fix.
Reply
#9

Quote:
Originally Posted by Sew_Sumi
View Post
I'm pretty sure you're going to have trouble if you can't actually take note of the advice you are being given.

Use an array, you're just chopping and changing in the vain effort to FLUKE a fix.
Lol,i have all day scripting thinks.. i scripted job , job commands and faction, i know to use a little bit good variables and if/else, the problem is this that i dont know, i m asking what i should use array? i will figure it out..
Reply
#10

Hold on, what?

You say you've scripted a job and faction, yet don't know to use a variable to track something?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)