Auto Spawn Object
#1

Hi,

I'm wanting to spawn an object (health to be specific).

Quote:

Health ID: 1240

Код:
public OnGameModeInit()
{
    CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0, 0, 96);
    return 1;
}

I want it to do this ideally:
Quote:

IF player is on the health object THEN
user hp = 100
destory object
timer 5000
spawn health object


I had a bash at it, but probably screwed it up lol

Код:
public OnGameModeInit()
{
    CreateObject(2587, 2001.195679, 1547.113892, 14.283400, 0, 0, 1240);
    SetPlayerHealth(playerid,100);
    DestroyPickup(????);
    return 1;
}
thanks
Reply
#2

Take a look at this, see if you can figure it out yourself. This does basically the same, but with weapons.

http://pastebin.com/XVbNhXxK
Reply
#3

pawn Код:
CMD:pickup(playerid, params[])
{
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y ,z);
    CreatePickup(1240, 2, x, y, z, 0); // creates a pickup at your location
    return 1;
}
or

new Health;

pawn Код:
public OnGameModeInit()
{
    Health = createpickup(1242, 2, x, y, z);
}
Actually, when you pick that pickup ^ it will respawn after some time. if it is the health one, it will automatically give you health. just insert your coordinates
Reply
#4

nice thanks very much, I didn't know it was auto built in!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)