little problem with my command
#1

Hi guys i have a problem.

I have created a command.

If you type /ha u will pay 10,000$ and you can have full armour/health BUT i need help.

I wont make that if the player dont have money (in this case 10,000$) it will shown an error message.

Here is the command.

Код:
	if(strcmp(cmdtext, "/ha", true)==0)
{
 SendPlayerFormattedText(playerid, "Thank you for using the /ha command.Now your armour and your health will be set to 100 (FULL).The cost is 10.000$", 0);
 GivePlayerMoney(playerid, -10000);
 SetPlayerHealth(playerid, 100.0);
 SetPlayerArmour(playerid, 100.0);
 return 1;
}
Thanks.

P.S. Sorry for my english but im italian!
Reply
#2

pawn Код:
if(strcmp(cmdtext, "/ha", true) == 0)
{
  if(GetPlayerMoney(playerid) >= 10000)
  {
    GivePlayerMoney(playerid, -10000);

    SetPlayerHealth(playerid, 100.0);
    SetPlayerArmour(playerid, 100.0);

    return SendClientMessage(playerid, 0xFFFFFFFF, "Thank you for using the /ha command.Now your armour and your health will be set to 100 (FULL).The cost is 10.000$");
  }
  else return SendClientMessage(playerid, 0xFFFFFFFF, "You need $10000 to use this command.");
}
Reply
#3

I LOVE YOU!

Thanks man!!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)