SA-MP Forums Archive
My storing is bugging =D - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: My storing is bugging =D (/showthread.php?tid=250638)



My storing is bugging =D - the_zande - 23.04.2011

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;
}



Re: My storing is bugging =D - the_zande - 24.04.2011

and Instack is enum for storage