06.11.2012, 14:57
Olha so
Onde ele pega e seta
A media na msg tmb mostra bem escrotao :S
Variavel media
pawn Код:
stock GetPlayerSpeed(playerid)
{
new Float:ST[4];
if(IsPlayerInAnyVehicle(playerid))
GetVehicleVelocity(GetPlayerVehicleID(playerid),ST[0],ST[1],ST[2]);
else GetPlayerVelocity(playerid,ST[0],ST[1],ST[2]);
ST[3] = floatsqroot(floatpower(floatabs(ST[0]), 2.0) + floatpower(floatabs(ST[1]), 2.0) + floatpower(floatabs(ST[2]), 2.0)) * 100.3;
return floatround(ST[3]);
}
pawn Код:
SendClientMessage(playerid,-1,"Controlador de velocidade ativado");
Check[playerid] = SetTimerEx("Atuavelo", 100, true, "i", playerid);
Media[playerid] = GetPlayerSpeed(playerid);
format(Don,sizeof(Don),"Sua velocidade esta travada na media de %i .", GetPlayerSpeed(playerid));
SendClientMessage(playerid,-1,Don);
format(Don,sizeof(Don),"Media ficou %i .", Media[playerid]);
SendClientMessage(playerid,-1,Don);
Variavel media
pawn Код:
new Float:Media[MAX_PLAYERS];