[Ajuda] Me ajudem contador da net
#2

Quote:
Originally Posted by Tiger157000
Посмотреть сообщение
=== SOU NOVATO ===

peguei um contador na net mais nгo consigo desativar a textdraw dele alguem pode me ajudar?eu tentei assim fiz um menu aonde desativa outras text's e botei no dialog,mas nгo esta desativando oque eu fiz de errado me disseram que tem que por algo no codigo do drift: mais nгo sei oque eh,sou novo em pawno e to tentando aprender.

pawn Код:
bool:drift[MAX_PLAYERS]

onplayerconnect:

drift[playerid] = true;

if(listitem == 2)
{
 if(drift[playerid] == false)
{
drift[playerid] = true;
TextDrawShowForPlayer(playerid,Chet[playerid]);
SendClientMessage(playerid, -1, "Drift ativado!");
}else{
drift[playerid] = false;
TextDrawHideForPlayer(playerid,Chet[playerid]);
SendClientMessage(playerid, -1, "Drift desativado!");
}

OBS: isso e so a parte do drift nгo peguei todo o dialog do menu que desativa outras text's pois nгo e necessario.
CONTADOR:

pawn Код:
public Drift(playerid) {
new Float:Angle1, Float:Angle2, Float:BySpeed, s[128];
new Float:SpeedX;
for(new g = 0; g < MAX_PLAYERS; 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) && GetVType(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] += 10;
scores[g]++;
PlayerDriftCancellation[g] = SetTimerEx("DriftCancellation", 2000, 0, "d", g);
}
if(DriftPointsNow[g] > 0) {
if(scplay[g] == 1) {
TextDrawShowForPlayer(g,Chet[g]);
format(s, sizeof(s), "DRIFT:%d$", DriftPointsNow[g]);
TextDrawSetString(Chet[g], s);
}
}
SavedPos[g][sX] = X;
SavedPos[g][sY] = Y;
SavedPos[g][sZ] = Z;
}
}
Use as funзхes abaixo. Obs: Crie a forward da callback CancelarDraw(playerid)

pawn Код:
public Drift(playerid)
{

    new Float:Angle1,
        Float:Angle2,
        Float:BySpeed,
        Float:SpeedX,
        s[128];
       
    for(new g = 0; g < MAX_PLAYERS; 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) && GetVType(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] += 10;
                scores[g]++;
                PlayerDriftCancellation[g] = SetTimerEx("DriftCancellation", 2000, 0, "d", g);
        }
        if(DriftPointsNow[g] > 0) {
            if(scplay[g] == 1) {
                TextDrawShowForPlayer(g,Chet[g]);
                SetTimerEx("CancelarDraw",1000,0,"d",g);
                format(s, sizeof(s), "DRIFT:%d$", DriftPointsNow[g]);
                TextDrawSetString(Chet[g], s);
            }
        }
        SavedPos[g][sX] = X;
        SavedPos[g][sY] = Y;
        SavedPos[g][sZ] = Z;
    }
    return 1;
}

public CancelarDraw(playerid){
    TextDrawHideForPlayer(playerid,Chet[playerid]);
    return 1;
}
Reply


Messages In This Thread
Me ajudem contador da net - by Tiger157000 - 04.03.2015, 19:40
Re: Me ajudem contador da net - by Cidiei - 04.03.2015, 23:09
Re: Me ajudem contador da net - by Tiger157000 - 05.03.2015, 00:24
Re: Me ajudem contador da net - by Government - 05.03.2015, 02:06
Re: Me ajudem contador da net - by ipsLuan - 05.03.2015, 02:16
Re: Me ajudem contador da net - by Detoria - 05.03.2015, 02:17
Re: Me ajudem contador da net - by Government - 05.03.2015, 04:37
Re: Me ajudem contador da net - by Tiger157000 - 05.03.2015, 15:16

Forum Jump:


Users browsing this thread: 2 Guest(s)