SA-MP Forums Archive
Making HP command prob - 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: Making HP command prob (/showthread.php?tid=523522)



Making HP command prob - YanLanger - 02.07.2014

Hello guys !

I need /hp command to refill your health

And it costs 1600

and if he tries again it says "You can't use this command right, now please wait 3 minutes"

And when he can use it again it says "You can use the command /hp now"

every 3 mins he can do it again

Thanks.


Re: Making HP command prob - sammp - 02.07.2014

This isnt the place to ask for scripters. This is the place to help you with script's you've created.


Re: Making HP command prob - BroZeus - 02.07.2014

pawn Код:
new LastUsed[MAX_PLAYERS];//ontop

CMD:hp(playerid,params[])
{
new var=gettime() - LastUsed[playerid];
if(var<=(60*3))return SendClientMessage(playerid,-1,"{ff0000}You can use this once in 3 mins only"):
SetPlayerHealth(playerid, 100):
LastUsed[playerid]=gettime();
return SendClientMessage(playerid,-1,"{00cc00}You have been healed");
}



Re: Making HP command prob - YanLanger - 02.07.2014

well i did an /hp but i can do it whenever i want to that's the prob i need timer


Re: Making HP command prob - BroZeus - 02.07.2014

you dont need a timer
use the way i told
see my post above


Re: Making HP command prob - YanLanger - 02.07.2014

@brozeus

THANKS !

+rep