SA-MP Forums Archive
How to make and post working SPRUNK MASHINE ? - 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)
+--- Thread: How to make and post working SPRUNK MASHINE ? (/showthread.php?tid=485965)



How to make and post working SPRUNK MASHINE ? - barts - 06.01.2014

When i add this object players cant press F and get sprunk, how to fix it ?


Re: How to make and post working SPRUNK MASHINE ? - Vince - 06.01.2014

Script it with OnPlayerKeyStateChange. If they're in front of it and have money, give them 35 health (default Sprunk machine) and apply the animation "VEND_Use" from the library "VENDING".


Re: How to make and post working SPRUNK MASHINE ? - barts - 08.01.2014

I made it but the animation dont stop and reply.How to play tha animation only 1 time ?


Re: How to make and post working SPRUNK MASHINE ? - SilentSoul - 08.01.2014

Show me your codes of applying the animations to him.


Re: How to make and post working SPRUNK MASHINE ? - barts - 08.01.2014

ApplyAnimation(playerid,"VENDING","VEND_Use",4.1,1 ,1,1,1,1,1);


Re: How to make and post working SPRUNK MASHINE ? - offon - 08.01.2014

ApplyAnimation(playerid,"VENDING","VEND_Use",4.0,1 ,1,1,1,1,1);


Re: How to make and post working SPRUNK MASHINE ? - SilentSoul - 08.01.2014

Let's create a time to stop this animation.
pawn Code:
ApplyAnimation(playerid,"VENDING","VEND_Use",4.1,1 ,1,1,1,1,1);
SetTimer("stopanims",1000,false);
forward stopanims(playerid);//don't add those lines inside your command , just anywhere else in your script.
public stopanims(playerid)
{
ClearAnimations(playerid);
}



Re: How to make and post working SPRUNK MASHINE ? - barts - 08.01.2014

Dont work....


Re: How to make and post working SPRUNK MASHINE ? - SilentSoul - 08.01.2014

Have you tired my codes? , If yes show me full command.


Re: How to make and post working SPRUNK MASHINE ? - barts - 08.01.2014

PHP Code:
    if(IsKeyJustDown(KEY_SECONDARY_ATTACKnewkeysoldkeys))
    {
        if(
IsPlayerInRangeOfPoint(playerid1.5,  -205.267271139.7581819.00000)&& (drinkingsprunk[playerid] == 0))
        {
                new 
Float:HP;
                
GetPlayerHealth(playeridHP);
         
SetPlayerHealth(playeridHP+35);
        
ApplyAnimation(playerid,"VENDING","VEND_Use",4.1,,1,1,1,1,1);
        
drinkingsprunk[playerid] = 1;
        
SetTimerEx("SprunkTime"2300false"i"playerid);
        }
    } 
PHP Code:
forward SprunkTime(playerid);
public 
SprunkTime(playerid)
{
    
drinkingsprunk[playerid] = 0;
     
ClearAnimations(playerid);
    return 
1;