Drunk Command Help
#1

Hello there,
I've tried of making /Drunk on and /Drunk off command for my server,Well the /Drunk on command works perfect:
pawn Код:
if (strcmp("/drunk on", cmdtext, true, 8) == 0)
    {
    SetPlayerDrunkLevel (playerid, 50000);
    GameTextForPlayer(playerid,"~W~Drunk Mode Is ~g~On!",3000,5);
    ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1);
    return 1;
    }
But i have some errors with the /Drunk off command:
pawn Код:
if (strcmp("/drunk off", cmdtext, true, 9) == 0)
    {
    if GetPlayerDrunkLevel(playerid) < 2000)
    SendClientMessage(playerid,0xFFFFFFFF,"You are not Drunk!");
    else
        SetPlayerDrunkLevel (playerid, 0);
    GameTextForPlayer(playerid,"~W~Drunk Mode Is ~R~Off!",3000,5);
    ClearAnimations(playerid);
    return 1;
    }
The errors are:
Код:
C:\Users\Gta san andreas\Desktop\Black & White Stunting\gamemodes\BlackNwhite.pwn(875) : error 001: expected token: "*then", but found ")"
C:\Users\Gta san andreas\Desktop\Black & White Stunting\gamemodes\BlackNwhite.pwn(875) : error 029: invalid expression, assumed zero
C:\Users\Gta san andreas\Desktop\Black & White Stunting\gamemodes\BlackNwhite.pwn(877) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Sorry i'm the worst scripter ever.
I'd really appreciate help,Thanks in advance.
Reply
#2

Try this:

pawn Код:
if (strcmp("/drunk off", cmdtext, true, 10) == 0)
{
   if GetPlayerDrunkLevel(playerid) < 2000)
   {
     SendClientMessage(playerid,0xFFFFFFFF,"You are not Drunk!");
   }
   else
   {
     SetPlayerDrunkLevel (playerid, 0);
     GameTextForPlayer(playerid,"~W~Drunk Mode Is ~R~Off!",3000,5);
     ClearAnimations(playerid);
   }
   return 1;
}
Reply
#3

Quote:
Originally Posted by ►ϻozilla Fir3foж◄
Hello there,
I've tried of making /Drunk on and /Drunk off command for my server,Well the /Drunk on command works perfect:
pawn Код:
if (strcmp("/drunk on", cmdtext, true, 8) == 0)
    {
    SetPlayerDrunkLevel (playerid, 50000);
    GameTextForPlayer(playerid,"~W~Drunk Mode Is ~g~On!",3000,5);
    ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1);
    return 1;
    }
But i have some errors with the /Drunk off command:
pawn Код:
if (strcmp("/drunk off", cmdtext, true, 9) == 0)
    {
    if GetPlayerDrunkLevel(playerid) < 2000)
    SendClientMessage(playerid,0xFFFFFFFF,"You are not Drunk!");
    else
        SetPlayerDrunkLevel (playerid, 0);
    GameTextForPlayer(playerid,"~W~Drunk Mode Is ~R~Off!",3000,5);
    ClearAnimations(playerid);
    return 1;
    }
The errors are:
Код:
C:\Users\Gta san andreas\Desktop\Black & White Stunting\gamemodes\BlackNwhite.pwn(875) : error 001: expected token: "*then", but found ")"
C:\Users\Gta san andreas\Desktop\Black & White Stunting\gamemodes\BlackNwhite.pwn(875) : error 029: invalid expression, assumed zero
C:\Users\Gta san andreas\Desktop\Black & White Stunting\gamemodes\BlackNwhite.pwn(877) : error 029: invalid expression, assumed zero
Pawn compiler 3.2.3664	 	 	Copyright © 1997-2006, ITB CompuPhase


3 Errors.
Sorry i'm the worst scripter ever.
I'd really appreciate help,Thanks in advance.
Why you using clearanimations for drunklvl ?
You need to do the same
Код:
SetPlayerDrunkLevel (playerid, 0.0);
put that clear animations place
Reply
#4

Quote:
Originally Posted by GaGlets®
Why you using clearanimations for drunklvl ?
He applied an animation.

pawn Код:
ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1);
^^
Reply
#5

Quote:
Originally Posted by zєяσмαиѕтєя
Quote:
Originally Posted by GaGlets®
Why you using clearanimations for drunklvl ?
He applied an animation.

