PDA

View Full Version : Why do these not work?


BleverCastard
28/04/2012, 07:02 PM
CMD:dooropen(playerid, params[])
{
if(playerVariables[playerid][pGroup] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1812.0830,-1545.2319,5700.4287))
{

MoveObject(pdoor3,1811.73828125+1,-1545.82873535,5699.42480469,0.50);
MoveObject(pdoor4,1808.73071289-1,-1545.87463379,5699.42480469,0.50);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0,1797.00830078,-1525.15258789,5699.42480469) || IsPlayerInRangeOfPoint(playerid, 2.0, 1793.6631,-1523.9191,5700.4287))
{
MoveObject(edoor5,1797.00830078+1,-1525.15258789,5699.42480469,0.50);
MoveObject(edoor6,1794.00976562-1,-1525.18676758,5699.42480469,0.50);
return 1;
}
else SendClientMessage(playerid, 0xAA3333AA, "[Error]: {FFFFFF} You are not around a control pad!");
return 1;
}
else return SendClientMessage(playerid,-1, "You are not a Prison Guard!");
}

CMD:doorclose(playerid, params[])
{
if(playerVariables[playerid][pGroup] == 1)
{
if(IsPlayerInRangeOfPoint(playerid, 2.0, 1812.0830,-1545.2319,5700.4287))
{

MoveObject(pdoor3,1811.73828125,-1545.82873535,5699.42480469,0.50);
MoveObject(pdoor4,1808.73071289,-1545.87463379,5699.42480469,0.50);
return 1;
}
else if(IsPlayerInRangeOfPoint(playerid, 2.0, 1797.00830078,-1525.15258789,5699.42480469) || IsPlayerInRangeOfPoint(playerid, 2.0, 1793.6631,-1523.9191,5700.4287))
{
MoveObject(edoor5,1797.00830078,-1525.15258789,5699.42480469,0.50);
MoveObject(edoor6,1794.00976562,-1525.18676758,5699.42480469,0.50);
return 1;
}
else SendClientMessage(playerid, 0xAA3333AA, "[Error]: {FFFFFF} You are not around a control pad!");
return 1;
}
else return SendClientMessage(playerid,-1, "You are not a prison guard!");
}

If I'm not a prison guard and I type them near a Control pad it opens, why?!

ReneG
28/04/2012, 07:05 PM
Try resetting every variable to zero (like team variable) OnPlayerConnect.

BleverCastard
28/04/2012, 07:09 PM
They are, I'm using AF-RP.