SetPlayerVelocity [+rep]
#1

Hi everybody,

I made an human canon for my freeroam server and i don't know how to make the ejection.
The canon is vertical and I want the player to go on the sky.

My code :
pawn Код:
public OnPlayerEnterCheckpoint(playerid)
{
    if(canon[playerid] == true)
    {
        Decompte = SetTimerEx("CountDown", 1000, true,"%d",playerid);
        DisablePlayerCheckpoint(playerid);
    }
    return 1;
}
forward CountDown(playerid);
public CountDown(playerid)
{
     new str[128], Float:x, Float:y, Float:z;

     if(CountDownVar == 0)
     {
            KillTimer(Decompte);
            CountDownVar = 5;
            canon[playerid] = false;
            GetPlayerVelocity(playerid,x,y,z);
            SetPlayerVelocity(playerid,x,y,z+10000000);
     }
     else
     {

           CountDownVar--;
           format(str, sizeof(str), "Lancement dans : %ds", CountDownVar);
           GameTextForPlayer(playerid,str, 900, 0);
     }
}
but the player jump only 2 meters. If I do z*1000000 nothing happend.

Can you help me?

Thanks a lot!
Reply
#2

If it is vertical,why don't you set a timer and when it finishes counting SetPlayerPos(playerid,x,y,z+0.5)
Reply
#3

Because I want to make a countdown before the ejection and z+0.5 does nothing, except a small jump (1m)
Reply
#4

So make the countdown vefore ejection,and then make a reapeating countodwn of 1 sec wich will throw player in air 2 metheres?
Reply
#5

Okey but how to throw the player in the sky? SetPlayerVelocity(playerid,x,y,z+...); don"t work
Reply
#6

pawn Код:
SetPlayerPos(playerid,x,y,z+___)
With countdowns and then SetPlayerPos then again countdown ..................
Reply
#7

On the specific timer that is supossed to throw the player up do this,when the timer ends:
pawn Код:
GetPlayerPos(playerid,x,y,z);
SetPlayerPos(playerid,x,y,z+2);
and keep reseting timer to a defined variable like height=0;while the player goes up in sky increase the variable.In the end we may say the variable height it's 10,stop reseting the timer :P
Reply
#8

Why SetPlayerPos? I don't want the player be teleported in the sky^^
Reply
#9

If you will make it like z+2,it will seem like he's flying not teleporting,teleporting would be z+ZOMG/HUGE/NUMBER/HERE(to be over 1000 please)
Reply
#10

SetPlayerPos= Teleporting

Do you know how to do to make the player fly in the sky or no?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)