SA-MP Forums Archive
how could i do a speedboost on foot? - 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: how could i do a speedboost on foot? (/showthread.php?tid=202592)



how could i do a speedboost on foot? - pmk1 - 24.12.2010

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)


Re: how could i do a speedboost on foot? - RyDeR` - 24.12.2010

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.


Re: how could i do a speedboost on foot? - pmk1 - 24.12.2010

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)


Re: how could i do a speedboost on foot? - pmk1 - 25.12.2010

bump :P


Re: how could i do a speedboost on foot? - Mean - 25.12.2010

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


Re: how could i do a speedboost on foot? - pmk1 - 25.12.2010

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?


Re: how could i do a speedboost on foot? - pmk1 - 26.12.2010

buump


Re: how could i do a speedboost on foot? - ToPhrESH - 26.12.2010

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.


Re: how could i do a speedboost on foot? - The_Gangstas - 26.12.2010

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;
}



Re: how could i do a speedboost on foot? - pmk1 - 26.12.2010

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