new Float:Media[MAX_PLAYERS];
Media[playerid] = GetPlayerSpeed(playerid);
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]);
}
stock Float: GetPlayerSpeed(playerid)
C:\Documents and Settings\Mauricio\Desktop\GameServer\gamemodes\Controlador.pwn(67) : warning 208: function with tag result used before definition, forcing reparse
C:\Documents and Settings\Mauricio\Desktop\GameServer\gamemodes\Controlador.pwn(74) : warning 213: tag mismatch
Pawn compiler 3.2.3664 Copyright (c) 1997-2006, ITB CompuPhase
2 Warnings.
stock Float: 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 ST[3];
}
O negocio й o seguinte eu nгo tirei isso de nada, й logica se vocк usa um Variбvel Float vocк terб que ter uma funзгo que retorne Float, soh nгo deu certo pois tem o floatround no retorno.
pawn Код:
|
kkkkkkkkkkkkkkkkk Com isso ae bugo tudo ... Voce te dar uma noзao . Fiz duas msg para mostrar a media e a velocidade a velocidade ta certa a media nao ... |