27.09.2013, 12:02
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.
#include <zcmd> #include <a_samp>
new Float:x, Float:y, Float:z, Float:rot; new bombtimer; new bomb;
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; }