Help in CP's please :'( - 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)
+--- Thread: Help in CP's please :'( (
/showthread.php?tid=472073)
Deleted. -
iFiras - 26.10.2013
Deleted.
Re: Help in CP's please :'( -
EiresJason - 26.10.2013
Well, you could make it so when you teleport them in/out, it puts to them slightly to the side of the checkpoint, instead of directly on top of where the checkpoint is.
Deleted. -
iFiras - 26.10.2013
Deleted.
Re: Help in CP's please :'( -
Konstantinos - 26.10.2013
I don't really understand what you want, but you may find this useful.
Let's say you want to know the position of a checkpoint (example: SupaExitCP[playerid]).
pawn Код:
new
Float: cp_x,
Float: cp_y,
Float: cp_z
;
Streamer_GetFloatData( STREAMER_TYPE_CP, SupaExitCP[ playerid ], E_STREAMER_X, cp_x );
Streamer_GetFloatData( STREAMER_TYPE_CP, SupaExitCP[ playerid ], E_STREAMER_Y, cp_y );
Streamer_GetFloatData( STREAMER_TYPE_CP, SupaExitCP[ playerid ], E_STREAMER_Z, cp_z );
SetPlayerPos( playerid, cp_x, cp_y, cp_z );
It will teleport you to its position.
Re: Help in CP's please :'( -
EiresJason - 26.10.2013
You could try something like this.
When someone enters a CP, it sets a variable.
If they try to enter a CP within 5 seconds, it will not do anything.
Try this.
pawn Код:
if(checkpointid == SupaSaveCP[playerid])
{
if(tickcount()/1000 - GetPVarInt(playerid,"RecentlyEnteredCP")/1000 > 5)
{
if(GetPlayerControllable(playerid) == 1)
{
SetPlayerPos(playerid,485.0322,-2378.1455,10.7833);
SetPlayerInterior(playerid,12);
TogglePlayerControllable(playerid,0);
SetPlayerFacingAngle(playerid,179.3945);
TextDrawShowForPlayer(playerid,LoadingObjs);
TextDrawShowForPlayer(playerid,LoadingBOX);
TextDrawShowForPlayer(playerid,Please);
SetTimer("UnfreezePlayer",2000,false);
SetTimer("LoadingTDS",2000,false);
SetPVarInt(playerid,"RecentlyEnteredCP",tickcount());
}
}
else return 1;
}
if(checkpointid == SupaExitCP[playerid])
{
if(tickcount()/1000 - GetPVarInt(playerid,"RecentlyEnteredCP")/1000 > 5)
{
if(GetPlayerControllable(playerid) == 1)
{
SetPlayerPos(playerid,-2442.7317,755.4174,35.1719);
SetCameraBehindPlayer(playerid);
TogglePlayerControllable(playerid,0);
SetPlayerFacingAngle(playerid,177.3436);
SetPlayerInterior(playerid,0);
SetTimer("UnfreezePlayer",2000,false);
SetPVarInt(playerid,"RecentlyEnteredCP",gettime());
}
}
else return 1;
Set '5' to whatever is needed.
Deleted. -
iFiras - 26.10.2013
Deleted.
Re: Help in CP's please :'( -
EiresJason - 26.10.2013
Np