SA-MP Forums Archive
Set object 'money safe' - 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: Set object 'money safe' (/showthread.php?tid=516096)



Set object 'money safe' - Ercha - 29.05.2014

So i want the object "money safe" to be appeared while the player is robbing.

Only i don't know how to add the money safe object in stores/interiors. With what function. I though that it's SetObjectPos, but nothing worked.

Also when player finish his robbing, the money fase must disappear.


It's something similar like from CNR servers.


Re: Set object 'money safe' - Eth - 29.05.2014

first of all money safe id :1829
and then you have to get the player pos:
using GetPlayerPos then create the object in the player x,y,z
and when the player finish robbing destroy the object.


Re: Set object 'money safe' - Josh_Main - 30.05.2014

pawn Код:
{
new Float: x, Float: y, Float: z;
GetPlayerPos(playerid, x,y,z);
{
if(IsPlayerInRangeOfPoint(playerid, range, banklocation x,  banklocation y, banklocation z); return
CreateObject(1829, x,y,z,rotation x, rotation y, rotation z, object drawdistance);
}
else if(!IsPlayerInRangeOfPoint(playerid, range, banklocation x, banklocation y, banklocation z); return
DestroyObject(objectid);
return 1;
}
Don't forget to substitute the locations, I didn't put them in because i didn't know where your script location was based. You'll need to put the rotations etc in aswell. I'm not 100% sure it's right, but you could try it out