CMD help
#1

When the coordinates is 0.0 it suppose to give this message "No exterior set for this house contact an Lead Admin"
But it doesn't work maybe u guys can help me out? thanks in advance


PHP код:
CMD:enter(playeridparams[])
{
    for(new 
1sizeof(HouseInfo); h++)
    {
        if(
IsPlayerInRangeOfPoint(playerid2.0HouseInfo[h][hEntranceX], HouseInfo[h][hEntranceY], HouseInfo[h][hEntranceZ]))
        {
               if(
GetPlayerVirtualWorld(playerid) == HouseInfo[h][hWorld])
            {
                if(
HouseInfo[h][hLocked] == 0)
                 {
                     if(
HouseInfo[h][hEntranceX], HouseInfo[h][hEntranceY], HouseInfo[h][hEntranceZ] == 0.000000)
                    {
                         
SendErrorMessage(playerid"No exterior set for this house contact an Lead Admin");
                     }
                    
SetPlayerPos(playeridHouseInfo[h][hExitX], HouseInfo[h][hExitY], HouseInfo[h][hExitZ]);
                     
SetPlayerFacingAngle(playeridHouseInfo[h][hExitA]);
                     
SetPlayerInterior(playeridHouseInfo[h][hInsideInt]);
                     
SetPlayerVirtualWorld(playeridHouseInfo[h][hInsideWorld]);
                     
InsideHouse[playerid] = h;
                     
TogglePlayerControllable(playerid,0);
                     
GameTextForPlayer(playerid"~r~Loading Objects"30005);
                     
SetTimerEx("LoadInterior"3000false"i"playerid);
                     return 
1;
                }
                else 
SendErrorMessage(playerid"This house is locked."); 
Reply
#2

Код:
if(HouseInfo[h][hEntranceX], HouseInfo[h][hEntranceY], HouseInfo[h][hEntranceZ] == 0.0) return SendErrorMessage(playerid, "No exterior set for this house contact an Lead Admin");
Reply
#3

Quote:
Originally Posted by Darkwood17
Посмотреть сообщение
Код:
if(HouseInfo[h][hEntranceX], HouseInfo[h][hEntranceY], HouseInfo[h][hEntranceZ] == 0.0) return SendErrorMessage(playerid, "No exterior set for this house contact an Lead Admin");
Still same problem.
Reply
#4

Код:
if(HouseInfo[h][hEntranceX] == 0.0 && HouseInfo[h][hEntranceY] == 0.0 && HouseInfo[h][hEntranceZ] == 0.0) 
{ 
     SendErrorMessage(playerid, "There's no exterior set for this house, please contact a Lead Admin."); 
}
Reply
#5

You need to check each variable individually.
pawn Код:
if(!HouseInfo[h][hEntranceX] && !HouseInfo[h][hEntranceY] && !HouseInfo[h][hEntranceZ])
and use return to stop the code there.

EDIT:
Quote:
Originally Posted by zDivine
Посмотреть сообщение
Код:
if(HouseInfo[h][hEntranceX] && HouseInfo[h][hEntranceY] && HouseInfo[h][hEntranceZ] == 0.000000) 
{ 
     SendErrorMessage(playerid, "There's no exterior set for this house, please contact a Lead Admin."); 
}
Neither that, editing the post won't help.
Reply
#6

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
You need to check each variable individually.
pawn Код:
if(!HouseInfo[h][hEntranceX] && !HouseInfo[h][hEntranceY] && !HouseInfo[h][hEntranceZ])
and use return to stop the code there.

EDIT:


Neither that, editing the post won't help.
Thanks to all of you, rep! this helped!
Reply
#7

Quote:
Originally Posted by Konstantinos
Посмотреть сообщение
You need to check each variable individually.
pawn Код:
if(!HouseInfo[h][hEntranceX] && !HouseInfo[h][hEntranceY] && !HouseInfo[h][hEntranceZ])
and use return to stop the code there.

EDIT:


Neither that, editing the post won't help.
You're wrong there, buddy.

Код:
if(HouseInfo[h][hEntranceX] == 0.0 && HouseInfo[h][hEntranceY] == 0.0 && HouseInfo[h][hEntranceZ] == 0.0)
This works the exact same way. But nice try editing the quote to make it look different. Lol.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)