How to save something somewhere.
#1

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.
Reply
#2

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;
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)