very simple help! - 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: very simple help! (
/showthread.php?tid=625913)
very simple help! -
Learn - 08.01.2017
I use this attach:
SetPlayerAttachedObject( playerid, 2, 18634, 7,0.000000, 0.100000, 0.350000, -35.224993, 45.215000, 1.500000, 5.000000,1.500000, 1.500000);
and use this for destroy the attach but it's not destroy: DestroyObject(18634);
Re: very simple help! -
Learn - 08.01.2017
to use this ?
DestroyDynamicObject
Re: very simple help! -
Sew_Sumi - 08.01.2017
You don't do that...
You're using the actual ModelID of the object, you should be tracking the created object via a variable
Код:
Object[playerid] = SetPlayerAttachedObject( playerid, 2, 18634, 7,0.000000, 0.100000, 0.350000, -35.224993, 45.215000, 1.500000, 5.000000,1.500000, 1.500000);
Код:
DestroyObject(Object[playerid]);
This is probably entirely wrong, but the main thing is that you need to track the actual object, so you can destroy it, as the model ID isn't what it goes off.
It's similar to cars... If you spawn cars, you can put
Код:
AdminCar = CreateVehicle(bla,de,bla);
then you can use AdminCar in if statements and other areas.
Each one that is created will make the object ID for the next increment, hence why you need to track it.
Re: very simple help! -
Learn - 08.01.2017
Quote:
Originally Posted by Sew_Sumi
You don't do that...
You're using the actual ModelID of the object, you should be tracking the created object via a variable
Код:
Object[playerid] = SetPlayerAttachedObject( playerid, 2, 18634, 7,0.000000, 0.100000, 0.350000, -35.224993, 45.215000, 1.500000, 5.000000,1.500000, 1.500000);
Код:
DestroyObject(Object[playerid]);
This is probably entirely wrong, but the main thing is that you need to track the actual object, so you can destroy it, as the model ID isn't what it goes off.
It's similar to cars... If you spawn cars, you can put
Код:
AdminCar = CreateVehicle(bla,de,bla);
then you can use AdminCar in if statements and other areas.
Each one that is created will make the object ID for the next increment, hence why you need to track it.
|
I understand, Thank u very much!
Re: very simple help! -
Learn - 08.01.2017
Quote:
Originally Posted by Sew_Sumi
You don't do that...
You're using the actual ModelID of the object, you should be tracking the created object via a variable
Код:
Object[playerid] = SetPlayerAttachedObject( playerid, 2, 18634, 7,0.000000, 0.100000, 0.350000, -35.224993, 45.215000, 1.500000, 5.000000,1.500000, 1.500000);
Код:
DestroyObject(Object[playerid]);
This is probably entirely wrong, but the main thing is that you need to track the actual object, so you can destroy it, as the model ID isn't what it goes off.
It's similar to cars... If you spawn cars, you can put
Код:
AdminCar = CreateVehicle(bla,de,bla);
then you can use AdminCar in if statements and other areas.
Each one that is created will make the object ID for the next increment, hence why you need to track it.
|
get errors
Re: very simple help! -
silverms - 08.01.2017
try this
Код:
RemovePlayerAttachedObject(playerid, 1);
Re: very simple help! -
Learn - 08.01.2017
Quote:
Originally Posted by silverms
try this
Код:
RemovePlayerAttachedObject(playerid, 1);
|
OK, thanks!
Re: very simple help! -
Sew_Sumi - 08.01.2017
Better topic for next time in relation to this would be "SetPlayerAttachedObject help" or something more reflective of the topic ;P