Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- stock Float:GetXYInFrontOfPlayer(playerid, &Float:x, &Float:y, Float:distance)
- {
- static Float:a;
- GetPlayerPos(playerid, x, y, a);
- if(IsPlayerInAnyVehicle(playerid))
- GetVehicleZAngle(GetPlayerVehicleID(playerid), a);
- else
- GetPlayerFacingAngle(playerid, a);
- x += (distance * floatsin(-a, degrees));
- y += (distance * floatcos(-a, degrees));
- return a;
- }
- stock BoostPlayer(playerid, Float:speed, bool:use_z = false)
- {
- static
- Float:X, Float:Y, Float:Z,
- Float:x, Float:y, Float:z;
- GetPlayerPos(playerid, x, y, z);
- GetPlayerPos(playerid, X, Y, Z);
- GetXYInFrontOfPlayer(playerid, X, Y, speed);
- x = ((X < x) ? (x - X) : (X - x));
- y = ((Y < y) ? (y - Y) : (Y - y));
- if(use_z)
- z = ((Z < z) ? (z - Z) : (Z - z));
- else
- z = 0.0;
- return SetPlayerVelocity(playerid, x, y, z);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement