22.06.2013, 07:51
Not tested by i hope this is what you needed ![Smiley](images/smilies/smile.png)
make sure to add this:
![Smiley](images/smilies/smile.png)
pawn Код:
CMD:getmats(playerid, params[])
{
new amount, str[128];;
if(PlayerInfo[playerid][pLoggedIn] == 0) return SCM(playerid, COLOR_RED, "You need to be logged in to use this command");
if(IsPlayerInRangeOfPoint(playerid,3.0,1425.4591,-1336.4163,13.5804) return SCM(playerid, COLOR_LIGHTBLUE, "You are not at the place to buy materials");
if (PlayerInfo[playerid][pJob] != 1)
{
SendClientMessage(playerid,COLOR_WHITE,"You are not an Arms Dealer!");
return 1;
}
if(sscanf(params, "i", amount)) return SCM(playerid, COLOR_WHITE, "USAGE:/buymats [amount]");
PlayerInfo[playerid][pMats] += amount;
new Float:payment = amount*5.0;//<<-- changed
GivePlayerMoney(playerid, -amount*5);//<<-- changed
format(string, sizeof(string), "You have purchased %d materials for %f.",amount, payment);//<<-- changed
SCM(targetid, COLOR_RED, string);
make sure to add this:
pawn Код:
//
new Float:payment = amount*5.0;//<<-- changed
GivePlayerMoney(playerid, -amount*5);//<<-- changed
format(string, sizeof(string), "You have purchased %d materials for %f.",amount, payment);//<<-- changed