Script help
#1

Hi there!

i've scripted some "mini shop" soo i need your help to tell me how can script when the player has full hp (100) so he can't buy it.

epxplain:

Код:
if(GetPlayerMoney(playerid) < 1000)
    return SendClientMessage(playerid, 0x33FF00AA, "You don't have enough cash to buy this item.");
    GivePlayerMoney(playerid, -1000);
    SetPlayerHealth(playerid, 100); //heal
    SendClientMessage(playerid, 0x33FF00AA, "You have succesfully healed your self.");
So i'd like to add when the player has 100hp so he can't buy it.

Thank you.

my ingris skill
Reply
#2

Код:
new Float:health;
GetPlayerHealth(playerid, health);

if (health >= 100.0)
{
    // Player cannot buy it
}
else
{
    // Player can buy it
}
Reply
#3

Код:
new Float:Health;
GetPlayerHealth(playerid,Health);
if(Health >= 100.0)
{
	//Your code.
}
Reply
#4

Quote:
Originally Posted by Raweresh
Посмотреть сообщение
Код:
new Float:Health;
GetPlayerHealth(playerid,Health);
if(Health >= 100.0)
{

}
If you're gonna copy something, atleast check if it's right. Anyways, edited my post.
Reply
#5

Код:
new Float:Health;
GetPlayerHealth(playerid,Health);
if(Health >= 100.0)
{
	SendClientMessage(...); //Player can't buy it.
	return 1;
}
//Player can buy it.
I don't copy your code I write it in same time.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)