24.11.2010, 20:27
(
Last edited by Sodierlow; 24/11/2010 at 08:33 PM.
Reason: edit the code
)
hello guys,
I have a problem with my automatic gate system.
I'm supposed to open the gate to a particular player, but is open exclusively to me ..
Mauro_Baracchi & Andrea_Portaro are the players who should open their gates
P.S. Sorry for my bad english
Help Me..Please
I have a problem with my automatic gate system.
I'm supposed to open the gate to a particular player, but is open exclusively to me ..
pawn Code:
new barrackgate;
new portarogate1;
//new portarogate2;
public OnGameModeInit()
{
SetTimer("BaracchiGate",1000,true); //setto il timer per il cancello di barrack
SetTimer("PortaroGate",1000,true); //setto il timer per il cancello di portaro
barrackgate = CreateObject(976, -225.27685546875, 2614.13671875, 61.708999633789, 0, 0, 0, 500);
//CreateObject(976, -225.27685546875, 2614.13671875, 57.709098815918, 0, 0, 0, 500);
portarogate1 = CreateObject(976, 997.58355712891, 1687.7630615234, 5.921875, 0, 0, 270);
//CreateObject(976, 997.58355712891, 1687.7630615234, 10.199999809265, 0, 0, 270);
}
forward BaracchiGate(playerid);
public BaracchiGate(playerid)
{
new barrackgate_status;
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
for(new Mauro_Baracchi; Mauro_Baracchi<MAX_PLAYER_NAME; Mauro_Baracchi++)
{
if(!IsPlayerConnected(Mauro_Baracchi)) continue;
if(IsPlayerInRangeOfPoint(playerid, 10.0, -225.27685546875, 2614.13671875, 61.708999633789))barrackgate_status=1;
}
if(barrackgate_status)MoveObject(barrackgate,-225.27685546875, 2614.13671875, 57.709098815918, 2);
else MoveObject(barrackgate, -225.27685546875, 2614.13671875, 61.708999633789, 2);
}
forward PortaroGate(playerid);
public PortaroGate(playerid)
{
new portarogate_status;
new pName[MAX_PLAYER_NAME];
GetPlayerName(playerid,pName,MAX_PLAYER_NAME);
for(new Andrea_Portaro; Andrea_Portaro<MAX_PLAYER_NAME; Andrea_Portaro++)
{
if(!IsPlayerConnected(Andrea_Portaro)) continue;
if(IsPlayerInRangeOfPoint(playerid, 10.0, 997.58355712891, 1687.7630615234, 10.199999809265))portarogate_status=1;
}
if(portarogate_status)MoveObject(portarogate1, 997.58355712891, 1687.7630615234, 5.921875, 2);
else MoveObject(portarogate1, 997.58355712891, 1687.7630615234, 10.199999809265, 2);
}
P.S. Sorry for my bad english
Help Me..Please