[SOLVED]I have an alcohol problem ..
#1

Okay so .. I have made a command .. to get a player drunk, kinda like to test out how to do stuff.

The command:

pawn Код:
dcmd_beer(playerid, params[])
{
    #pragma unused params
    new string[128];
    ImDrinking[playerid] = 1; // This bit sets the timer to recognise me as drinking.
    format(string,sizeof(string),"You now have a bottle of beer, break a leg!");
    SetPlayerSpecialAction(playerid,SPECIAL_ACTION_DRINK_BEER);
    return SendClientMessage(playerid, Green, string);
}
.. and the timer .. to complement the command .. is supposed to set the player with the drunk animation after drinking a little bit.

pawn Код:
Drunktimer = SetTimer("IrDrunk", 1000, 1);
pawn Код:
public irdrunk()
{
    for(new i; i<MAX_PLAYERS; i++)
    {
        if(IsPlayerConnected(i) && ImDrinking[i] == 1 && GetPlayerDrunkLevel(i) >= 4000)
        {
      ApplyAnimation(i,"PED","WALK_DRUNK",4.1,1,1,1,1,1);
        }
/*      if(IsPlayerConnected(i) && ImDrinking[i] && GetPlayerDrunkLevel(i) >= 20000)
        {
          SetPlayerHealth(i, 0);
        } */

    }
    return 1;
}
.. but it doesn't work ... any idea's why

Thanks in advance.

EDIT:

Lmao .. never mind I solved it .. I should really pay attention a bit more.

The error was down to a mistake in letter-case the timer was calling "IrDrunk" when the function was called "irdrunk".

Solved .. how embarrassing.
Reply
#2

wrong section, you should post this under 0.3 section
Reply
#3

It doesn't really matter as it's solved
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)