05.08.2011, 17:20
when I use /deposit -10 I can get +10
Can someone explain me?
Sorry for my bad english!
Can someone explain me?
Sorry for my bad english!
Код:
if(strcmp(cmd, "/Depositar", true) == 0) { if(IsPlayerConnected(playerid)) { if(IsPlayerInRangeOfPoint(playerid,5.0,BankPosition[X],BankPosition[Y],BankPosition[Z])) { tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "[Usage:] /Depositar [Quantidade]"); return 1; } new cashdeposit = strval(tmp); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_WHITE, "[Usage:] /Depositar [Quantidade]"); return 1; } if(GetPlayerCash(playerid) >= cashdeposit) { GivePlayerCash(playerid,-cashdeposit); PlayerInfo[playerid][pBank]=cashdeposit+PlayerInfo[playerid][pBank]; format(string, sizeof(string), "[Info:] Depositaste $%d, Novo balanзo: $%d", cashdeposit,PlayerInfo[playerid][pBank]); SendClientMessage(playerid, COLOR_WHITE, string); PlayerActionMessage(playerid,15.0,"Entrega algum dinheiro ao banqueiro."); OnPlayerDataSave(playerid); return 1; } else { SendClientMessage(playerid, COLOR_GREY, "[Erro:] Nгo tens esse dinheiro todo!"); } } else { SendClientMessage(playerid, COLOR_GREY, "[Erro:] Nгo estas no banco!"); } } return 1; }