Help with Gates
#1

So i was Creating Simple Gates for a faction and i wanted to make that they can only open it near that distance So i made it But it still says You have opendt the door , how can i make it say You are not near this Gate


The lines

PHP код:
    if(strcmp(cmd,"/Yamao2",true)==0)
    {
            if(
PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
            {
         
MoveDynamicObject(rallon4658.40002441406, -1226.699951171922.399999618531.5);
        
SetTimer("GateCloseBMS"80000);
        
format(stringsizeof(string), "* %s takes his/her remote and opens the gate."sendername);
        
ProxDetector(30.0playeridstringCOLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
        
SendClientMessage(playeridCOLOR_ORANGE"The gate is opened and will close in few seconds.");
          }
        else
        {
            
SendClientMessage(playeridCOLOR_RED"You don't have a remote that could open the gate!");
        }
        return 
1;
    } 
Reply
#2

NOT TESTED


pawn Код:
if(strcmp(cmd,"/Yamao2",true)==0)
    {
        if (IsPlayerInRangeOfPoint(playerid, 20, 658.40002441406, -1226.6999511719, 22.39999961853)) && if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
       
    {
        MoveDynamicObject(rallon4, 658.40002441406, -1226.6999511719, 22.39999961853, 1.5);
    }
        SetTimer("GateCloseBMS", 8000, 0);
        format(string, sizeof(string), "* %s takes his/her remote and opens the gate.", sendername);
        ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
        SendClientMessage(playerid, COLOR_ORANGE, "The gate is opened and will close in few seconds.");
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You don't have a remote that could open the gate!");
        }
        return 1;

    }
Reply
#3

Quote:
Originally Posted by SnG.Scot_MisCuDI
Посмотреть сообщение
NOT TESTED


pawn Код:
if(strcmp(cmd,"/Yamao2",true)==0)
    {
        if (IsPlayerInRangeOfPoint(playerid, 20, 658.40002441406, -1226.6999511719, 22.39999961853)) && if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
       
    {
        MoveDynamicObject(rallon4, 658.40002441406, -1226.6999511719, 22.39999961853, 1.5);
    }
        SetTimer("GateCloseBMS", 8000, 0);
        format(string, sizeof(string), "* %s takes his/her remote and opens the gate.", sendername);
        ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
        SendClientMessage(playerid, COLOR_ORANGE, "The gate is opened and will close in few seconds.");
        }
        else
        {
            SendClientMessage(playerid, COLOR_RED, "You don't have a remote that could open the gate!");
        }
        return 1;

    }
What the hell is up with your indentation?

@OP the MoveObject native had 3 new rotation parameters in 0.3d, you only gave 5.
pawn Код:
if(strcmp(cmd,"/Yamao2",true)==0)
{
    if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
    {
        if(IsPlayerInRangeOfPoint(playerid, 8.0, 658.40002441406, -1226.6999511719, 22.39999961853))
        {
            MoveDynamicObject(rallon4, 658.40002441406, -1226.6999511719, 22.39999961853, 1.5, 0.0, 0.0, 0.0);
            SetTimer("GateCloseBMS", 8000, 0);
            format(string, sizeof(string), "* %s takes his/her remote and opens the gate.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5);
            SendClientMessage(playerid, COLOR_ORANGE, "The gate is opened and will close in few seconds.");
            return 1;
        }
        else SendClientMessage(playerid, -1, "You are not near the gate.");
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "You don't have a remote that could open the gate!");
    }
    return 1;
}
Reply
#4

Lose Identitation


Quote:

if(strcmp(cmd,"/Yamao2",true)==0)
{
if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
{
if(IsPlayerInRangeOfPoint(playerid, 8.0, 658.40002441406, -1226.6999511719, 22.39999961853))
{
MoveDynamicObject(rallon4, 658.40002441406, -1226.6999511719, 22.39999961853, 1.5, 0.0, 0.0, 0.0);
SetTimer("GateCloseBMS", 8000, 0);
format(string, sizeof(string), "* %s takes his/her remote and opens the gate.", sendername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,CO LOR_CHAT5);
SendClientMessage(playerid, COLOR_ORANGE, "The gate is opened and will close in few seconds.");
return 1;
}
else SendClientMessage(playerid, -1, "You are not near the gate.");
}
else
{
SendClientMessage(playerid, COLOR_RED, "You don't have a remote that could open the gate!");
}
return 1;
}

hm? how i fix it

and u made them open weird lol
Reply
#5

Indent the code and you'll lose your loose indentation warnings.

Or, press TAB so the code gradually 'opens' and 'closes'.

pawn Код:
if(strcmp(cmd,"/Yamao2",true)==0)
{
    if(PlayerInfo[playerid][pMember] == 14 || PlayerInfo[playerid][pLeader] == 14)
    {
        if(IsPlayerInRangeOfPoint(playerid, 8.0, 658.40002441406, -1226.6999511719, 22.39999961853))
        {
            MoveDynamicObject(rallon4, 658.40002441406, -1226.6999511719, 22.39999961853, 1.5, 0.0, 0.0, 0.0);
            SetTimer("GateCloseBMS", 8000, 0);
            format(string, sizeof(string), "* %s takes his/her remote and opens the gate.", sendername);
            ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,CO LOR_CHAT5);
            SendClientMessage(playerid, COLOR_ORANGE, "The gate is opened and will close in few seconds.");
            return 1;
        }
        else SendClientMessage(playerid, -1, "You are not near the gate.");
    }
    else
    {
        SendClientMessage(playerid, COLOR_RED, "You don't have a remote that could open the gate!");
    }
    return 1;
}
Reply
#6

Can you turn the right code into PHP pawno doesnt allowds me to copy and paste into my gamemode it will fail
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)