If i do this , would it be buggy ?
#1

Hello there,

I'm making alot of pickups for health in my gamemode and i'm trying to find a efficiлnt way to make it.
So my question is, would this work what i made here? and do you know a more efficiлnt way
then please share it with me.
above ongamemodeinit;
Code:
new Heal;
under ongamemodeinit;
Code:
Heal = CreatePickup(1240 , 2, 2261.6921,-71.1853,31.6016, -1);
Heal = CreatePickup(1240 , 2, 2261.6921,-71.1853,31.6016, -1);
Heal = CreatePickup(1240 , 2, 2261.6921,-71.1853,31.6016, -1);
Heal = CreatePickup(1240 , 2, 2261.6921,-71.1853,31.6016, -1);
Heal = CreatePickup(1240 , 2, 2261.6921,-71.1853,31.6016, -1);
Heal = CreatePickup(1240 , 2, 2261.6921,-71.1853,31.6016, -1);
Heal = CreatePickup(1240 , 2, 2261.6921,-71.1853,31.6016, -1);
Heal = CreatePickup(1240 , 2, 2261.6921,-71.1853,31.6016, -1);
Under Onplayerpickup;
Code:
  if(pickupid == Heal) {

	//SendClientMessage(playerid, 0xDEEE20FF, "you healed yourself");
	SetPlayerHealth(playerid, 100.0);
	}



	return 1;
}
Reply
#2

pawn Code:
new Heal[8];

Heal[0] = CreatePickup(1240 , 2, 2261.6921,-71.1853,31.6016, -1);
Heal[1] = CreatePickup(1240 , 2, 2261.6921,-71.1853,31.6016, -1);
Heal[2] = CreatePickup(1240 , 2, 2261.6921,-71.1853,31.6016, -1);
Heal[3] = CreatePickup(1240 , 2, 2261.6921,-71.1853,31.6016, -1);
Heal[4] = CreatePickup(1240 , 2, 2261.6921,-71.1853,31.6016, -1);
Heal[5] = CreatePickup(1240 , 2, 2261.6921,-71.1853,31.6016, -1);
Heal[6] = CreatePickup(1240 , 2, 2261.6921,-71.1853,31.6016, -1);
Heal[7] = CreatePickup(1240 , 2, 2261.6921,-71.1853,31.6016, -1);


for(new S = 0; S<8; S++)
{
    if(pickupid == Heal[S])
    {
      //SendClientMessage(playerid, 0xDEEE20FF, "you healed yourself");
      SetPlayerHealth(playerid, 100.0);
   }
}
Your code would make only the last one work.
Reply
#3

Quote:

Your code would make only the last one work.

LOL yeah so i noticed that

Thanks for the help
Reply
#4

If player picks up a heart pickup, he is automatically healed. So you don't need to use SetPlayerHealth anymore.
Reply
#5

Quote:
Originally Posted by MadeMan
If player picks up a heart pickup, he is automatically healed. So you don't need to use SetPlayerHealth anymore.
false
Reply
#6

Quote:
Originally Posted by [DM
Kane ]
Quote:
Originally Posted by MadeMan
If player picks up a heart pickup, he is automatically healed. So you don't need to use SetPlayerHealth anymore.
false
Lol, have you even tried it?
Reply
#7

Quote:
Originally Posted by [DM
Kane ]
Quote:
Originally Posted by MadeMan
If player picks up a heart pickup, he is automatically healed. So you don't need to use SetPlayerHealth anymore.
false
I got in my server heal pickups and I dind add SetPlayerHealth, and works.
Reply
#8

Quote:
Originally Posted by Fedee!
Quote:
Originally Posted by [DM
Kane ]
Quote:
Originally Posted by MadeMan
If player picks up a heart pickup, he is automatically healed. So you don't need to use SetPlayerHealth anymore.
false
I got in my server heal pickups and I dind add SetPlayerHealth, and works.
Lol sorry, didnt tried it in 0.3
Reply
#9

Quote:
Originally Posted by [DM
Kane ]
Quote:
Originally Posted by Fedee!
Quote:
Originally Posted by [DM
Kane ]
Quote:
Originally Posted by MadeMan
If player picks up a heart pickup, he is automatically healed. So you don't need to use SetPlayerHealth anymore.
false
I got in my server heal pickups and I dind add SetPlayerHealth, and works.
Well, if im not wrong, in 0.2 also works without that.

Lol sorry, didnt tried it in 0.3
Reply
#10

Quote:
Originally Posted by Fedee!
Quote:
Originally Posted by [DM
Kane ]
Quote:
Originally Posted by Fedee!
Quote:
Originally Posted by [DM
Kane ]
Quote:
Originally Posted by MadeMan
If player picks up a heart pickup, he is automatically healed. So you don't need to use SetPlayerHealth anymore.
false
I got in my server heal pickups and I dind add SetPlayerHealth, and works.
Lol sorry, didnt tried it in 0.3
Well, if im not wrong, in 0.2 also works without that.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)