Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- TimerEx(CountDrift -> playerid) {
- // Timer(CountDrift) {
- static Float: Angle[2];
- static Float: Speed[2];
- static Float: Position[3];
- static s[96];
- // for(new playerid; playerid < MAX_PLAYERS; playerid++) {
- GetPlayerPos(playerid, Position[0], Position[1], Position[2]);
- Speed[1] = floatsqroot(floatadd(floatadd(floatpower(floatabs(floatsub(Position[0], SavedPos[playerid][sX])), 2), floatpower(floatabs(floatsub(Position[1], SavedPos[playerid][sY])), 2)), floatpower(floatabs(floatsub(Position[2], SavedPos[playerid][sZ])), 2)));
- Angle[0] = ReturnPlayerAngle(playerid);
- Angle[1] = GetPlayerTheoreticAngle(playerid);
- Speed[0] = floatmul(Speed[1], 12);
- if(GetPlayerState(playerid) == PLAYER_STATE_DRIVER && IsCar(GetPlayerVehicleID(playerid)) && floatabs(floatsub(Angle[0], Angle[1])) > DRIFT_MINKAT && floatabs(floatsub(Angle[0], Angle[1])) < DRIFT_MAXKAT && Speed[0] > DRIFT_SPEED) {
- if(Timer_PlayerDriftPoints[playerid] > 0) KillTimer(Timer_PlayerDriftPoints[playerid]);
- Timer_PlayerDriftPoints[playerid] = 0;
- PointsFromDrift[playerid] += floatval(floatabs(floatsub(Angle[0], Angle[1])) * 3 * (Speed[0] * 0.1)) / 10;
- Timer_PlayerDriftPoints[playerid] = SetTimerEx("LoadDrift", 3000, 0, "d", playerid);
- }
- if(PointsFromDrift[playerid] > 0) {
- format(s, sizeof(s), "\n\n\n%d $\n%d %s\n~k~~VEHICLE_FIREWEAPON~ - {FF0000}Nitro{FFFFFF}!", PointsFromDrift[playerid] / 2, PointsFromDrift[playerid], dli(PointsFromDrift[playerid], "Punkt", "Punkty", "Punktów"));
- UpdatePlayer3DTextLabelText(playerid, Drift3DText[playerid], -1, s);
- }
- SavedPos[playerid][sX] = Position[0];
- SavedPos[playerid][sY] = Position[1];
- SavedPos[playerid][sZ] = Position[2];
- // }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement