02.06.2014, 07:35
pawn Код:
CMD:gate(playerid, params[]) {
new
string[128];
if(PlayerInfo[playerid][pLeader] == 1 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pFaction] == 2 || PlayerInfo[playerid][pFaction] == 5 || PlayerInfo[playerid][pFaction] == 5) {
GetPlayerPos(playerid, Positions[0][0], Positions[0][1], Positions[0][2]);
GetDynamicObjectPos(LAPDGate, Positions[1][0], Positions[1][1], Positions[1][2]);
GetDynamicObjectPos(LAPDGate2, Positions[4][0], Positions[4][1], Positions[4][2]);
GetDynamicObjectPos(FBIGate1, Positions[2][0], Positions[2][1], Positions[2][2]);
GetDynamicObjectPos(FBIGate2, Positions[3][0], Positions[3][1], Positions[3][2]);
if(GetDistance(Positions[0][0], Positions[0][1], Positions[0][2], Positions[1][0], Positions[1][1], Positions[1][2]) < 15.0) {
if(LAPDGateStatus == 0) {
format(string, sizeof(string), "* %s uses their remote to open the gates.", GetPlayerNameEx(playerid));
ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
SetDynamicObjectRot(LAPDGate, 0.000000, 0, 90);
LAPDGateStatus = 1;
}
else {
LAPDGateStatus = 0;
SetDynamicObjectRot(LAPDGate, 0.000000, 90, 90);
format(string, sizeof(string), "* %s uses their remote to close the gates.", GetPlayerNameEx(playerid));
ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
}
else if(GetDistance(Positions[0][0], Positions[0][1], Positions[0][2], Positions[4][0], Positions[4][1], Positions[4][2]) < 15.0) {
if(LAPDGate2Status == 0) {
format(string, sizeof(string), "* %s uses their remote to open the gates.", GetPlayerNameEx(playerid));
ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
MoveDynamicObject(LAPDGate2, 1588.6501464844, -1638.0750732422, 6.2343215942383, 3);
LAPDGate2Status = 1;
}
else {
format(string, sizeof(string), "* %s uses their remote to close the gates.", GetPlayerNameEx(playerid));
ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
MoveDynamicObject(LAPDGate2, 1588.6428222656, -1638.02734375, 15.240161895752, 3);
LAPDGate2Status = 0;
}
}
else if(GetDistance(Positions[0][0], Positions[0][1], Positions[0][2], Positions[4][0], Positions[4][1], Positions[4][2]) < 15.0) {
if(LAPDGate2Status == 0) {
format(string, sizeof(string), "* %s uses their remote to open the gates.", GetPlayerNameEx(playerid));
ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
MoveDynamicObject(LAPDGate2, 313.49652099609, -1482.9189453125, 26.682577133179, 3);
LAPDGate2Status = 1;
}
else {
format(string, sizeof(string), "* %s uses their remote to close the gates.", GetPlayerNameEx(playerid));
ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
MoveDynamicObject(LAPDGate2, 320.40628051758, -1487.9129638672, 26.900407791138, 3);
LAPDGate2Status = 0;
}
}
}
if(PlayerInfo[playerid][pFaction] == 2 || PlayerInfo[playerid][pLeader] == 2 || PlayerInfo[playerid][pFaction] == 5 || PlayerInfo[playerid][pFaction] == 5) {
if(GetDistance(Positions[0][0], Positions[0][1], Positions[0][2], Positions[2][0], Positions[2][1], Positions[2][2]) < 15.0) {
if(FBIGate1Status == 0) {
format(string, sizeof(string), "* %s uses their remote to open the gates.", GetPlayerNameEx(playerid));
ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
MoveDynamicObject(FBIGate1, 313.49652099609, -1482.9189453125, 26.682577133179, 3);
FBIGate1Status = 1;
}
else {
format(string, sizeof(string), "* %s uses their remote to close the gates.", GetPlayerNameEx(playerid));
ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
MoveDynamicObject(FBIGate1, 320.40628051758, -1487.9129638672, 26.900407791138, 3);
FBIGate1Status = 0;
}
}
else if(GetDistance(Positions[0][0], Positions[0][1], Positions[0][2], Positions[3][0], Positions[3][1], Positions[3][2]) < 15.0) {
if(FBIGate2Status == 0) {
format(string, sizeof(string), "* %s uses their remote to open the gates.", GetPlayerNameEx(playerid));
ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
MoveDynamicObject(FBIGate2, 290.56341552734, -1547.8900146484, 27.16854095459, 3);
FBIGate2Status = 1;
}
else {
format(string, sizeof(string), "* %s uses their remote to close the gates.", GetPlayerNameEx(playerid));
ProxDetector(5.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
MoveDynamicObject(FBIGate2, 283.96463012695, -1543.154296875, 27.167940139771, 3);
FBIGate2Status = 0;
}
}
}
return 1;
}
What is the Use of This?? i want to create a gate same this , but this pawn , i don't understand it
pawn Код:
GetPlayerPos(playerid, Positions[0][0], Positions[0][1], Positions[0][2]);
GetDynamicObjectPos(LAPDGate, Positions[1][0], Positions[1][1], Positions[1][2]);
GetDynamicObjectPos(LAPDGate2, Positions[4][0], Positions[4][1], Positions[4][2]);
GetDynamicObjectPos(FBIGate1, Positions[2][0], Positions[2][1], Positions[2][2]);
GetDynamicObjectPos(FBIGate2, Positions[3][0], Positions[3][1], Positions[3][2]);