Warp an player
#1

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
Reply
#2

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
Reply
#3

No i dont want timers, i want a code where the player will be warp into the sky
Reply
#4

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
Reply
#5

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.
Reply
#6

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
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)