if(strcmp(cmdtext, "/dooropen", true) == 0) {
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3 || PlayerInfo[playerid][pMember] == 14 || AdminDuty[playerid]==1) {
if (PlayerToPoint(2, playerid,1550.80004883, -1691.59997559, 1722.09997559, 5.0)) {
MoveDynamicObject(lspddoor1, 1535.80004883, -1691.59997559, 1722.09997559, 5.0);
SendClientMessage(playerid, COLOR_BLUE,"You have opened the lobby door, please close it");
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(sendername);
format(string, sizeof(string), "* %s takes his/her remote control and opens the door.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else if (PlayerToPoint(2, playerid, 1559.50000000, -1677.80004883, 1722.09997559, 5.0)) {
MoveDynamicObject(lspddoor2, 1544.50000000, -1677.80004883, 1722.09997559, 5.0);
SendClientMessage(playerid, COLOR_BLUE,"LSPD door is open, please close it!");
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(sendername);
format(string, sizeof(string), "* %s takes his/her remote control and opens the door.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else if (PlayerToPoint(2, playerid, 1555.39941406, -1710.69921875, 1724.80004883, 5.0)) {
MoveDynamicObject(lspddoor3, 1540.39941406, -1710.69921875, 1724.80004883, 5.0);
SendClientMessage(playerid, COLOR_BLUE,"LSPD door is open, please close it!");
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(sendername);
format(string, sizeof(string), "* %s takes his/her remote control and opens the door.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else if (PlayerToPoint(2, playerid, 1560.69995117, -1714.00000000, 1724.80004883, 5.0)) {
SetDynamicObjectRot(lspddoor4, 1555.69995117, -1714.00000000, 1724.80004883, 5.0);
SendClientMessage(playerid, COLOR_BLUE,"LSPD door is open, please close it!");
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(sendername);
format(string, sizeof(string), "* %s takes his/her remote control and opens the door.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else {
SendClientMessage(playerid, COLOR_GREY,"Destination is too far.");
}
}
return 1;
}
if(strcmp(cmdtext, "/doorclose", true) == 0) {
if(PlayerInfo[playerid][pMember] == 1 || PlayerInfo[playerid][pMember] == 2 || PlayerInfo[playerid][pMember] == 3|| PlayerInfo[playerid][pMember] == 14 || AdminDuty[playerid]==1) {
if (PlayerToPoint(3, playerid, 1550.80004883, -1691.59997559, 1722.09997559, 0)) {
MoveDynamicObject(lspddoor1, 1550.80004883, -1691.59997559, 1722.09997559, 0);
SendClientMessage(playerid, COLOR_BLUE,"LSPD door is closed, thank you!");
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(sendername);
format(string, sizeof(string), "* %s takes his/her remote control and closes the door.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else if (PlayerToPoint(3, playerid, 1559.50000000, -1677.80004883, 1722.09997559, 0)) {
MoveDynamicObject(lspddoor2, 1559.50000000, -1677.80004883, 1722.09997559, 0);
SendClientMessage(playerid, COLOR_BLUE,"LSPD door is closed, thank you!");
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(sendername);
format(string, sizeof(string), "* %s takes his/her remote control and closes the door.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else if (PlayerToPoint(3, playerid, 1555.39941406, -1710.69921875, 1724.80004883, 0)) {
MoveDynamicObject(lspddoor3, 1555.39941406, -1710.69921875, 1724.80004883, 0);
SendClientMessage(playerid, COLOR_BLUE,"LSPD door is closed, thank you!");
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(sendername);
format(string, sizeof(string), "* %s takes his/her remote control and closes the door.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else if (PlayerToPoint(3, playerid, 1562.40002441, -1660.19995117, 1729.09997559, 0)) {
MoveDynamicObject(lspddoor4, 1562.40002441, -1660.19995117, 1729.09997559, 0);
GetPlayerName(playerid, sendername, sizeof(sendername));
GiveNameSpace(sendername);
format(string, sizeof(string), "* %s takes his/her remote control and closes the door.", sendername);
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE);
}
else {
SendClientMessage(playerid, COLOR_GREY,"Destination is too far.");
}
}
return 1;
}
MoveDynamicObject( objectid, Float:X,
Float:Y, Float:Z, Float:Speed, Float:RotX =
-1000.0, Float:RotY = -1000.0, Float:RotZ =
-1000.0 )
PlayerToPoint
Код:
PlayerToPoint |
I'm pretty sure you DO need it, as it looks like you've defined the range twice in every call to your PlayerToPoint function. Then again, why would you use a slower function if a native one is available?
|