Pickup Help
#1

Okay so my server has ALOT of health pickups. instead of doing

if(pickupid==health1)
if(pickupid==health2)
if(pickupid==health3)
etc.

is there a faster way to do it? Something like healthpickups={createpickup();createpickup();}

if(pickupid==healthpickups)

thanks in advance
Reply
#2

Simply way
Код:
new HealthPick[YOUR_NUMBER_OF_PICKUPS];

HealthPick[0] = CreatePickup....
HealthPick[1] = CreatePickup....
etc


for(new i; i < YOUR_NUMBER_OF_PICKUPS; i++) {
if(pickupid == HealthPick[i]) {
//something
}
}
Reply
#3

your lazy dude... if you can't do that little bit just to make a pickup, u r not going to make it far in scripting, u need to do all the work thats required man, and stop being lazy.
Reply
#4

Well I doubt that he is lazy, he just is looking for a more efficient way to do it
Reply
#5

Or very fast xD
Код:
#define MAX_HEALTH YOUR_NUMBER_OF_PICKUPS
new HealthPick[MAX_HEALTH];
new Float:PickupCoords[MAX_HEALTH][3] = {
	{X,Y,Z},
	{},
	{},
	{},
	{},
	{}
};
init
Код:
for(new i; i < MAX_HEALTH; i++) {
	HealthPick[i] = CreatePickup(ID, Type, PickupCoords[i][0], PickupCoords[i][1], PickupCoords[i][2]);
}
Reply
#6

lol, i aint trying to be mean, but not all the commands are going to be made easy u know..
Reply
#7

Quote:
Originally Posted by anonymoushacker
lol, i aint trying to be mean, but not all the commands are going to be made easy u know..
I know from experience when i do
Код:
if(pickupid==health1)
if(pickupid==health2)
if(pickupid==health3)
etc.
Then ask for help the first reply i get is for some scripting professional asking me why i wasted all that time and did not use

Код:
#define MAX_HEALTH YOUR_NUMBER_OF_PICKUPS
new HealthPick[MAX_HEALTH];
new Float:PickupCoords[MAX_HEALTH][3] = {
	{X,Y,Z},
	{},
	{},
	{},
	{},
	{}
};
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)