Posts: 2,593
Threads: 34
Joined: Dec 2007
Is there a way to do something like
pawn Code:
public blablabla
{
if(something == 999 && !IsPlayerInArea(...))
else if(!IsPlayerInCube(...))
{
//code
}else{
//code
}
return 1;
}
2 functions in 1 public
Posts: 212
Threads: 15
Joined: Jan 2008
Reputation:
0
Yes. Why wouldn't it be possible?
Posts: 2,593
Threads: 34
Joined: Dec 2007
22.11.2010, 15:42
(
Last edited by Jefff; 22/11/2010 at 05:00 PM.
)
So can u give me an example?
or someone else
Posts: 2,593
Threads: 34
Joined: Dec 2007
Posts: 2,593
Threads: 34
Joined: Dec 2007
I dont want that, its too long for me
pawn Code:
public blablabla
{
if(something == 999)
{
if(!IsPlayerInArea(...))
{
//code
}else{
//code
}
}else{
if(!IsPlayerInCube(...))
{
//code
}else{
//code
}
}
return 1;
}
is there a way to shorten this code for example
pawn Code:
public blablabla
{
if(something == 999 && !IsPlayerInArea(...))
else if(!IsPlayerInCube(...))
{
//code
}else{
//code
}
return 1;
}
only these 2 lines
pawn Code:
if(something == 999 && !IsPlayerInArea(...))
else if(!IsPlayerInCube(...))
Posts: 560
Threads: 32
Joined: Aug 2010
Reputation:
0
I suggest you to not mix else if, like
if(IHaveApple == 1) { Says: I have one apple; }
else if(IHaveBerries == 2) { Says: I have two berries; }
else if(IHaveApple == 2) { Says: I have two apple; }
I hope you got it what I mean, you should use if .. if, if you compare different things.
Posts: 2,593
Threads: 34
Joined: Dec 2007
Ok solved, i am genious xD
!!! fuck jea