How to save something somewhere. - 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 save something somewhere. (
/showthread.php?tid=466324)
How do you save a certain pos? Like a register. -
Jason_Roul - 27.09.2013
For example, let's say I want to save a certain position to stay there, until I do a command which will do something at that position, and then delete it. How do I do that? Like a bomb for example.
Re: How to save something somewhere. -
sansk - 27.09.2013
I'm not sure if i understood but i will try to show u, using zcmd..
at the very top:
Код:
#include <zcmd>
#include <a_samp>
on the top of your script:
Код:
new Float:x, Float:y, Float:z, Float:rot;
new bombtimer;
new bomb;
ZCMD:
Код:
CMD:plantbomb(playerid, params[])
{
GetPlayerPos(playerid, x, y, z);
bombtimer = SetTimer("Explosion", 30000, false);
GetPlayerFacingAngle(playerid, rot);
bomb = CreateObject(1252, x, y, z, rot, 0.0, 0.0, 96.0);
return 1;
}
forward Explosion();
public Explosion()
{
CreateExplosion(x, y, z, 12, 500.0); //pos x, y, z, type of explosion, radius of explosion.
}
CMD:removebomb(playerid, params[])
{
KillTimer(bombtimer);
DestroyObject(bomb);
return 1;
}