18.06.2011, 08:15
Well, I put together a gate script to where when you type certain commands, the gates open and close. But only ONE of the gates works, and I can't seem to find out why. Any help? 

Код:
#include <a_samp>
new agate1;
new agate2;
new tygate;
#if defined FILTERSCRIPT
public OnFilterScriptInit()
{
print("\n--------------------------------------");
print(" Blank Filterscript by your name here");
print("--------------------------------------\n");
return 1;
}
public OnFilterScriptExit()
{
return 1;
}
#else
main()
{
print("\n----------------------------------");
print(" Blank Gamemode by your name here");
print("----------------------------------\n");
}
#endif
public OnGameModeInit()
{
// Don't use these lines if it's a filterscript
SetGameModeText("Blank Script");
AddPlayerClass(0, 1958.3783, 1343.1572, 15.3746, 269.1425, 0, 0, 0, 0, 0, 0);
agate1 = CreateObject(3049, -2243.1083984375, 645.521484375, 50.687446594238, 0, 0, 92.999267578);
agate2 = CreateObject(3037, -2201.75390625, 668.16943359375, 68.796875, 0, 0, 0);
tygate = CreateObject(988, 1497.4320068359, -699.79998779297, 93.75, 0, 0, 0);
return 1;
}
public OnPlayerCommandText(playerid, cmdtext[])
{
if (!strcmp("/agate1close", cmdtext))
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, -2243.1083984375, 645.521484375, 50.687446594238))
{
MoveObject(agate1, -2243.1083984375, 645.521484375, 50.687446594238, 1);
}
return 1;
}
if (!strcmp("/agate2close", cmdtext))
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, -2204.9787597656, 686.09515380859, 66.60084533694))
{
MoveObject(agate2, -2204.9787597656, 686.09515380859, 66.60084533694, 1);
}
return 1;
}
if (!strcmp("/tygatec", cmdtext))
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, -2243.1083984375, 645.521484375, 50.687446594238))
{
MoveObject(tygate, 1497.4320068359, -699.79998779297, 93.75, 1);
}
return 1;
}
if (!strcmp("/agate1open", cmdtext))
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, -2243.1083984375, 645.521484375, 50.687446594238))
{
MoveObject(agate1, -2243.1083984375, 645.521484375, 46.687446594238, 1);
}
return 1;
}
if (!strcmp("/agate2open", cmdtext))
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, -2243.1083984375, 645.521484375, 50.687446594238))
{
MoveObject(agate2, -2204.9787597656, 686.09515380859, 66.60084533694, 1);
}
return 1;
}
if (!strcmp("/tygateo", cmdtext))
{
if(IsPlayerInRangeOfPoint(playerid, 7.0, 1497.4320068359, -699.79998779297, 93.75))
{
MoveObject(tygate, 1497.4320068359, -699.79998779297, 89.55, 1);
}
return 1;
}
return 0;
}

