My storing is bugging =D
#1

I created enum called bag and ehhh when I give 12 grams of drugs on bag and then I trying to store it by /depositdrugs [AMOUNT]... if I put that 12 I can normally store it but I can do it every time when I want... will be nice if u know how to fix it like when u storage 1 from ur bag, then it go to the storage and 11 left on bag (from 12 ofc xD)
heres the code

pawn Код:
CMD:depositdrugs(playerid,params[])
{
new file[100],Name[MAX_PLAYER_NAME],Ip[16]; GetPlayerName(playerid,Name,sizeof(Name)); GetPlayerIp(playerid,Ip,sizeof(Ip)); format(file,sizeof(file),PlayerFile,Name);
new instack;
new Bag;
if(sscanf(params,"d",instack)) return SendClientMessage(playerid,0x38FF06FF,"USAGE : /deposit [Amount]");
else if(instack > Pinfo[playerid][bag]) return SendClientMessage(playerid,0x38FF06FF,"ERROR : You Don't Have That Amount In Drug Bag!");
{
Pinfo[playerid][bag] -= Bag;
Pinfo[playerid][Instack] += instack;
new string[128];
format(string,sizeof(string),"SERVER : You Have Deposited %d g drugs",instack);
SendClientMessage(playerid,LIGHTGREEN,string);
dini_IntSet(file,"Instack",Pinfo[playerid][bag]);
}
return 1;
}
Reply
#2

and Instack is enum for storage
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)