DUDB : Made Admin System & Everything is working fine exept deposit
#7

Quote:
Originally Posted by KnooL
> is above the amount you have: for example, /deposit 2 (you have only 1)
>= is equal to or above the amount you have: for example, /deposit 1 (you have only 1$, you can't deposit it because it is equal to the amount given. (=) )

DCMD is called in OnPlayerCommandText
ZCMD is called directly.

More information: http://forum.sa-mp.com/index.php?topic=116240.0

--



Also I'd advise you to use sscanf in dcmd or zcmd. It's always better as it has it's in-build isnull checker

--

sscanf code <-- --> untested but should work

--

pawn Код:
dcmd_deposit(playerid,params[])
{
new amount;
if (!udb_Exists(PlayerName(playerid))) return PlayerMsg(playerid,red,"You Must Be Registerd!");
if (udb_UserInt(PlayerName(playerid),"LoggedIn")== 0) return PlayerMsg(playerid,red,"You Must Be Logged In!");
if(sscanf(params,"d",amount)) return PlayerMsg(playerid,red,"USAGE : '/deposit howmuch'");
else if (GetPlayerMoney(playerid) < amount) return PlayerMsg(playerid,red,"Invalid Amout. You Dont Have So Much!");
else {
GivePlayerMoney(playerid,-amount);
udb_UserSetInt(PlayerName(playerid),"BankMoney",udb_UserInt(PlayerName(playerid),"BankMoney")+amount); }
return 1;
}
}
ugh i already done it and i was tired that night.... i could understand a thing now i understand everything
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)