Drunk Level
#1

I am just trying to get Drunk Level shown as decimal

pawn Код:
new alko = GetPlayerDrunkLevel(pid) / 10000;
    format(string,sizeof(string),"* Personai asinīs ir %d promiles alkohola.",alko);
    SendClientMessage(playerid,COLOR_WHITE,string);
To understand better it is showing my drunk level without "." i want to show that like this "0.1" but all time it shows up without "."

I know noone understood me.. Just bad english today..
Reply
#2

pawn Код:
format(string,sizeof(string),"* Personai asinīs ir %.d promiles alkohola.",alko);
Not sure if will work tho.
Reply
#3

pawn Код:
new Float:alko = GetPlayerDrunkLevel(pid) / 10000;
format(string,sizeof(string),"* Personai asinīs ir %f promiles alkohola.",alko);
SendClientMessage(playerid,COLOR_WHITE,string);
Reply
#4

Try this:
Код:
new Float:alko = GetPlayerDrunkLevel(pid) / 10000;    
format(string,sizeof(string),"* Personai asinīs ir %f promiles alkohola.",alko);    
SendClientMessage(playerid,COLOR_WHITE,string);
Reply
#5

No that is showing the same but with .00000
these .00000 wont change ammount..
Reply
#6

Ak mans dievs, tu to drunk leveli dali ar 10k, un tā iznākums ir drausmīgi mazs, pat zem 0.00000001, Drunk Levelis pats automātiski ņemās nost pa kādiem 500 vienā sekundē, tev vajag to flaotu izprintēt kā %0.1f, lai printētu tikai vienu ciparu aiz komata.

ceru ka saprati.
Reply
#7

Ak dievs tu nepareizi domā...

Drunk level max ir 50k
25 ņemas nost katru sekundi..

Es sev uzlieku drunk level 1000 un vajadzētu būt 0.1 ut..t
drunk efekts sākas no 2k no 10k pazūd mapes ikona..
--------------------------------------- in english---------------
Drunk Level max is 50k
25 levels is taking off each sec.

i set my drunk level oveer 1k and it should show 0.1....

So my problem is, it wont sho numbers behind decimal ""1.0000"
Using float.
Reply
#8

its hard to xplain i cant really get it
Reply
#9

Drunk level isnt float, its decimal, so you need to use %d, but %d can't show digits behind comat, so you need to convert drunk level to float to print 0.1 etc

or just print format . .. . "Drunk level: 0.%d",GetPlayerDrunkLevel(playerid)/1000);
Reply
#10

FireCat, i'm bored of stupid posts your posting like if SA-MP checks them, you have like 5 that are valid... You need to stop wasting my time BTW i'm reporting you to SA-Mp for being such a time water...

---Thanks---
ExpertProgrammer
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)