[HELP] Set a player in a place for a time - 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: [HELP] Set a player in a place for a time (
/showthread.php?tid=172788)
[HELP] Set a player in a place for a time -
BlacK_PT - 31.08.2010
Well I need to know how to put a player in a place for a certain time and then set him to other place after that time
EX:
the player does a command /fly
it teleports the player to an interior for 10 seconds
it teleports the player to other place after those 10 seconds
Re: [HELP] Set a player in a place for a time -
LarzI - 31.08.2010
Use timers
EDIT: Example:
pawn Код:
//timer function
forward FlyTimer(playerid);
public FlyTimer(playerid)
{
SetPlayerPos( playerid, 0.0, 0.0, 0.0 ); //This is where you will teleport AFTER 10 seconds
//SetPlayerInterior( ... );
}
pawn Код:
//command
if( !strcmp( cmdtext, "/fly", true ))
{
SetPlayerPos( playerid, 0.0, 0.0, 0.0 ); //This is where you go when typing the command
//SetPlayerInterior( ... );
gFlyTimer = SetTimerEx( "FlyTimer", 1000, false, "i", playerid );
return true;
}
Re: [HELP] Set a player in a place for a time -
BlacK_PT - 31.08.2010
I dont know nothing about timers... can you help with a simple one?
Re: [HELP] Set a player in a place for a time -
LarzI - 31.08.2010
Look at my example.
Re: [HELP] Set a player in a place for a time -
BlacK_PT - 31.08.2010
Ok but I want the command to be used in a place
EX: There's an icon that when you get near it it gives you a gametext for player saying /fly, BUT /fly can only be used in that place
How do i do it? X_x
Re: [HELP] Set a player in a place for a time -
Claude - 31.08.2010
https://sampwiki.blast.hk/wiki/Areacheck
Re: [HELP] Set a player in a place for a time -
LarzI - 31.08.2010
As Claude linked; use areachecks and pickups (if you don't want an icon, pickups is unecaserry)
EDIT: Btw, for areachecks, I recommend using IsPlayerInRangeOfPoint.
Re: [HELP] Set a player in a place for a time -
BlacK_PT - 31.08.2010
Nevermind,I'll just use
if (PlayerToPoint(2.0, playerid,x,y.z))
Re: [HELP] Set a player in a place for a time -
LarzI - 31.08.2010
IsPlayerInRangeOfPoint is exactly the same as PlayerToPoint, and IsPlayerInRangeOfPoint is already implemented..
Re: [HELP] Set a player in a place for a time -
BlacK_PT - 31.08.2010
So is PlayerToPoint