merging comand
#1

Hi all i tried to merge these moveobject codes into one command but i got a lot of errors so i would like to ask for assistance with it...

Код:
CMD:fd(playerid, params[])
{
	new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(!IsAFBI(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an FBI Agent.");
	if(IsPlayerInRangeOfPoint(playerid, 3, 1558.970703125, -1677.9114990234, 1722.1081542969))
	{
	    if(!FBILobbyStatus) // SAPD LOBBY
	    {
     		MoveObject(fbidoor1,1558.1387939453, -1677.8883056641, 1722.1081542969,1.50);
     		MoveObject(fbidoor2,1562.7950439453, -1677.8798828125, 1722.1081542969,1.50);
	    	format(string, sizeof(string), "* %s puts their finger on the scanner and opens the lobby door.", RPN(playerid));
			SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
     		FBILobbyStatus = 1;
		}
	    else if(FBILobbyStatus)
	    {
			MoveObject(fbidoor1,1558.970703125, -1677.9114990234, 1722.1081542969,1.50);
     		MoveObject(fbidoor2,1561.9755859375, -1677.8798828125, 1722.1081542969,1.50);
			format(string, sizeof(string), "* %s %s puts their finger on the scanner and closes the lobby doors.", RPN(playerid));
			SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
   			FBILobbyStatus = 0;
	    }
	}
	return 1;
}

CMD:fd1(playerid, params[])
{
	new string[128];
    if(!IsPlayerLoggedIn(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You need to login first before using any command.");
	if(!IsAFBI(playerid)) return SendClientMessage(playerid, COLOR_GREY, "You are not an FBI Agent.");
	if(IsPlayerInRangeOfPoint(playerid, 3, 1552.7789306641, -1691.4653320313, 1722.1081542969))
	{
	    if(!FBILobbyStatus) // SAPD LOBBY
	    {
    		MoveObject(fbidoor3,1549.6147460938, -1691.4772949219, 1722.1081542969,1.50);
     		MoveObject(fbidoor4,1554.2923583984, -1691.4328613281, 1722.1081542969,1.50);
	    	format(string, sizeof(string), "* %s puts their finger on the scanner and opens the lobby door.", RPN(playerid));
			SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
     		FBILobbyStatus = 1;
		}
	    else if(FBILobbyStatus)
	    {
			MoveObject(fbidoor3,1550.4266357422, -1691.5009765625, 1722.1081542969,1.50);
   			MoveObject(fbidoor4,1553.4294433594, -1691.4515380859, 1722.1081542969,1.50);
			format(string, sizeof(string), "* %s %s puts their finger on the scanner and closes the lobby doors.", RPN(playerid));
			SendNearbyMessage(playerid, 15, string, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE, COLOR_PURPLE);
   			FBILobbyStatus = 0;
	    }
	}
	return 1;
}
that is both commands but i would like one command to operate both but not together as they are in separate areas
Reply
#2

show us the final code + errors you`re getting
Reply
#3

I removed the one I had made as it wasn't working and it came up with a load of errors about other things not working that weren't even in that command
Reply
#4

PHP код:
CMD:fd(playeridparams[])
{
    new 
string[128];
    if(!
IsPlayerLoggedIn(playerid)) return SendClientMessage(playeridCOLOR_GREY"You need to login first before using any command.");
    if(!
IsAFBI(playerid)) return SendClientMessage(playeridCOLOR_GREY"You are not an FBI Agent.");
    if(
IsPlayerInRangeOfPoint(playerid31558.970703125, -1677.91149902341722.1081542969))
    {
        if(!
FBILobbyStatus// SAPD LOBBY
        
{
             
MoveObject(fbidoor1,1558.1387939453, -1677.88830566411722.1081542969,1.50);
             
MoveObject(fbidoor2,1562.7950439453, -1677.87988281251722.1081542969,1.50);
            
format(stringsizeof(string), "* %s puts their finger on the scanner and opens the lobby door."RPN(playerid));
            
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
             
FBILobbyStatus 1;
        }
        else if(
FBILobbyStatus)
        {
            
MoveObject(fbidoor1,1558.970703125, -1677.91149902341722.1081542969,1.50);
             
MoveObject(fbidoor2,1561.9755859375, -1677.87988281251722.1081542969,1.50);
            
format(stringsizeof(string), "* %s %s puts their finger on the scanner and closes the lobby doors."RPN(playerid));
            
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
               
FBILobbyStatus 0;
        }
    }
        if(
IsPlayerInRangeOfPoint(playerid31552.7789306641, -1691.46533203131722.1081542969))
    {
        if(!
FBILobbyStatus// SAPD LOBBY
        
{
            
MoveObject(fbidoor3,1549.6147460938, -1691.47729492191722.1081542969,1.50);
             
MoveObject(fbidoor4,1554.2923583984, -1691.43286132811722.1081542969,1.50);
            
format(stringsizeof(string), "* %s puts their finger on the scanner and opens the lobby door."RPN(playerid));
            
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
             
FBILobbyStatus 1;
        }
        else if(
FBILobbyStatus)
        {
            
MoveObject(fbidoor3,1550.4266357422, -1691.50097656251722.1081542969,1.50);
               
MoveObject(fbidoor4,1553.4294433594, -1691.45153808591722.1081542969,1.50);
            
format(stringsizeof(string), "* %s %s puts their finger on the scanner and closes the lobby doors."RPN(playerid));
            
SendNearbyMessage(playerid15stringCOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLECOLOR_PURPLE);
               
FBILobbyStatus 0;
        }
    }
    return 
1;

Shouldn't be a hard thing.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)