Ok...i have this: if(strcmp(cmd, "/fdeposit", true) == 0 || strcmp(cmd, "/fbank", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(IsAMember(playerid))
{
tmp = strtok(cmdtext, idx);
new x;
x = PlayerInfo[playerid][pMember] + PlayerInfo[playerid][pLeader];
if(!strlen(tmp))
{
SCM(playerid, COLOR_WHITE, "USAGE: /fdeposit [amount]");
return 1;
}
/*if(DynamicFactions[x][fSafe] <= 0)
{
SCM(playerid, COLOR_WHITE, "The leader must buy a SAFE first !");
return 1;
}*/
new cashdeposit = strval(tmp);
GetPlayerName(playerid, sendername, sizeof(sendername));
if(!strlen(tmp))
{
SCM(playerid, COLOR_WHITE, "USAGE: /fdeposit [amount]");
return 1;
}
if(PTP(5.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
{
if(GetPlayerMoney(playerid) >= cashdeposit)
{
GivePlayerMoney(playerid,-cashdeposit);
DynamicFactions[x][fBank]=DynamicFactions[x][fBank]+cashdeposit;
format(string, sizeof(string), "You have deposited $%d into the faction bank, new balance: %d %", cashdeposit,DynamicFactions[x][fBank]);
SCM(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "%s has just deposited %d % into the faction bank.",sendername,cashdeposit);
SCM(playerid, COLOR_WHITE, string);
SaveDynamicFactions();
return 1;
}
else
{
SCM(playerid, COLOR_WHITE, "You don't have that amount of money!");
}
}
else
{
SCM(playerid, COLOR_WHITE, "You are not at your hq!");
}
}
}
return 1;
}
And for Withdraw i thnk is this:
if(strcmp(cmd, "/fwithdraw", true) == 0)
{
if(IsPlayerConnected(playerid))
{
if(PlayerInfo[playerid][pLeader] !=0)
{
tmp = strtok(cmdtext, idx);
new x;
x = PlayerInfo[playerid][pLeader];
if(!strlen(tmp))
{
SCM(playerid, COLOR_WHITE, "USAGE: /fwdasdasdas[amount]");
return 1;
}
/*if(DynamicFactions[x][fSafe] <= 0)
{
SCM(playerid, COLOR_WHITE, "The leader must buy a SAFE first !");
return 1;
}*/
new cashdeposit = strval(tmp);
GetPlayerName(playerid, sendername, sizeof(sendername));
if(!strlen(tmp))
{
SCM(playerid, COLOR_WHITE, "USAGE: /fwdasdasdas [amount]");
return 1;
}
if(PTP(5.0,playerid,DynamicFactions[x][fX],DynamicFactions[x][fY],DynamicFactions[x][fZ]))
{
if(cashdeposit <= DynamicFactions[x][fBank])
{
GivePlayerMoney(playerid,cashdeposit);
DynamicFactions[x][fBank]=DynamicFactions[x][fBank]+cashdeposit;
format(string, sizeof(string), "You have withdrawn $%d into the faction bank, new balance: %d %", cashdeposit,DynamicFactions[x][fBank]);
SCM(playerid, COLOR_WHITE, string);
format(string, sizeof(string), "%s has just withdrawn %d % from the faction bank.",sendername,cashdeposit);
SCM(playerid, COLOR_WHITE, string);
SaveDynamicFactions();
return 1;
}
else
{
SCM(playerid, COLOR_WHITE, "You don't have that amount of money in your faction seif!");
}
}
else
{
SCM(playerid, COLOR_WHITE, "You are not at your hq!");
}
}
}
return 1;
}