I need a help - Printable Version
+- SA-MP Forums Archive (
https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (
https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (
https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (
https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I need a help (
/showthread.php?tid=224317)
I need a help -
Ironboy - 11.02.2011
hello!
I made a moving object like a gate.
i want to make it move without any commands.
Is it possible? here it is the command
pawn Код:
if (strcmp("/op", cmdtext, true, 10) == 0)
{
MoveObject(Minigame, 1845.92114258,-1898.49877930,36.24028015,3);
return 1;
}
if (strcmp("/cl", cmdtext, true, 10) == 0)
{
MoveObject(Minigame, 1877.67846680,-1875.85620117,36.24028015,3);
return 1;
}
Re: I need a help -
Stigg - 11.02.2011
You could use a checkpoint to activate gate, or IsplayerInRangeOfPoint with a timer.
Just a couple of suggestions.
Peace...
Re: I need a help -
Ironboy - 11.02.2011
can you tell me with complete details
Re: I need a help -
Mean - 11.02.2011
pawn Код:
public OnGameModeInit( )
{
SetTimer( "opengate", (1 * 1000), 1 );
SetTimer( "closegate", (1 * 1000), 1 );
return true;
}
Down somewhere...
pawn Код:
forward opengate( );
public opengate( )
{
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if ( IsPlayerInRangeOfPoint( i, 5.0, Float:x, Float:y, Float:z ) ) // CHANGE THE X, Y, Z
MoveObject( Minigame, 1845.92114258,-1898.49877930,36.24028015,3 );
}
return true;
}
pawn Код:
forward closegate( );
public closegate( )
{
new a = 0;
for( new i = 0; i < MAX_PLAYERS; i++ )
{
if ( IsPlayerInRangeOfPoint( i, 5.0, Float:x, Float:y, Float:z ) ) // CHANGE THE X, Y, Z TOO
{
a++;
}
}
if ( a == 0 ) // If no one is close to the gates, it will close them!
MoveObject( Minigame, 1877.67846680,-1875.85620117,36.24028015,3 );
return true;
}
Re: I need a help -
Ironboy - 11.02.2011
ok ty very much