04.12.2012, 17:11
(
Последний раз редактировалось Kethrios; 04.12.2012 в 18:28.
)
Hello guys,
I got a little problem, which is simple to solve I guess, but I can't see why it's not working
So here is the code :
OnGameModeInit
The command
And the timer :
In game when I use /pom obarriere, I got the messages, but it's not moving at all.
I got a little problem, which is simple to solve I guess, but I can't see why it's not working
So here is the code :
pawn Код:
new barrierelafmd1;
new barrierelafmd2;
new barrierelafmd3;
new barrierelafmd4;
OnGameModeInit
pawn Код:
barrierelafmd1 = CreateObject(968, 1815.05, -1767.70, 14.19, 0.00, 0.00, 0.00); // barrier
barrierelafmd2 = CreateObject(968, 1827.94, -1808.55, 14.19, 0.00, 0.00, 0.00); // barrier
barrierelafmd3 = 0;
barrierelafmd4 = 0;
The command
pawn Код:
if (IsPlayerInRangeOfPoint(playerid,1807.9246, -1795.9553, 12.5339))
{
if(barrierelafmd3 == 1 || barrierelafmd4 == 1) { SendClientMessage(playerid, COLOR_FACTION, "[LAFMD] Barrier is already open."); return 1; }
MoveObject(barrierelafmd1, 1815.05, -1767.70, 14.19, 0.00, 90.00, 0.00);
MoveObject(barrierelafmd2, 1827.94, -1808.55, 14.19, 0.00, -90.00, 0.00);
SetTimer("GateFermer", 10000, 0);
GetPlayerName(playerid,playername,sizeof(playername));
SendClientMessage(playerid, COLOR_BLUE,"[LAFMD] Closing.");
format(string, sizeof(string), "* %s take is remote and close the barrier.", playername);
ProxDetector(30.0, playerid, string, COLOR_CHAT1,COLOR_CHAT2,COLOR_CHAT3,COLOR_CHAT4,COLOR_CHAT5,true);
barrierelafmd3 = 1;
barrierelafmd4 = 1;
return 1;
}
else { SendClientMessage(playerid, COLOR_FACTION,"[Faction] You're not in front of the barriers."); }
}
return 1;
And the timer :
pawn Код:
public GateFermer()
{
MoveObject(barrierelafmd1,1815.05, -1767.70, 14.19, 0.00, 90.00, 0.00);
MoveObject(barrierelafmd2,1827.94, -1808.55, 14.19, 0.00, -90.00, 0.00);
barrierelafmd3 = 0;
barrierelafmd4 = 0;
return 1;
}
In game when I use /pom obarriere, I got the messages, but it's not moving at all.