SA-MP Forums Archive
Working sprunk - 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: Working sprunk (/showthread.php?tid=637198)



Working sprunk - Logan0147 - 10.07.2017

Hi, I would like to add more working sprunk machines, not just an object, I know that I can use
Код:
if (newkeys & KEY_FIRE && IsPlayerInRangeOfPoint(playerid, 1, sprunkX, sprunkY, sprunkZ)) 
{
        // Apply animations, give health, substract money.
        .....
But is there any other way to do that?


Re: Working sprunk - Kaperstone - 10.07.2017

Natively ? no.

But you can use an include
https://sampforum.blast.hk/showthread.php?tid=553952


Re: Working sprunk - oSAINTo - 10.07.2017

PHP код:
if (newkeys KEY_FIRE && IsPlayerInRangeOfPoint(playerid3sprunkXsprunkYsprunkZ)) 
{
        new 
hp;
        
GetPlayerHealth(playeridhp);
        
ApplyAnimation(playerid,"VENDING","VEND_Use",1.4,,1,1,0,2500,1);
        
ApplyAnimation(playerid,"VENDING","VEND_Use",1.4,,1,1,0,2500,1);
        
GameTextForPlayer(playerid"-3"50001);
        if(
GetPlayerHealth(playerid) < 100)
        {        
            
SetPlayerHealth(playeridhp+28);
        } 
        else
        {
            
SetPlayerHealth(playerid100);
        }

Then somewhere up top of your script, make an enum that houses all the Sprunk coordinates.


Re: Working sprunk - oSAINTo - 10.07.2017

Also, check out this:
https://sampforum.blast.hk/showthread.php?tid=553952


Re: Working sprunk - Logan0147 - 10.07.2017

Quote:
Originally Posted by oSAINTo
Посмотреть сообщение
Interesting, thanks !