Curius : How to use {Float,_}:....
#2

For example, a health float :

pawn Код:
if(strcmp(cmdtext, "/heal", true, 5) == 0) // 5 is the length of /heal
{
new Float:health;
new string[128];
GetPlayerHealth(playerid, health);
if(health >= 90) return SendClientMessage(playerid,RED,"You have enough health"); // it check if health is above 90, if it is, you won't get healed
//if(GetPlayerMoney(playerid) < 1000)   return SendClientMessage(playerid, PINK, "Error: you have not enough money to afford the medical bills"); // uncomment if you want your players to pay
else
{
          SetPlayerHealth(playerid,100);
          // SendClientMessage(playerid, PINK,"You have been healed, and paid $1000 for the medical bills"); // only uncomment when you had uncommented 'if (GetPlayerMoney)
          //GivePlayerMoney(playerid, -100); // only uncomment when you had uncommented 'if (GetPlayerMoney)
            // SendClientMessage(playerid, PINK,"You have been healed"); // only uncomment when you had commented 'if' (GetPlayerMoney(playerid)

        }
        return 1;
    }
To use it for other things, use the define after the 'Float:' - put in SendClientMessage '%f' (float), and use '%3.0f' to use 0 behind the commas, else it will
says a long row of numbers
Reply


Messages In This Thread
Curius : How to use {Float,_}:.... - by Micko9 - 02.06.2010, 14:46
Re: Curius : How to use {Float,_}:.... - by MastahServers - 02.06.2010, 15:00
Re: Curius : How to use {Float,_}:.... - by dice7 - 02.06.2010, 15:06

Forum Jump:


Users browsing this thread: 1 Guest(s)