PDA

View Full Version : Working sprunk


Logan0147
10/07/2017, 08:20 PM
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?

Kaperstone
10/07/2017, 08:48 PM
Natively ? no.

But you can use an include
http://forum.sa-mp.com/showthread.php?t=553952

oSAINTo
10/07/2017, 08:56 PM
if (newkeys & KEY_FIRE && IsPlayerInRangeOfPoint(playerid, 3, sprunkX, sprunkY, sprunkZ))
{
new hp;
GetPlayerHealth(playerid, hp);
ApplyAnimation(playerid,"VENDING","VEND_Use",1.4,0 ,1,1,0,2500,1);
ApplyAnimation(playerid,"VENDING","VEND_Use",1.4,0 ,1,1,0,2500,1);
GameTextForPlayer(playerid, "-3", 5000, 1);
if(GetPlayerHealth(playerid) < 100)
{
SetPlayerHealth(playerid, hp+28);
}
else
{
SetPlayerHealth(playerid, 100);
}
}

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

oSAINTo
10/07/2017, 08:59 PM
Also, check out this:
http://forum.sa-mp.com/showthread.php?t=553952

Logan0147
10/07/2017, 09:19 PM
Also, check out this:
http://forum.sa-mp.com/showthread.php?t=553952

Interesting, thanks !