Move Gate -
nor15 - 09.07.2013
What is the problem here that makes the gate don't wanna move and the animation isn't made
PHP код:
if(newkeys & KEY_SECONDARY_ATTACK) //SFPD Shutter Inside
{
if(IsPlayerInRangeOfPoint(playerid, 1.0, 1249.8104,-766.2807,92.1497))
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(!strcmp(name, "[Thug]xZibit", true)) {
SendClientMessage(playerid,COLOR_DEADCONNECT,"[[_[Thug]xZibit_]]");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Welcome to your Personnel house.");
LoopingAnim(playerid, "HEIST9", "Use_SwipeCard", 3.0, 0, 0, 0, 0, 0);
SetPlayerPos(playerid,1249.8270,-766.6548,92.1163);
SetPlayerFacingAngle(playerid,190.7259);
MoveObject(Gate1, 1245.04, -767.49, 85.51, 4);
if(GateOpen == 0)
{
GateOpen =1;
MoveObject(Gate1, 1245.04, -767.49, 85.51, 4);
}
if(GateOpen == 1)
{
GateOpen =0;
MoveObject(Gate1, 1245.04, -767.49, 90.51, 4);
}
else
{
SendClientMessage(playerid,COLOR_ERROR,"Access Denied");
}
}
}
}
Re: Move Gate -
nor15 - 10.07.2013
anyone ?!
Re: Move Gate -
Ilan97 - 10.07.2013
Does it make any errors or warnings when you compile the mode?
Re: Move Gate -
nor15 - 10.07.2013
no it doesn't , just the Gate isn't moving down
Re: Move Gate -
Scenario - 10.07.2013
Debug your code with print and printf.
Re: Move Gate -
nor15 - 10.07.2013
PHP код:
if(newkeys & KEY_SECONDARY_ATTACK) //SFPD Shutter Inside
{
if(IsPlayerInRangeOfPoint(playerid, 1.0, 1249.8104,-766.2807,92.1497))
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(!strcmp(name, "[Thug]xZibit", true)) {
SendClientMessage(playerid,COLOR_DEADCONNECT,"[[_[Thug]xZibit_]]");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Welcome to your Personnel house.");
LoopingAnim(playerid, "HEIST9", "Use_SwipeCard", 3.0, 0, 0, 0, 0, 0);
SetPlayerPos(playerid,1249.8270,-766.6548,92.1163);
SetPlayerFacingAngle(playerid,190.7259);
MoveObject(Gate1, 1245.04, -767.49, 85.51, 4);
printf("Gate Moved");
if(GateOpen == 0)
{
GateOpen =1;
MoveObject(Gate1, 1245.04, -767.49, 85.51, 4);
}
if(GateOpen == 1)
{
GateOpen =0;
MoveObject(Gate1, 1245.04, -767.49, 90.51, 4);
}
else
{
SendClientMessage(playerid,COLOR_ERROR,"Access Denied");
}
}
}
}
It pront Gate Moved but the gate isn't In game.
Re: Move Gate -
Aerotactics - 10.07.2013
Don't you have to have a gate spawned OnGamemodeInit?
Re: Move Gate -
nor15 - 10.07.2013
Already have this
Gate1 = CreateObject(971, 1245.04, -767.49, 90.51, 0.00, 0.00, 0.00);
Re: Move Gate -
CAR - 10.07.2013
pawn Код:
if(newkeys & KEY_SECONDARY_ATTACK) //SFPD Shutter Inside
{
if(IsPlayerInRangeOfPoint(playerid, 1.0, 1249.8104,-766.2807,92.1497))
{
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, sizeof(name));
if(!strcmp(name, "[Thug]xZibit", true)) {
SendClientMessage(playerid,COLOR_DEADCONNECT,"[[_[Thug]xZibit_]]");
SendClientMessage(playerid,COLOR_LIGHTBLUE,"Welcome to your Personnel house.");
LoopingAnim(playerid, "HEIST9", "Use_SwipeCard", 3.0, 0, 0, 0, 0, 0);
SetPlayerPos(playerid,1249.8270,-766.6548,92.1163);
SetPlayerFacingAngle(playerid,190.7259);
MoveObject(Gate1, 1245.04, -767.49, 85.51, 4);
printf("Gate Moved");
if(GateOpen == 0)
{
GateOpen =1;
MoveObject(Gate1, 1245.04, -767.49, 85.51, 4);
}
else if(GateOpen == 1)
{
GateOpen =0;
MoveObject(Gate1, 1245.04, -767.49, 90.51, 4);
}
}
else
{
SendClientMessage(playerid,COLOR_ERROR,"Access Denied");
}
}
Changed it to "else if", because you're gate was actually working, but it was immediately moving back
Re: Move Gate -
nor15 - 10.07.2013
Thanks , Repped