23.05.2014, 11:05
PHP код:
#include <a_samp>
#include <YSI\y_va>
new money = GetPlayerMoney(playerid);
new Float:percent = GetPercentageOfMoney(playerid, 1, 20);
// Will take %20 of the player's money and store it to "percent"
GivePlayerMoney(playerid, -floatround(percent));
SCMEx(playerid, -1, "You've death ! You've lost %%%f of your money ($%d)", percent, floatround(percent));
Float:GetPercentageOfMoney(playerid, Float:percents)
{
return floatdiv(floatmul(GetPlayerMoney(playerid), percents), 100);
}
SCMEx(playerid, colour, const message[], va_args<>)
{
new out[145];
va_format(out, sizeof(out), message, va_start<3>);
return SendClientMessage(playerid, colour, out);
}