CMD:recolherdrogas(playerid, params[])
{
if(JaPlantouDrogas[playerid] == 1 || JaPlantouDrogas[playerid] == 0) return SCM(playerid, COLOR_ERRO, "| ERRO | Vocк ainda nгo plantou ou ainda nгo deu o tempo.");
else if(JaPlantouDrogas[playerid] == 2)
{
new Float:randmaconha = randomEx(0.100, 0.400), Float:randcrack = randomEx(0.050, 0.200), Float: randcocaina = randomEx(0.020, 0.100); // Essa linha
JaPlantouDrogas[playerid] = 0,
PlayerInfo[playerid][pMaconha] = randmaconha,
PlayerInfo[playerid][pCrack] = randcrack,
PlayerInfo[playerid][pCocaina] = randcocaina;
MensagemFormatada(playerid, 0x80FF00FF, "| DROGAS | Vocк recolheu [ {FFFFFF}%f de Maconha {80FF00}], [ {FFFFFF}%f de Crack {80FF00}] e [ {FFFFFF}%f de Cocaina {80FF00}]", randmaconha, randcrack, randcocaina);
}
return 1;
}
frandom(Float:max, Float:min = 0.0, dp = 4)
{
new
Float:mul = floatpower(10.0, dp),
imin = floatround(min * mul),
imax = floatround(max * mul);
return float(random(imax - imin) + imin) / mul;// Nessa linha
}
CMD:recolherdrogas(playerid, params[])
{
if(PlayerInfo[playerid][Prof] != PROF_PLANTADOR_DE_DROGA) return SCM(playerid, COLOR_ERRO, "| ERRO | Vocк nгo й um(a) Plantador(a) de Drogas.");
if(JaPlantouDrogas[playerid] == 1 || JaPlantouDrogas[playerid] == 0) return SCM(playerid, COLOR_ERRO, "| ERRO | Vocк ainda nгo plantou ou ainda nгo deu o tempo.");
else if(JaPlantouDrogas[playerid] == 2)
{
new Float:randmaconha = frandom(0.100, 0.400, 4), Float:randcrack = frandom(0.050, 0.200, 1), Float:randcocaina = frandom(0.020, 0.100, 1);
JaPlantouDrogas[playerid] = 0,
PlayerInfo[playerid][pMaconha] = randmaconha,
PlayerInfo[playerid][pCrack] = randcrack,
PlayerInfo[playerid][pCocaina] = randcocaina;
MensagemFormatada(playerid, 0x80FF00FF, "| DROGAS | Vocк recolheu [ {FFFFFF}%f de Maconha {80FF00}], [ {FFFFFF}%f de Crack {80FF00}] e [ {FFFFFF}%f de Cocaina {80FF00}]", randmaconha, randcrack, randcocaina);
}
return 1;
}
Float:frandom(Float:max, Float:min = 0.0, dp = 4)
{
new
Float:mul = floatpower(10.0, dp),
imin = floatround(min * mul),
imax = floatround(max * mul);
return float(random(imax - imin) + imin) / mul;
}
PHP код:
|
stock Float:frandom(Float:max, Float:min = 0.0, dp = 4)
{
new Float:mul = floatpower(10.0, dp), imin = floatround(min * mul), imax = floatround(max * mul);
return float(random(imax - imin) + imin) / mul;
}