pawn Код:
ApplyAnimation(playerid,"PED","WALK_DRUNK",4.1,1,1,1,1,1);
^^
Bah then put
Код:
SetPlayerSpecialAction (playerid, SPECIAL_ACTION_NONE ); - for me it works great for all anims....
Reply
#6

Quote:
Originally Posted by zєяσмαиѕтєя
Try this:

pawn Код:
if (strcmp("/drunk off", cmdtext, true, 10) == 0)
{
   if GetPlayerDrunkLevel(playerid) < 2000)
   {
     SendClientMessage(playerid,0xFFFFFFFF,"You are not Drunk!");
   }
   else
   {
     SetPlayerDrunkLevel (playerid, 0);
     GameTextForPlayer(playerid,"~W~Drunk Mode Is ~R~Off!",3000,5);
     ClearAnimations(playerid);
   }
   return 1;
}
Still the same errors =/
Thanks for trying to help anyway guys.
Reply
#7

Quote:
Originally Posted by ►ϻozilla Fir3foж◄
Quote:
Originally Posted by zєяσмαиѕтєя
Try this:

pawn Код:
if (strcmp("/drunk off", cmdtext, true, 10) == 0)
{
   if GetPlayerDrunkLevel(playerid) < 2000)
   {
     SendClientMessage(playerid,0xFFFFFFFF,"You are not Drunk!");
   }
   else
   {
     SetPlayerDrunkLevel (playerid, 0);
     GameTextForPlayer(playerid,"~W~Drunk Mode Is ~R~Off!",3000,5);
     ClearAnimations(playerid);
   }
   return 1;
}
Still the same errors =/
Thanks for trying to help anyway guys.
pawn Код:
if GetPlayerDrunkLevel(playerid) < 2000)
wheres the bracket ?

pawn Код:
if(GetPlayerDrunkLevel(playerid) < 2000)
Reply
#8

Quote:
Originally Posted by ►Peter Corneile [ideal-host.co.uk
◄ ]
Quote:
Originally Posted by ►ϻozilla Fir3foж◄
Quote:
Originally Posted by zєяσмαиѕтєя
Try this:

pawn Код:
if (strcmp("/drunk off", cmdtext, true, 10) == 0)
{
   if GetPlayerDrunkLevel(playerid) < 2000)
   {
     SendClientMessage(playerid,0xFFFFFFFF,"You are not Drunk!");
   }
   else
   {
     SetPlayerDrunkLevel (playerid, 0);
     GameTextForPlayer(playerid,"~W~Drunk Mode Is ~R~Off!",3000,5);
     ClearAnimations(playerid);
   }
   return 1;
}
Still the same errors =/
Thanks for trying to help anyway guys.
pawn Код:
if GetPlayerDrunkLevel(playerid) < 2000)
wheres the bracket ?

pawn Код:
if(GetPlayerDrunkLevel(playerid) < 2000)
Omg thanks a lot! xP
Reply
#9

Quote:
Originally Posted by ►ϻozilla Fir3foж◄
Quote:
Originally Posted by ►Peter Corneile [ideal-host.co.uk
◄ ]
Quote:
Originally Posted by ►ϻozilla Fir3foж◄
Quote:
Originally Posted by zєяσмαиѕтєя
Try this:

pawn Код:
if (strcmp("/drunk off", cmdtext, true, 10) == 0)
{
   if GetPlayerDrunkLevel(playerid) < 2000)
   {
     SendClientMessage(playerid,0xFFFFFFFF,"You are not Drunk!");
   }
   else
   {
     SetPlayerDrunkLevel (playerid, 0);
     GameTextForPlayer(playerid,"~W~Drunk Mode Is ~R~Off!",3000,5);
     ClearAnimations(playerid);
   }
   return 1;
}
Still the same errors =/
Thanks for trying to help anyway guys.
pawn Код:
if GetPlayerDrunkLevel(playerid) < 2000)
wheres the bracket ?

pawn Код:
if(GetPlayerDrunkLevel(playerid) < 2000)
Omg thanks a lot! xP
LAWL
Reply
#10

Now it's working perfect,Except when i use /Drunk off everything stops but the drunk animation.
I've tried ClearAnimations(playerid);
And i've tried
pawn Код:
SetPlayerSpecialAction (playerid, SPECIAL_ACTION_NONE );
Nothing is working O_O
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)