17.07.2010, 04:47
Guys, I'm using Luby's drift point counter. I need help showing the textdraw( which i included, cause it did not come with it) all the time. The problem is that if i put the text under onplayer connect, it will just show it and it will hide, also on playerspawn. Reason is that because its only shown everytime i make a drift.
So i got this,
ok, so after i finish drifting, the textdraw will hide.
btw, here is the DriftCancellation:
So the question is, how to make the textdraw show ALL the time?
So i got this,
pawn Код:
public Drift()
{
new Float:Angle1, Float:Angle2, Float:BySpeed, s[256];
new Float:Z,Float:X,Float:Y,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),"Drift Points: $ %d",DriftPointsNow[g]);
TextDrawShowForPlayer(g,DriftText);
TextDrawSetString(DriftText,s);
}
SavedPos[ g ][ sX ] = X;
SavedPos[ g ][ sY ] = Y;
SavedPos[ g ][ sZ ] = Z;
}
}
btw, here is the DriftCancellation:
pawn Код:
public DriftCancellation(playerid)
{
PlayerDriftCancellation[playerid] = 0;
GivePlayerMoney(playerid, DriftPointsNow[playerid]);
DriftPointsNow[playerid] = 0;
TextDrawSetString(DriftText,DriftPointsNow);
}