GetPlayerDrunkLevel Question
#1

Can we make with GetPlayerDrunkLevel for cops a command ?, like /checkdrunk [id] and then if you enter it, it says The Player is drunk or with SetPlayerDrunkLevel number?
Reply
#2

Yes.
code:
pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    new cmd[128], idx;
    cmd = strtok(cmdtext, idx);
 
    if(strcmp(cmd, "/checkdrunk", true) == 0)
    {
        new tmp[128], drunkz0r;
        tmp = strtok(cmdtext, idx);
 
        if(strlen(tmp) == 0) return SendClientMessage(playerid, 0xFFFFFFFF, "USAGE: /checkdrunk [playerid]");
 
        GetPlayerDrunkLevel(strval(tmp));
        if(drunkz0r > 0)
        {
         SendClientMessageToAll(0xFFFFFFFF, "w000t someone is drunk!!!11one!11");
        }
        return 1;
    }
    return 0;
}
Should work
correct me if I'm wrong.
Reply
#3

This one is ok, but it should say, how much drunk he has, not just he is drunk.
Reply
#4

Mayb you can try something like this,

Код:
if(GetPlayerDrunkLevel(playerid) > 1999 && GetPlayerDrunkLevel(playerid) < 2499) {
SendClientMessage(playerid, 0xFFFFFFFF, "Drunk rate 1");

if(GetPlayerDrunkLevel(playerid) > 2499 && GetPlayerDrunkLevel(playerid) < 2999) {
SendClientMessage(playerid, 0xFFFFFFFF, "Drunk rate 2");

if(GetPlayerDrunkLevel(playerid) > 2999 && GetPlayerDrunkLevel(playerid) < 3499) {
SendClientMessage(playerid, 0xFFFFFFFF, "Drunk rate 3");
Etc.

I believe the highest GetPlayerDrunkLevel is 50000 so i would set the drunk levels higher else u need to make 100 rates.
Reply
#5

Quote:
Originally Posted by wijnkamp
Mayb you can try something like this,

Код:
if(GetPlayerDrunkLevel(playerid) > 1999 && GetPlayerDrunkLevel(playerid) < 2499) {
SendClientMessage(playerid, 0xFFFFFFFF, "Drunk rate 1");

if(GetPlayerDrunkLevel(playerid) > 2499 && GetPlayerDrunkLevel(playerid) < 2999) {
SendClientMessage(playerid, 0xFFFFFFFF, "Drunk rate 2");

if(GetPlayerDrunkLevel(playerid) > 2999 && GetPlayerDrunkLevel(playerid) < 3499) {
SendClientMessage(playerid, 0xFFFFFFFF, "Drunk rate 3");
Etc.

I believe the highest GetPlayerDrunkLevel is 50000 so i would set the drunk levels higher else u need to make 100 rates.
GetPlayerDrunkLevel can't pass 2000..
Reply
#6

Quote:
Originally Posted by MenaceX^
GetPlayerDrunkLevel can't pass 2000..
What? If drunk level is under 2000 player is sober.
Reply
#7

Quote:
Originally Posted by $ЂЯĢ
If drunk level is under 2000 player is sober.
Uhm... if an average sized human male had a BAC of 2000, his blood would be 200% proof alcohol... he'd wake up with a visible migrain and he'd be in bed in someone else's house in a different city and the dude next to him would be wearing his underwear on his head.


...Also his wallet would be gone.
Reply
#8

Quote:
Originally Posted by Joe Staff
Quote:
Originally Posted by $ЂЯĢ
If drunk level is under 2000 player is sober.
Uhm... if an average sized human male had a BAC of 2000, his blood would be 200% proof alcohol... he'd wake up with a visible migrain and he'd be in bed in someone else's house in a different city and the dude next to him would be wearing his underwear on his head.


...Also his wallet would be gone.
nice one
truly said!
But i guess there is some other drunk system in the game, not connected to real life. (i didn't check 0.3 funcs jet so i don't know)

Luxeon
Reply
#9

Quote:
Originally Posted by Joe Staff
Quote:
Originally Posted by $ЂЯĢ
If drunk level is under 2000 player is sober.
Uhm... if an average sized human male had a BAC of 2000, his blood would be 200% proof alcohol... he'd wake up with a visible migrain and he'd be in bed in someone else's house in a different city and the dude next to him would be wearing his underwear on his head.


...Also his wallet would be gone.
Lol. We were talking about programming.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)