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

can someone gimme a example of this?
like id like to recreate format like this :

CallFormat(str[],len,...)
{
format(...);
return 1;
}

THIS IS ONLY A EXAMPLE I JUST NEED ADVICE ^^
Reply
#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
#3

The functions are called numarg, getarg and setarg.
Here's a tut
http://forum.sa-mp.com/index.php?topic=101773.0
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)