MoveObject (Giving Rep)
#1

[/php]
// Cell and Doors System
new
lspddoor1,
lspddoor2,
lspddoor3,
lspddoor4;

new
lspdcell1,
lspdcell2,
lspdcell3,
lspdcell4,
lspdcell5,
lspdcell6;


// LSPD Interior doors and cells
lspddoor1 = CreateDynamicObject(1495, 1219.56995, -1681.60999, -40.75000, 0.00000, 0.00000, 0.00000);
lspddoor2 = CreateDynamicObject(1495, 1221.89001, -1677.41003, -40.75000, 0.00000, 0.00000, 90.00000);
lspddoor3 = CreateDynamicObject(1495, 1225.82996, -1674.94995, -40.75000, 0.00000, 0.00000, 0.00000);
lspddoor4 = CreateDynamicObject(1495, 1230.68005, -1677.77002, -40.75000, 0.00000, 0.00000, 180.00000);

lspdcell1 = CreateDynamicObject(19303, 1228.29004, -1669.91003, -39.47000, 0.00000, 0.00000, 270.00000);
lspdcell2 = CreateDynamicObject(19303, 1228.29004, -1666.70996, -39.47000, 0.00000, 0.00000, 270.00000);
lspdcell3 = CreateDynamicObject(19303, 1237.78003, -1666.69995, -39.47000, 0.00000, 0.00000, 270.00000);
lspdcell4 = CreateDynamicObject(19303, 1237.78003, -1669.67004, -39.47000, 0.00000, 0.00000, 90.00000);
lspdcell5 = CreateDynamicObject(19303, 1237.78003, -1673.01001, -39.47000, 0.00000, 0.00000, 90.00000);
lspdcell6 = CreateDynamicObject(19303, 1228.29004, -1673.24744, -39.47000, 0.00000, 0.00000, 270.00000);


