Thread: [Include] FunctionEdit v1.0
View Single Post
Old 30/05/2012, 09:13 PM   #8
Lós
High-roller
 
Lós's Avatar
 
Join Date: Sep 2010
Location: Casterly Rock
Posts: 4,384
Reputation: 510
Default Re: FunctionEdit v1.0

Quote:
Originally Posted by Viniborn View Post
Tem coisas muito simples que além de facilitar, podem economizar memória.

Ex:
Code:
GetPlayerHealth(playerid, &Float:health); --> VBGetPlayerHealth(playerid);
GetPlayerArmour(playerid, &Float:armour); --> VBGetPlayerArmour(playerid);
GetPlayerFacingAngle(playerid,Float:Angle); --> VBGetPlayerFacingAngle(playerid);

Eu uso outras, mas não me recordo agora.
Peguei algumas suas e acrescentei as que eu lembrei também.

Code:
stock GetPlayerHealthEx(playerid)
{
    new Float:L_VIDA; GetPlayerHealth(playerid, L_VIDA);
    return floatround(L_VIDA);
}

stock GetPlayerArmourEx(playerid)
{
    new Float:L_COLETE; GetPlayerHealth(playerid, L_COLETE);
    return floatround(L_COLETE);
}

stock GetPlayerFacingAngleEx(playerid)
{
    new Float:L_FACING_ANGLE; GetPlayerFacingAngle(playerid, L_FACING_ANGLE);
    return floatround(L_FACING_ANGLE);
}

stock GetPlayerIpEx(playerid)
{
    new L_IP[16]; GetPlayerIp(playerid, L_IP, 16);
    return L_IP;
}

stock GetPlayerNameEx(playerid)
{
    new L_NOME[MAX_PLAYER_NAME]; GetPlayerName(playerid, L_NOME, MAX_PLAYER_NAME);
    return L_NOME;
}

stock GetPlayerVersionEx(playerid)
{
    new L_VERSAO[40]; GetPlayerVersion(playerid, L_VERSAO, sizeof(L_VERSAO));
    return L_VERSAO;
}
__________________


Lós is offline   Reply With Quote