15.12.2011, 20:30
pawn Code:
if(strcmp(cmdtext, "/saldo", true) == 0)
{
format(file, sizeof(file), PASTA_CONTAS, PlayerName(playerid));
if(PlayerToPoint(1.0, playerid, 1285.5574,-1329.1753,13.5494) || PlayerToPoint(1.0, playerid, 1242.8236,-1704.6500,13.5469) || PlayerToPoint(1.0, playerid, 1477.3513,-1710.3250,14.3525) || PlayerToPoint(1.0, playerid, 1722.3969,-1718.2037,13.5305) || PlayerToPoint(1.0, playerid, 2140.6582,-1168.6848,23.9922)
|| PlayerToPoint(1.0, playerid, 537.4147,-1761.8303,14.3161) || PlayerToPoint(1.0, playerid, 940.8690,-1651.7668,13.5427) || PlayerToPoint(1.0, playerid, 1046.5620,-1664.0647,13.5469) || PlayerToPoint(1.0, playerid, 369.4976,187.8609,1008.3893))
{
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
if(dini_Int(file, "ContaBancaria") == 1)
{
format(string, sizeof(string), "[INFO] Vocк tem depositado em sua conta R$:%d.", dini_Int(file, "SaldoBancario"));
SendClientMessage(playerid, Verde, string);
}
else
{
SendClientMessage(playerid, Vermelho,"[x] Vocк nгo tem uma conta bancбria.");
}
else
{
SendClientMessage(playerid, Vermelho,"[x] Vocк nгo estб em um banco.");
}
return 1;
}
if(strcmp(cmd, "/depositar", true) == 0)
{
format(file, sizeof(file), PASTA_CONTAS, PlayerName(playerid));
new tmp[256];
if(PlayerToPoint(1.0, playerid, 1285.5574,-1329.1753,13.5494) || PlayerToPoint(1.0, playerid, 1242.8236,-1704.6500,13.5469) || PlayerToPoint(1.0, playerid, 1477.3513,-1710.3250,14.3525) || PlayerToPoint(1.0, playerid, 1722.3969,-1718.2037,13.5305) || PlayerToPoint(1.0, playerid, 2140.6582,-1168.6848,23.9922)
|| PlayerToPoint(1.0, playerid, 537.4147,-1761.8303,14.3161) || PlayerToPoint(1.0, playerid, 940.8690,-1651.7668,13.5427) || PlayerToPoint(1.0, playerid, 1046.5620,-1664.0647,13.5469) || PlayerToPoint(1.0, playerid, 369.4976,187.8609,1008.3893))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, Vermelho, "Use /depositar [quantia].");
new valor;
valor = strval(tmp);
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
if(dini_Int(file, "ContaBancaria") == 1)
{
new grana;
grana = GetPlayerGrana(playerid);
if(grana > valor-1 && valor > 0)
{
format(string, sizeof(string), "[INFO] Vocк depositou a quantia de R$:%d.", valor);
SendClientMessage(playerid, Verde, string);
dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")+valor);
GivePlayerGrana(playerid, -valor);
return 1;
}
else
{
SendClientMessage(playerid, Vermelho, "[x] Vocк nгo tem todo este dinheiro.");
}
}
else
{
SendClientMessage(playerid, Vermelho, "[x] Vocк nгo tem uma conta bancбria.");
}
}
else
{
SendClientMessage(playerid, Vermelho, "[x] Vocк nгo estб em um Banco.");
}
return 1;
}
if(strcmp(cmd, "/sacar", true) == 0)
{
format(file, sizeof(file), PASTA_CONTAS, PlayerName(playerid));
new tmp[256];
if(PlayerToPoint(1.0, playerid, 1285.5574,-1329.1753,13.5494) || PlayerToPoint(1.0, playerid, 1242.8236,-1704.6500,13.5469) || PlayerToPoint(1.0, playerid, 1477.3513,-1710.3250,14.3525) || PlayerToPoint(1.0, playerid, 1722.3969,-1718.2037,13.5305) || PlayerToPoint(1.0, playerid, 2140.6582,-1168.6848,23.9922)
|| PlayerToPoint(1.0, playerid, 537.4147,-1761.8303,14.3161) || PlayerToPoint(1.0, playerid, 940.8690,-1651.7668,13.5427) || PlayerToPoint(1.0, playerid, 1046.5620,-1664.0647,13.5469) || PlayerToPoint(1.0, playerid, 369.4976,187.8609,1008.3893))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) return SendClientMessage(playerid, Vermelho, "Use /sacar [quantia].");
new valor;
valor = strval(tmp);
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
if(dini_Int(file, "ContaBancaria") == 1)
{
if(dini_Int(file, "SaldoBancario") > valor-1)
{
format(string, sizeof(string), "[INFO] Vocк sacou a quantia de R$%d.", valor);
SendClientMessage(playerid, Verde, string);
dini_IntSet(file, "SaldoBancario", dini_Int(file, "SaldoBancario")-valor);
GivePlayerGrana(playerid, valor);
return 1;
}
else
{
SendClientMessage(playerid, Vermelho, "[x] Vocк nгo tem todo este dinheiro.");
}
}
else
{
SendClientMessage(playerid, Vermelho, "[x] Vocк nгo tem uma conta bancбria.");
}
}
else
{
SendClientMessage(playerid, Vermelho, "[x] Vocк nгo estб em um Banco.");
}
return 1;
}