False SendClientMessage won't show.
#1

Hello,
any ideas why the SendClientMessage is not showing? It should be displayed when the Player is outside the Area.

PHP код:
if(IsPlayerInArea(playerid, -2079.122070, -270.203887, -2055.852294, -258.532623))
{
    new 
XareaYareaFloat:Zarea;
    
GetPlayerPos(playeridXareaYareaFloat:Zarea);
    if(
Xarea >= -2079.122070 && Xarea <= -270.203887 && Yarea >= -2055.852294 && Yarea <= -258.532623)
    {
        
SendClientMessage(playerid,BLUE,"* You're inside this Area."); // This shows normally, it works.
    
}
    else
    {
        
SendClientMessage(playerid,BLUE,"* You're outside this Area"); // This line isn't showing.
        
return 1;
    }

Did i miss something, like "return 1;" or something else?

Thanks.
Reply
#2

Try to remove the return 1; within the else and put it out

PHP код:
if(IsPlayerInArea(playerid, -2079.122070, -270.203887, -2055.852294, -258.532623)) 

    new 
XareaYareaFloat:Zarea
    
GetPlayerPos(playeridXareaYareaFloat:Zarea); 
    if(
Xarea >= -2079.122070 && Xarea <= -270.203887 && Yarea >= -2055.852294 && Yarea <= -258.532623
    { 
        
SendClientMessage(playerid,BLUE,"* You're inside this Area."); // This shows normally, it works. 
    

    else 
    { 
        
SendClientMessage(playerid,BLUE,"* You're outside this Area"); // This line isn't showing. 
        
return 1// delete this!
    

    return 
1//here

Reply
#3

Thanks, but nothing changed. After that, i can't use any other command. Something is here wrong, but can't really find, what's cause the problem. Code seems to be correct.
Reply
#4

Code might be correct indeed but then you have to look at calculations. THere is a reason why it never prints out that "You're outside this area" and it's not because SendClientMessage all the sudden bugged out.

I'd bet you money that it's the fact that it never gets inside because of this:
if(IsPlayerInArea(playerid, -2079.122070, -270.203887, -2055.852294, -258.532623))

Why? By the looks of it you are checking same thing twice.
Reply
#5

Oh! Thank you. And i'm wondering why this isn't working Tried most codes, changed, but nah. so, Thank you, it works.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)