03.08.2014, 00:37
pawn Код:
CMD:consumir(playerid, params[])
{
new Float:Atributos[2];
GetPlayerHealth(playerid, Atributos[0]);
GetPlayerArmour(playerid, Atributos[1]);
if (!strcmp(params, "medicamento", true))
{
if(DatosPJ[playerid][pMedicamentos] >= 1)
{
DatosPJ[playerid][pMedicamentos] -= 1;
if(Atributos[0] >= 100) return 1;
else SetPlayerHealth(playerid, Atributos[0]+10);
if(Atributos[1] >= 100) return 1;
else SetPlayerArmour(playerid, Atributos[1]+10);
}
}
if (!strcmp(params, "crack", true))
{
if(DatosPJ[playerid][pCrack] >= 1)
{
DatosPJ[playerid][pCrack] -= 1;
if(Atributos[0] >= 100) return 1;
else SetPlayerHealth(playerid, Atributos[0]+10);
if(Atributos[1] >= 100) return 1;
else SetPlayerArmour(playerid, Atributos[1]+10);
}
} else SendClientMessage(playerid, -1, "Utiliza: /consumir [Medicamento/Crack]");
return 1;
}