Openbay(gate) 2 commands into 1
#2

With something like:
PHP код:
CMD:bay(playerid,params[])
{
if((
PlayerInfo[playerid][pFaction] != 2) && (PlayerInfo[playerid][pFaction] != 3))
return 
SCM(playeridCOLOR_LIGHTRED"You're not a Faction member.");
if(!
strcmp(params,"open",true)) //the true means that OpEn will be the same with OPEn etc. (ignore uppercase:true)
{
        if(
IsPlayerInRangeOfPoint(playerid8.0,-2534.179442347.453615.94538))
        {
             
MoveObject(fdgate1,-2534.17942348.41367.8590,0.50,0.0000090.000090.0000);
        }
        else if(
IsPlayerInRangeOfPoint(playerid7.0,-2526.271732347.453615.94540))
        {
            
MoveObject(fdgate2,-2526.27172348.41367.8590,0.50,09090);
        }
        else if(
IsPlayerInRangeOfPoint(playerid7.0,-2518.360842347.453615.94540))
        {
            
MoveObject(fdgate3,-2518.36082348.41367.8590,0.50,09090);
        }
        return 
1
}
else if(!
strcmp(params,"close",true))
{
        if(
IsPlayerInRangeOfPoint(playerid8.0,-2534.179442347.453615.94538))
        {
             
MoveObject(fdgate1,-2534.179442347.453615.94538,0.50,0.000000.000090.0000);
        }
        else if(
IsPlayerInRangeOfPoint(playerid7.0,-2526.271732347.453615.94540))
        {
            
MoveObject(fdgate2,-2526.271732347.453615.94540,0.50,0090);
        }
        else if(
IsPlayerInRangeOfPoint(playerid7.0,-2518.360842347.453615.94540))
        {
            
MoveObject(fdgate3,-2518.360842347.453615.94540,0.50,0090);
        }
        return 
1
}
else return 
SCM(playerid,-1,"Use the command /bay like: /bay open or /bay close");

PS: Sorry for the identation.
Reply


Messages In This Thread
Openbay(gate) 2 commands into 1 - by Cubie - 26.09.2017, 14:28
Re: Openbay(gate) 2 commands into 1 - by 10MIN - 26.09.2017, 14:43
Re: Openbay(gate) 2 commands into 1 - by ToiletDuck - 26.09.2017, 14:46
Re: Openbay(gate) 2 commands into 1 - by Cubie - 26.09.2017, 15:47
Re: Openbay(gate) 2 commands into 1 - by ToiletDuck - 26.09.2017, 15:50
Re: Openbay(gate) 2 commands into 1 - by Cubie - 27.09.2017, 10:50
Re: Openbay(gate) 2 commands into 1 - by MEW273 - 27.09.2017, 11:35
Re: Openbay(gate) 2 commands into 1 - by Cubie - 27.09.2017, 12:08

Forum Jump:


Users browsing this thread: 1 Guest(s)