Special actions
#1

I have tried to code something so that when you walk up to a point (table with beer) and hit a button, it sets the drinking action.

pawn Код:
public OnPlayerKeyStateChange(playerid, newkeys, oldkeys)
{
    if((newkeys & KEY_SECONDARY_ATTACK) && !(oldkeys & KEY_SECONDARY_ATTACK))
    {
        if(GetPlayerSpecialAction(playerid) == SPECIAL_ACTION_NONE) {
        SetPlayerSpecialAction(playerid, SPECIAL_ACTION_DRINK_BEER);
        SendMsg(playerid, "Press ~b~~k~~VEHICLE_ENTER_EXIT~ ~w~to drop.");
        }
    }
    return 1;
}
But instead of applying the special action, it just creates a bottle infront of Carl's hand, and if I press 'fire' he punches instead of drinking. I have nothing elsewhere in my script creating an object, what have I done?

PS. If anyone knows the ID of a crack pipe Sweet uses or the bong Tenpenny uses in some cutscenes, or if they're not available in SAMP, please let me know.

Thanks
-Aston
Reply
#2

add this in your code
pawn Код:
ApplyAnimation(playerid,"VENDING","VEND_Drink_P",4.1,1,1,1,1,1,1);
Reply
#3

Doesn't make any difference, but thanks for the reply:>
I tried the original code in a command and it worked fine, it's just when I trigger it with keys, if that makes any difference.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)