Gate open/close
#1

Hey,
I added to my server a map, and now it's added for my server a gate, how I create a command to open it (only for PD)?

I downloaded a RP mode and there's have some gates, how I added this gate to there?

Thanks guys!
Reply
#2

Make the objects move by MoveObject
Reply
#3

Quote:
Originally Posted by ChristolisTV
Посмотреть сообщение
Make the objects move by MoveObject
But, how I do it for only the PD members?
Reply
#4

For example I want to put it:

if(!strcmp(cmdtext, "/gate", true))
{
if(PlayerInfo[playerid][pMember] == 7 || PlayerInfo[playerid][pMember] == 2|| PlayerInfo[playerid][pMember] == 14 || GetPVarInt(playerid, "AdminDuty")==1 && !(PlayerToPoint(15.0, playerid,2259.098145, -2389.186279, 19.174612) || PlayerToPoint(15.0, playerid,1803.511597, -1721.455688, 12.306467) || PlayerToPoint(15.0, playerid,1761.343262, -1699.028931, 12.676054)))
{
if (PlayerToPoint(15.0, playerid,1589.053344,-1638.123168,14.122960))
{
if(pdgateopen == 1)
{
SendClientMessage(playerid,COLOR_GREY," The Gate is already open !");
return 1;
}
pdgateopen = 1;
MoveObject(pdgate1,1596.790039, -1638.102173, 13.882034, 2.0);
SetTimer("GateClose", 15000, 0);
SendClientMessage(playerid, COLOR_WHITE,"A garage is opened and will close in 15 seconds.");
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(sendername);
if(PlayerInfo[playerid][pMaskUse] == 1) { format(sendername, sizeof(sendername), "Stranger_%d", PlayerInfo[playerid][pRandMask]); }
format(string, sizeof(string), "* %s takes their remote and opens a garage.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
}


Where I do that?
Reply
#5

PHP код:
if(!strcmp(cmdtext"/gate"true))
{
     if(
PlayerInfo[playerid][pMember] == || PlayerInfo[playerid][pMember] == 2|| PlayerInfo[playerid][pMember] == 14 || GetPVarInt(playerid"AdminDuty")==&& !(PlayerToPoint(15.0playerid,2259.098145, -2389.18627919.174612) || PlayerToPoint(15.0playerid,1803.511597, -1721.45568812.306467) || PlayerToPoint(15.0playerid,1761.343262, -1699.02893112.676054)))
     {
     if(
PlayerToPoint(15.0playerid,1589.053344,-1638.123168,14.122960))
     {
     if(
pdgateopen == 1)
     {
           
SendClientMessage(playerid,COLOR_GREY," The Gate is already open !");
           return 
1;
     }
     
pdgateopen 1;
     
MoveObject(pdgate1,1596.790039, -1638.10217313.8820342.0);
     
SetTimer("GateClose"150000);
     
SendClientMessage(playeridCOLOR_WHITE,"A garage is opened and will close in 15 seconds.");
     
GetPlayerName(playeridsendernamesizeof(sendername));
     
GiveNameSpace(sendername);
     if(
PlayerInfo[playerid][pMaskUse] == 1) { format(sendernamesizeof(sendername), "Stranger_%d",             PlayerInfo[playerid][pRandMask]); }
     
format(stringsizeof(string), "* %s takes their remote and opens a garage."sendername);
     
ProxDetector(30.0playeridstringCOLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
}
else
{
     
SendClientMessage(playerid,-1,"You must be a PD Member to use this command!");
}

Haven't tested it but try it :P
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)