SA-MP Forums Archive
GetPlayerDrunkLevel Question - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: GetPlayerDrunkLevel Question (/showthread.php?tid=103580)



GetPlayerDrunkLevel Question - Erkan - 20.10.2009

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?


Re: GetPlayerDrunkLevel Question - Damn Right M.I.A! - 20.10.2009

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.


Re: GetPlayerDrunkLevel Question - Erkan - 24.10.2009

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


Re: GetPlayerDrunkLevel Question - wijnkamp - 24.10.2009

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.


Re: GetPlayerDrunkLevel Question - MenaceX^ - 24.10.2009

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..


Re: GetPlayerDrunkLevel Question - Sergei - 24.10.2009

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


Re: GetPlayerDrunkLevel Question - Joe Staff - 24.10.2009

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.


Re: GetPlayerDrunkLevel Question - luxeon - 24.10.2009

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


Re: GetPlayerDrunkLevel Question - Sergei - 24.10.2009

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.