CMDdcellopen(playerid, params[])
{
if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
if(IsPlayerInRangeOfPoint(playerid,3.5,1228.29004, -1669.91003, -39.47000))
{
new string[256];
MoveObject(lspdcell1,1228.29004,-1669.91003+1.25,-39.47000,0.50);
format(string, sizeof(string), "* %s twists the key in the lock, opening the cell .", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,3.5,1228.29004, -1666.70996, -39.47000))
{
new string[256];
MoveObject(lspdcell2,1228.29004,-1666.70996+1.25,-39.47000,0.50);
format(string, sizeof(string), "* %s twists the key in the lock, opening the cell .", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,3.5,1237.78003, -1666.69995, -39.4700))
{
new string[256];
MoveObject(lspdcell3,1237.78003,-1666.69995+1.25,-39.4700,0.50);
format(string, sizeof(string), "* %s twists the key in the lock, opening the cell .", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,3.5,1237.78003, -1669.67004, -39.47000))
{
new string[256];
MoveObject(lspdcell4,1237.78003,-1669.67004+1.25,-39.47000,0.50);
format(string, sizeof(string), "* %s twists the key in the lock, opening the cell .", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,3.5,1237.78003, -1673.01001, -39.47000))
{
new string[256];
MoveObject(lspdcell5,1237.78003, -1673.01001-1.25, -39.47000,0.50);
format(string, sizeof(string), "* %s twists the key in the lock, opening the cell .", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,3.5,1228.29004, -1673.24744, -39.47000))
{
new string[256];
MoveObject(lspdcell6,1228.29004, -1673.24744-1.25, -39.47000,0.50);
format(string, sizeof(string), "* %s twists the key in the lock, opening the cell .", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else
{
SendErrorMessage(playerid, "You are not near on any cell.");
}
}
return 1;
}
CMDdcellclose(playerid, params[])
{
if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
if(IsPlayerInRangeOfPoint(playerid,3.5,1228.29004, -1669.91003, -39.47000))
{
new string[256];
MoveObject(lspdcell1,1228.29004,-1669.91003,-39.47000,0.50);
format(string, sizeof(string), "* %s twists the key in the lock, closing the cell .", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,3.5,1228.29004, -1666.70996, -39.47000))
{
new string[256];
MoveObject(lspdcell2,1228.29004,-1666.70996,-39.47000,0.50);
format(string, sizeof(string), "* %s twists the key in the lock, closing the cell .", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,3.5,1237.78003, -1666.69995, -39.4700))
{
new string[256];
MoveObject(lspdcell3,1237.78003,-1666.69995,-39.4700,0.50);
format(string, sizeof(string), "* %s twists the key in the lock, closing the cell .", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,3.5,1237.78003, -1669.67004, -39.47000))
{
new string[256];
MoveObject(lspdcell4,1237.78003,-1669.67004,-39.47000,0.50);
format(string, sizeof(string), "* %s twists the key in the lock, closing the cell .", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,3.5,1237.78003, -1673.01001, -39.47000))
{
new string[256];
MoveObject(lspdcell5,1237.78003, -1673.01001, -39.47000,0.50);
format(string, sizeof(string), "* %s twists the key in the lock, closing the cell .", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid,3.5,1228.29004, -1673.24744, -39.47000))
{
new string[256];
MoveObject(lspdcell6,1228.29004, -1673.24744, -39.47000,0.50);
format(string, sizeof(string), "* %s twists the key in the lock, closing the cell .", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else
{
SendErrorMessage(playerid, "You are not near on any cell.");
}
}
return 1;
}
CMDddooropen(playerid, params[])
{
if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0,1219.56995,-1681.60999,-40.75000))
{
new string[256];
MoveObject(lspddoor1,1219.56995-1.25,-1681.60999,-40.75000,0.50);
format(string, sizeof(string), "* %s presses the switch, opening the door.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0,1221.89001,-1677.41003,-40.75000))
{
new string[256];
MoveObject(lspddoor2,1221.89001,-1677.41003+1.25,-40.75000,0.50);
format(string, sizeof(string), "* %s presses the switch, opening the door.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0,1225.82996,-1674.94995,-40.75000))
{
new string[256];
MoveObject(lspddoor3,1225.82996-1.25,-1674.94995,-40.75000,0.50);
format(string, sizeof(string), "* %s presses the switch, opening the door.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0,1230.68005,-1677.77002,-40.75000))
{
new string[256];
MoveObject(lspddoor4,1230.68005+1.25,-1677.77002,-40.75000,0.50);
format(string, sizeof(string), "* %s presses the switch, opening the door.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else SendErrorMessage(playerid, "You are not near any door!");
}
return 1;
}
CMDddoorclose(playerid, params[])
{
if(PlayerInfo[playerid][pFaction] == 1 || PlayerInfo[playerid][pLeader] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0,1219.56995,-1681.60999,-40.75000))
{
new string[256];
MoveObject(lspddoor1,1219.56995,-1681.60999,-40.75000,0.50);
format(string, sizeof(string), "* %s presses the switch, closing the door.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0,1221.89001,-1677.41003,-40.75000))
{
new string[256];
MoveObject(lspddoor2,1221.89001,-1677.41003,-40.75000,0.50);
format(string, sizeof(string), "* %s presses the switch, closing the door.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0,1225.82996,-1674.94995,-40.75000))
{
new string[256];
MoveObject(lspddoor3,1225.82996,-1674.94995,-40.75000,0.50);
format(string, sizeof(string), "* %s presses the switch, opening the door.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0,1230.68005,-1677.77002,-40.75000))
{
new string[256];
MoveObject(lspddoor4,1230.68005,-1677.77002,-40.75000,0.50);
format(string, sizeof(string), "* %s presses the switch, closing the door.", GetPlayerNameEx(playerid));
ProxDetector(30.0, playerid, string, COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPLE,COLOR_PURPL E,COLOR_PURPLE);
return 1;
}
else SendErrorMessage(playerid, "You are not near any door!");
}
return 1;
}[/php]

MoveObject is not working, it should be when I use /pddooropen the door near your will open, but nothing will happen in this script and that's the problem, both cells and doors. Giving Reputation!
Reply


Messages In This Thread
MoveObject (Giving Rep) - by lwilson - 16.07.2015, 18:11
Re: MoveObject (Giving Rep) - by SoFahim - 16.07.2015, 18:13
Re: MoveObject (Giving Rep) - by dominik523 - 16.07.2015, 18:14
Re: MoveObject (Giving Rep) - by lwilson - 16.07.2015, 18:16

Forum Jump:


Users browsing this thread: 2 Guest(s)