Warp an player - 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: Warp an player (
/showthread.php?tid=144000)
Warp an player -
scott1 - 25.04.2010
Hi, i would like to warp an player in the air, but when i put him, he fall on the floor an die, i would like he stay in the air
Код:
Код:
SetPlayerPos(i, 1228.5,-1265.1,140.8);
TogglePlayerControllable(i, 0);
i tried this, but didnt work
Thank
Re: Warp an player -
0ne - 25.04.2010
Try:
pawn Код:
for (new i=0;i <MAX_PLAYERS;i++)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(i,X,Y,Z);
SetPlayerPos(i,X,Y,Z+10);
TogglePlayerControllable(i,false);
return 1;
}
If he still doesn't stay in the air make a timer of 500miliseconds and then set his controllable 0
Re: Warp an player -
scott1 - 25.04.2010
No i dont want timers, i want a code where the player will be warp into the sky
Re: Warp an player -
IamNotKoolllll - 25.04.2010
Quote:
Originally Posted by scott1
No i dont want timers, i want a code where the player will be warp into the sky
|
pawn Код:
TogglePlayerControllable(playerid, 0);
SetPlayerPos(playerid, x, y, z);
:3
Re: Warp an player -
0ne - 25.04.2010
Quote:
Originally Posted by scott1
No i dont want timers, i want a code where the player will be warp into the sky
|
So that is what i am saying, You could do on the command like:
pawn Код:
if (strcmp("/cmd", cmd, true) == 0)
{
new Float:X,Float:Y,Float:Z;
GetPlayerPos(playerid,X,Y,Z);
SetPlayerPos(playerid,X,Y,Z+10);
TogglePlayerControllable(playerid,false);
}
return 1;
}
IF THE ABOVE DOESN'T WORK Do a timer like:
pawn Код:
if (strcmp("/cmd", cmd, true) == 0)
{
new Float:X,Float:Y,Float:Z,timer;
GetPlayerPos(playerid,X,Y,Z);
SetPlayerPos(playerid,X,Y,Z+10);
timer = SetTimerEx("control",500,false,"i",playerid);
}
return 1;
}
forward control(playerid);
public control(playerid)
{
TogglePlayerControllable(playerid,false);
return 1;
}
NotKoool's code should work too.
Re: Warp an player -
scott1 - 25.04.2010
Quote:
Originally Posted by IamNotKoolllll
Quote:
Originally Posted by scott1
No i dont want timers, i want a code where the player will be warp into the sky
|
pawn Код:
TogglePlayerControllable(playerid, 0); SetPlayerPos(playerid, x, y, z);
:3
|
Tried, didn't worked.
I dont want an timer, cauz it's in my tuto