SA-MP Forums Archive
CMD help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: CMD help (/showthread.php?tid=607923)



CMD help - N0FeaR - 25.05.2016

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."); 



Re: CMD help - Darkwood17 - 25.05.2016

Код:
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");



Re: CMD help - N0FeaR - 25.05.2016

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.


Re: CMD help - zDivine - 25.05.2016

Код:
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."); 
}



Re: CMD help - Konstantinos - 25.05.2016

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.


Re: CMD help - N0FeaR - 25.05.2016

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!


Re: CMD help - zDivine - 25.05.2016

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.