22.06.2013, 07:38
How can i make this command So it will cost 5$ per mat? also i want it to get the money before taking so it wont be negative cash. Im still designing this command so i would appreciate it if someone would help me
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;
format(string, sizeof(string), "You have purchased %d materials for %d.",amount, pay);
SCM(targetid, COLOR_RED, string);