How to know ID of object i just created?
#1

Hi, the problem its that when a player die, i create an object, but when i want to destroy it how i know the id?


example:
onplayerdeath

CreateDynamicObject(...etc


when i want to delete that object how i know the id?

i'm coming from here...

https://sampforum.blast.hk/showthread.php?tid=657226


help me please
Reply
#2

https://sampwiki.blast.hk/wiki/CreateObject.
See the "return values"
Reply
#3

Quote:
Originally Posted by coool
Посмотреть сообщение
I don't understand nothing.. fuck..
Reply
#4

Store ID in an (global) variable..

Код:
new pobject[MAX_PLAYERS];
When create object:
Код:
pobject[playerid] = CreateDynamicObject(...
And then when you want to delete it:
Код:
DestroyDynamicObject(pobject[playerid]);
Reply
#5

Quote:
Originally Posted by R3SpaWn0
Посмотреть сообщение
Just a word of advice, to read the rules of the forums which you signed up on 7 years back, and not to spam the forums with multiple threads, or bump your threads any less than 24 hours apart.
Reply
#6

Quote:
Originally Posted by Sew_Sumi
Посмотреть сообщение
Just a word of advice, to read the rules of the forums which you signed up on 7 years back, and not to spam the forums with multiple threads, or bump your threads any less than 24 hours apart.
Sorry, i signed in but i never tried to learn, i come back now 7 years later to learn, never is late, and i m a little obsesed to learn fast, i learned to make my own little systems with variables and statements, now i m laearning for loop to make more complex, sorry, its just i have a lot of questions.. and i use search before i post every time, and if i dont fond answer i write post



EDIT: Gospodin THANKS A LOT !!!!! <3
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)