SetPlayerDrunkLevel percentage
#1

Hello,

I'd like to know if it is possible to make a percentage of total SetPlayerDrunkLevel.


Rather something like this:
Код:
SendClientMessage(WantAlcool[playerid], COLOR_WHITE, "%s to now %s gram (s) in the blood", sendername, SetPlayerDrunkLevel);
Thank you for answering future.
Reply
#2

The maximum drunk level is 50000, which makes 1% 500.

Here's a function to work out the percentage of maximum from the player's maximum drunk level:
pawn Код:
stock GetPlayerDrunkPercentage(playerid)
{
    return (GetPlayerDrunkLevel(playerid) / 50000) * 100;
}
Reply
#3

Hello,

Thank you for this function, but uses it as well :

pawn Код:
SendClientMessage(WantAlcool[playerid], COLOR_WHITE, "%s to now %s gram (s) in the blood", sendername, GetPlayerDrunkPercentage(playerid));
Because when I use it in this way just a little warning and displays
Reply
#4

You should really read up this http://en.wikipedia.org/wiki/Blood_alcohol_content.
You will need to know your specific maximum not the absolute maximum.
Most people will lose the ability to function between 0.2 and 0.39 percent of alcohol (Passout etc)

Once you know all that then you'll need to decide what the maximum level would be in relation to percent of alcohol for example a max drunk level of 10,000 would say represent 0.40 percent BAL (A very dangerous level)

So we divide 0.40 / 10000 which gives us an intoxication level of 0.00004 percent per drunk level unit but you can really calculate this out how you want.
Reply
#5

Thank you for these explanations.
I always have an error warning ..
Reply
#6

UP...
Reply
#7

What is the problem?
Show the error/warning
Reply
#8

Hello

warning is :
Код:
C:\Users\packard bell\Desktop\San Andreas RP Dev\gamemodes\sarp.pwn(10301) : warning 202: number of arguments does not match definition
C:\Users\packard bell\Desktop\San Andreas RP Dev\gamemodes\sarp.pwn(10301) : warning 202: number of arguments does not match definition
ligne
pawn Код:
SendClientMessage(WantAlcool[playerid], COLOR_WHITE, "%s to now %s gram (s) in the blood", sendername, GetPlayerDrunkPercentage(playerid));
Reply
#9

Hello,

The function does not work, it gives me a blank.
as its most prйsicement:
The player program in the blood.
So normally it is: The player to 10 grams in the blood, for example.
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)