How to know ID of object i just created? - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: How to know ID of object i just created? (
/showthread.php?tid=657233)
How to know ID of object i just created? -
R3SpaWn0 - 03.08.2018
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
Re: How to know ID of object i just created? -
coool - 03.08.2018
https://sampwiki.blast.hk/wiki/CreateObject.
See the "return values"
Re: How to know ID of object i just created? -
R3SpaWn0 - 03.08.2018
Quote:
Originally Posted by coool
|
I don't understand nothing.. fuck..
Re: How to know ID of object i just created? -
GospodinX - 03.08.2018
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]);
Re: How to know ID of object i just created? -
Sew_Sumi - 03.08.2018
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.
Re: How to know ID of object i just created? -
R3SpaWn0 - 03.08.2018
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