how could i do a speedboost on foot?
#1

hello people, i'm here to ask could I do a speedboost but on foot? I tried something like this:
Код:
			new Float:speed[3], Float:x,Float:y,Float:z,Float:total;
			GetPlayerVelocity(playerid, speed[0], speed[1], speed[2]);
			total = floatsqroot((speed[0] * speed[0]) + (speed[1] * speed[1]) + (speed[2] * speed[2]));
			total += 1;
			SetPlayerVelocity(playerid,x,y,z);
But it has no effect :S
What am I missing ro doing wrong?

thanks for help

(I'm on 0.3c RC6)
Reply
#2

pawn Код:
new
    Float: v_X,
    Float: v_Y,
    Float: p_Angle
;
GetPlayerVelocity(playerid, v_X, v_Y, p_Angle);
GetPlayerFacingAngle(playerid, p_Angle);
SetPlayerVelocity(playerid, v_X + (2.0 * floatcos(-p_Angle, degrees)), v_Y + (2.0 * floatsin(-p_Angle, degrees)), 0.0);
Try this. Should work.
Reply
#3

it's not working :S i'm using a command which activates a timer Ex and calls a custom callback to activate the boost but when i type the command, the player only loose health and doesnt go faster.... (I don't have any SetPlayerHealth in my command nor my callback)
Reply
#4

bump :P
Reply
#5

You can't boost yourself on foot, thats like having wheels instead of legs.
Reply
#6

but i've seen on a server a few months ago a pick-up (adrenaline) that when you walked on it, your on foot speed would be faster... Thats what i mean for the speed boost i want. Does anyone knows how to do this?
Reply
#7

buump
Reply
#8

Quote:
Originally Posted by pmk1
Посмотреть сообщение
but i've seen on a server a few months ago a pick-up (adrenaline) that when you walked on it, your on foot speed would be faster... Thats what i mean for the speed boost i want. Does anyone knows how to do this?
No it isn't speed boost. I thought it was speed boost too but ended looking at another friend on this server with the same thing. It is the adrenaline effect, not the speed boost.
Reply
#9

onplayerkeystatechange or..

pawn Код:
/*
        By JaTochNietDan with help from Killerkid
*/

 
#include <a_samp>
 
forward Speedboost();
 
public OnFilterScriptInit()
{
        SetTimer("Speedboost",200,1);
        return 1;
}
 
public Speedboost()
{
        for(new i; i < MAX_PLAYERS; i++)
        {
                if(IsPlayerConnected(i) && !IsPlayerNPC(i))
                {
                        new Keys,up,down;
                        GetPlayerKeys(i,Keys,up,down);
                        if(Keys &= 1024)
                        {
                                if(GetPlayerState(i) == PLAYER_STATE_ONFOOT)
                                {
                                        new Float:x,Float:y,Float:z;
                                        GetPlayerVelocity(i,x,y,z);
                                        SetPlayerVelocity(i,x+(x / 4),y+(y / 4),z+(z / 4));
                                }
                        }
                        GetPlayerKeys(i,Keys,up,down);
                        if(Keys &= 4)
                        {
                                if(GetPlayerState(i) == PLAYER_STATE_DRIVER)
                                {
                                        new Float:x,Float:y,Float:z;
                                        GetVehicleVelocity(GetPlayerVehicleID(i),x,y,z);
                                        SetVehicleVelocity(GetPlayerVehicleID(i),x+(x / 4),y+(y / 4),z+(z / 4));
                                }
                        }
                }      
        }
        return 1;
}
Reply
#10

adrenaline effect? it is already existing or we have to script it?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)