Faction gate help
#1

ok I have mapped a NG training ground and I was woundering how I could make it so only NG can open the gate...
Quote:

fortgate2 = CreateObject(986,-1203.21313477,-1064.92285156,129.13668823,0.00000000,0.00000000,1 81.44494629); //object(gate_autol) (1)
fortgate1 = CreateObject(985,-1211.16760254,-1065.07299805,129.09060669,0.00000000,0.00000000,1 81.26501465); //object(gate_autor) (1)
CreateObject(16613,-1019.03021240,-925.79846191,128.21264648,0.00000000,0.00000000,26 8.96490479); //object(des_bigtelescope) (1)
CreateObject(4874,-1040.52453613,-1042.18225098,132.08299255,0.00000000,0.00000000,1 83.52001953); //object(helipad1_las) (1)
CreateObject(3491,-1183.86633301,-943.40155029,136.76406860,0.00000000,0.00000000,89 .64001465); //object(vegass_hanger2) (1)
CreateObject(3279,-1185.41467285,-1056.19738770,128.21875000,0.00000000,0.00000000,9 1.71499634); //object(a51_spottower) (1)
CreateObject(10829,-1196.45922852,-1055.78930664,128.21875000,0.00000000,0.00000000,2 .84509277); //object(gatehouse1_sfse) (1)
CreateObject(16774,-1033.31103516,-990.35693359,129.81253052,0.00000000,0.00000000,0. 00000000); //object(des_gunbldg) (1)
CreateObject(10831,-1087.64526367,-985.62640381,133.14239502,0.00000000,0.00000000,26 6.2550048; //object(drydock3_sfse) (1)
CreateObject(9819,-1074.75634766,-976.68017578,129.07217407,0.00000000,359.50000000, 356.01501465); //object(shpbridge_sfw02) (1)
CreateObject(2200,-1078.07019043,-972.33288574,128.21875000,0.00000000,0.00000000,35 6.0299987; //object(med_office5_unit_1) (1)
CreateObject(2606,-1073.62365723,-975.45904541,131.72529602,0.00000000,0.00000000,26 6.0050048; //object(cj_police_counter2) (1)
CreateObject(2964,-1078.35363770,-997.12091064,128.21875000,0.00000000,0.00000000,35 9.98498535); //object(k_pooltablesm) (1)
CreateObject(2942,-1075.26965332,-999.87951660,128.86164856,0.00000000,0.00000000,26 4.53997803); //object(kmb_atm1) (1)
CreateObject(2619,-1029.25610352,-988.04571533,131.34230042,0.00000000,0.00000000,0. 00000000); //object(mp_ammoambient) (1)
CreateObject(3383,-1094.45532227,-996.70434570,128.21875000,0.00000000,0.00000000,35 4.04504395); //object(a51_labtable1_) (1)
CreateObject(3383,-1097.40539551,-996.41229248,128.21875000,0.00000000,0.00000000,35 4.03991699); //object(a51_labtable1_) (2)
CreateObject(11665,-1076.04870605,-993.28900146,128.91741943,0.00000000,0.00000000,35 6.26501465); //object(kb_chair03ext) (1)
CreateObject(2207,-1084.00170898,-991.12640381,128.21875000,0.00000000,0.00000000,0. 00000000); //object(med_office7_desk_1) (1)
CreateObject(2207,-1082.14465332,-989.25415039,128.21875000,0.00000000,0.00000000,17 9.36999512); //object(med_office7_desk_1) (2)
CreateObject(1715,-1083.12255859,-987.79492188,128.21875000,0.00000000,0.00000000,0. 00000000); //object(kb_swivelchair2) (2)
CreateObject(1715,-1081.59301758,-988.27520752,128.21875000,0.00000000,1.98498535,32 4.26995850); //object(kb_swivelchair2) (3)
CreateObject(1715,-1080.94116211,-989.70684814,128.21875000,0.00000000,1.98303223,28 2.58227539); //object(kb_swivelchair2) (4)
CreateObject(1715,-1081.18127441,-991.43548584,128.21875000,0.00000000,1.97753906,24 0.89453125); //object(kb_swivelchair2) (5)
CreateObject(1715,-1082.49377441,-992.44226074,128.21875000,0.00000000,1.97204590,20 1.19171143); //object(kb_swivelchair2) (6)
CreateObject(1715,-1084.21435547,-992.15118408,128.21875000,0.00000000,1.96655273,15 3.54711914); //object(kb_swivelchair2) (7)
CreateObject(1715,-1085.31457520,-990.81799316,128.21875000,0.00000000,1.96105957,10 9.87493896); //object(kb_swivelchair2) (
CreateObject(1715,-1085.26989746,-989.43597412,128.21875000,0.00000000,1.95556641,80 .09924316); //object(kb_swivelchair2) (9)
CreateObject(1715,-1084.50463867,-988.34124756,128.21875000,0.00000000,1.95007324,38 .41082764); //object(kb_swivelchair2) (10)
CreateObject(16326,-1174.64941406,-990.18420410,128.21875000,0.00000000,0.00000000,1. 84509277); //object(des_byoffice) (1)
CreateObject(14781,-1096.28710938,-976.58068848,129.30909729,0.00000000,0.00000000,0. 00000000); //object(in_bxing05) (1)
CreateObject(14782,-1178.02844238,-987.15533447,131.84417725,0.00000000,0.00000000,18 4.41503906); //object(int3int_boxing30) (1)
CreateObject(2163,-1176.36523438,-983.08447266,130.82812500,0.00000000,0.00000000,1. 50000000); //object(med_office_unit_2) (1)
CreateObject(2197,-1177.18469238,-984.26611328,130.82812500,0.00000000,0.00000000,2. 25000000); //object(filling_cabinet) (1)
CreateObject(2165,-1182.73376465,-983.66632080,130.82812500,0.00000000,0.00000000,0. 00000000); //object(med_office_desk_1) (1)
CreateObject(983,-1060.60473633,-927.09704590,128.90229797,0.00000000,0.00000000,0. 00000000); //object(fenceshit3) (1)
CreateObject(983,-1060.60583496,-933.49633789,128.90229797,0.00000000,0.00000000,0. 00000000); //object(fenceshit3) (2)
CreateObject(983,-1060.61828613,-939.83941650,128.90229797,0.00000000,0.00000000,0. 00000000); //object(fenceshit3) (3)
CreateObject(983,-1060.60083008,-943.04541016,128.90229797,0.00000000,0.00000000,0. 00000000); //object(fenceshit3) (4)
CreateObject(983,-1063.88549805,-946.45385742,128.90229797,0.00000000,0.00000000,93 .30001831); //object(fenceshit3) (5)
CreateObject(983,-1063.80920410,-920.93707275,128.89376831,0.00000000,0.00000000,93 .29589844); //object(fenceshit3) (6)
CreateObject(983,-1060.62768555,-923.92950439,128.90229797,0.00000000,0.00000000,0. 00000000); //object(fenceshit3) (7)
CreateObject(3392,-1151.36877441,-958.15533447,128.21875000,0.00000000,0.00000000,0. 00000000); //object(a51_sdsk_ncol3_) (1)
CreateObject(16409,-1156.66979980,-1053.63757324,128.21875000,0.00000000,0.00000000,2 70.27001953); //object(by_weehangr) (1)
CreateObject(16409,-1143.12683105,-1053.57739258,128.19015503,0.00000000,0.00000000,2 70.26916504); //object(by_weehangr) (2)
CreateObject(16409,-1129.36706543,-1053.50708008,128.21875000,0.00000000,0.00000000,2 70.26916504); //object(by_weehangr) (3)
CreateObject(3928,-1134.71557617,-918.41809082,128.21875000,0.00000000,0.00000000,0. 00000000); //object(helipad) (1)
CreateObject(3928,-1134.62756348,-932.24444580,128.21875000,0.00000000,0.00000000,0. 00000000); //object(helipad) (2)
CreateObject(3928,-1113.19116211,-930.95300293,128.21875000,0.00000000,0.00000000,0. 00000000); //object(helipad) (3)
CreateObject(3928,-1113.60961914,-917.34106445,128.21875000,0.00000000,0.00000000,0. 00000000); //object(helipad) (4)

/*
Objects converted: 59
Vehicles converted: 23
Vehicle models found: 5
----------------------
In the time this conversion took to finish a hummingbird could have flapped it's wings 2.9 times!
*/

return 1;
}

public OnGameModeExit()
{
return 1;
}

public OnPlayerRequestClass(playerid, classid)
{
SetPlayerPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraPos(playerid, 1958.3783, 1343.1572, 15.3746);
SetPlayerCameraLookAt(playerid, 1958.3783, 1343.1572, 15.3746);
return 1;
}

public OnPlayerConnect(playerid)
{
return 1;
}

public OnPlayerDisconnect(playerid, reason)
{
return 1;
}

public OnPlayerSpawn(playerid)
{
return 1;
}

public OnPlayerDeath(playerid, killerid, reason)
{
return 1;
}

public OnVehicleSpawn(vehicleid)
{
return 1;
}

public OnVehicleDeath(vehicleid, killerid)
{
return 1;
}

public OnPlayerText(playerid, text[])
{
return 1;
}

public OnPlayerCommandText(playerid, cmdtext[])
{
if (strcmp("/fortopen", cmdtext, true, 10) == 0)
{
MoveObject(fortgate1,-1218.4169921875,-1065.1713867188,129.09060668945,3.0);
MoveObject(fortgate2,-1196.1612548828,-1064.8914794922,129.13668823242,3.0);
return 1;
}
if (strcmp("/fortclose", cmdtext, true, 10) == 0)
{
MoveObject(fortgate1,-1211.1669921875,-1065.072265625,129.09060668945,3.0);
MoveObject(fortgate2,-1203.212890625,-1064.9228515625,129.13668823242,3.0);
return 1;
}
return 0;
}

So can someone tell me how to do it please.... the faction is FACTION 5
Reply
#2

use [ pawn ] [ / pawn ] tags
Reply
#3

Let's say your faction array is "pFaction"

pawn Код:
if (strcmp("/fortclose", cmdtext, true, 10) == 0)
{
    if(pFaction[playerid] == 5)
    {
        MoveObject(fortgate1,-1211.1669921875,-1065.072265625,129.09060668945,3.0);
        MoveObject(fortgate2,-1203.212890625,-1064.9228515625,129.13668823242,3.0);
        return 1;
    }
    else return SendClientMessage(playerid,-1,"You are not NG!");
}
Reply
#4

Quote:
Originally Posted by Markx
Посмотреть сообщение
use [ pawn ] [ / pawn ] tags
Postwhore much?

Anyway, you should use something like this:

pawn Код:
if (strcmp("/fortopen", cmdtext, true, 10) == 0)
{
    if(IsNGMember == 0) return SendClientMessage(playerid, COLOR, "You're not in the NG!");    
    MoveObject(fortgate1,-1218.4169921875,-1065.1713867188,129.09060668945,3.0);
    MoveObject(fortgate2,-1196.1612548828,-1064.8914794922,129.13668823242,3.0);
    return 1;
}
Replace IsNGMember with your own variable and COLOR with your own color.
Reply
#5

Thanks
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)