21.07.2012, 00:08
O Banco do meu sv ta bugado.
Da pra sacar grana , depositar , ver saldo e etc sem estar no banco.
Aki estao os comandos.
Aki estao as coordenadas dos bancos.
Da pra sacar grana , depositar , ver saldo e etc sem estar no banco.
Aki estao os comandos.
pawn Код:
if(strcmp(cmd, "/sacar", true) == 0) {
format(file, sizeof(file), PASTA_CONTAS, PlayerName(playerid));
new checknome;
new tmp[256];
checknome = CPS_GetPlayerCheckpoint(playerid);
if(checknome == caixaeletronico1 || checknome == caixaeletronico2 || checknome == caixaeletronico3 || checknome == caixaeletronico4 || checknome == caixaeletronico5 || checknome == caixaeletronico6 || checknome == caixaeletronico7 || checknome == caixaeletronico8
|| checknome == bancoPref){
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
SendClientMessage(playerid, Vermelho, "Use /sacar [quantia].");
return 1;
}
new valor;
if(strfind(tmp, "-", true) != -1)
{
SendClientMessage(playerid,Vermelho,"(ERRO) Valor invбlido!");
return 1;
}
if(strlen(tmp) > 8)
{
SendClientMessage(playerid, Vermelho, "(ERRO) Valor invбlido!");
return 1;
}
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) Bancos Brasil Vida Online: 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, "(ERRO) Vocк nгo tem todo este dinheiro.");
}
} else {
SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo tem uma conta bancбria.");
}
} else {
SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo estб em um Banco.");
}
}
pawn Код:
if(strcmp(cmdtext, "/abrirconta", true) == 0) {
format(file, sizeof(file), PASTA_CONTAS, PlayerName(playerid));
new checknome;
checknome = CPS_GetPlayerCheckpoint(playerid);
if(checknome == caixaeletronico1 || checknome == caixaeletronico2 || checknome == caixaeletronico3 || checknome == caixaeletronico4 || checknome == caixaeletronico5 || checknome == caixaeletronico6 || checknome == caixaeletronico7 || checknome == caixaeletronico8){
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
if(dini_Int(file, "ContaBancaria") == 0){
new grana;
grana = GetPlayerGrana(playerid);
if(grana > 299){
format(string, sizeof(string), "(INFO) O jogador %s(id: %d) abriu uma conta bancбria.", aname, playerid);
SendClientMessageToAll(roxo, string);
dini_IntSet(file, "ContaBancaria", 1);
GivePlayerGrana(playerid, -300);
dini_IntSet(file, "SaldoBancario", 300);
} else {
SendClientMessage(playerid, Vermelho,"(ERRO) Para abrir uma conta bancбria vocк presisa de pelo menos 300 reais.");
}
} else {
SendClientMessage(playerid, Vermelho,"(ERRO) Vocк jб tem uma conta bancбria.");
}
} else {
SendClientMessage(playerid, Vermelho,"(ERRO) Vocк nгo estб em um banco.");
}
return 1;
}
pawn Код:
if(strcmp(cmdtext, "/saldo", true) == 0) {
format(file, sizeof(file), PASTA_CONTAS, PlayerName(playerid));
new checknome;
checknome = CPS_GetPlayerCheckpoint(playerid);
if(checknome == caixaeletronico1 || checknome == caixaeletronico2 || checknome == caixaeletronico3 || checknome == caixaeletronico4 || checknome == caixaeletronico5 || checknome == caixaeletronico6 || checknome == caixaeletronico7 || checknome == caixaeletronico8
|| checknome == bancoPref){
new aname[MAX_PLAYER_NAME];
GetPlayerName(playerid, aname, MAX_PLAYER_NAME);
if(dini_Int(file, "ContaBancaria") == 1){
format(string, sizeof(string), "(INFO) Bancos Do Brasil : Vocк tem depositado em sua conta R$:%d.", dini_Int(file, "SaldoBancario"));
SendClientMessage(playerid, Verde, string);
} else {
SendClientMessage(playerid, Vermelho,"(ERRO) Vocк nгo tem uma conta bancбria.");
}
} else {
SendClientMessage(playerid, Vermelho,"(ERRO) Vocк nгo estб em um banco.");
}
return 1;
}
pawn Код:
if(strcmp(cmd, "/depositar", true) == 0) {
format(file, sizeof(file), PASTA_CONTAS, PlayerName(playerid));
new checknome;
new tmp[256];
checknome = CPS_GetPlayerCheckpoint(playerid);
if(checknome == caixaeletronico1 || checknome == caixaeletronico2 || checknome == caixaeletronico3 || checknome == caixaeletronico4 || checknome == caixaeletronico5 || checknome == caixaeletronico6 || checknome == caixaeletronico7 || checknome == caixaeletronico8
|| checknome == bancoPref){
tmp = strtok(cmdtext, idx);
if(!strlen(tmp)) {
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) Caixa Rapido: 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, "(ERRO) Vocк nгo tem todo este dinheiro.");
}
} else {
SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo tem uma conta bancбria.");
}
} else {
SendClientMessage(playerid, Vermelho, "(ERRO) Vocк nгo estб em um Banco.");
}
}
pawn Код:
caixaeletronico1 = CPS_AddCheckpoint(298.1927,176.9617,1007.1719, 3.0, 50);
caixaeletronico3 = CPS_AddCheckpoint(823.6609,3.2389,1004.1797, 3.0, 50);
caixaeletronico5 = CPS_AddCheckpoint(2140.6582,-1168.6848,23.9922, 3.0, 50);
caixaeletronico7 = CPS_AddCheckpoint(940.8690,-1651.7668,13.5427, 3.0, 50);
bancoPref = CPS_AddCheckpoint(369.4976,187.8609,1008.3893, 1.5, 40);