07.08.2013, 04:25
problem is Passenger too getting drift points
i want to only drift points for DRIVER not for pessenger
help me
i want to only drift points for DRIVER not for pessenger
help me
PHP код:
public Drift(){
new Float:Angle1, Float:Angle2, Float:BySpeed, s[128];
new Float:Z;
new Float:X;
new Float:Y;
new Float:SpeedX;
for(new g=0;g<200;g++){
GetPlayerPos(g, X, Y, Z);
SpeedX = floatsqroot(floatadd(floatadd(floatpower(floatabs(floatsub(X,SavedPos[ g ][ sX ])),2),floatpower(floatabs(floatsub(Y,SavedPos[ g ][ sY ])),2)),floatpower(floatabs(floatsub(Z,SavedPos[ g ][ sZ ])),2)));
Angle1 = ReturnPlayerAngle(g);
Angle2 = GetPlayerTheoreticAngle(g);
BySpeed = floatmul(SpeedX, 12);
if(IsPlayerInAnyVehicle(g) && IsCar(GetPlayerVehicleID(g)) && floatabs(floatsub(Angle1, Angle2)) > DRIFT_MINKAT && floatabs(floatsub(Angle1, Angle2)) < DRIFT_MAXKAT && BySpeed > DRIFT_SPEED){
if(PlayerDriftCancellation[g] > 0)KillTimer(PlayerDriftCancellation[g]);
PlayerDriftCancellation[g] = 0;
DriftPointsNow[g] += floatval( floatabs(floatsub(Angle1, Angle2)) * 3 * (BySpeed*0.1) )/10;
PlayerDriftCancellation[g] = SetTimerEx("DriftCancellation", 3000, 0, "d", g);
}
if(DriftPointsNow[g] > 0){
format(s, sizeof(s), "~n~~n~~n~~n~~n~~n~~n~~n~~w~_________________You are drifting!~n~___________________~p~Points: %d$!", DriftPointsNow[g]);
GameTextForPlayer(g, s, 3000, 3);
}
SavedPos[ g ][ sX ] = X;
SavedPos[ g ][ sY ] = Y;
SavedPos[ g ][ sZ ] = Z;
}
}