27.03.2012, 15:37
Hello guys i have a bug when i /deposer ( deposit cash ) it deposing in anywhere oO whats the wrong on the code
Код:
if(strcmp(cmd, "/deposer", true) == 0) { if(IsPlayerConnected(playerid)) { if(PlayerInfo[playerid][pLocal] == 103 || PlayerToPoint(1.5, playerid, 2308.9021,-13.2615,26.7422)) { SendClientMessage(playerid, COLOR_GREY, "Vous n'кtes pas a la banque!"); return 1; } tmp = strtok(cmdtext, idx); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /deposer [montant]"); format(string, sizeof(string), "Vous avez $%d sur votre compte bancaire.", PlayerInfo[playerid][pAccount]); SendClientMessage(playerid, COLOR_GRAD3, string); return 1; } new cashdeposit = strval(tmp); if(!strlen(tmp)) { SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /deposer [montant]"); format(string, sizeof(string), "Vous avez $%d sur votre compte bancaire.", PlayerInfo[playerid][pAccount]); SendClientMessage(playerid, COLOR_GRAD3, string); return 1; } if (cashdeposit > GetPlayerMoney(playerid) || cashdeposit < 1) { SendClientMessage(playerid, COLOR_GRAD2, "Vous n'avez pas cette somme sur vous."); return 1; } SafeGivePlayerMoney(playerid,-cashdeposit); new curfunds = PlayerInfo[playerid][pAccount]; PlayerInfo[playerid][pAccount]=cashdeposit+PlayerInfo[playerid][pAccount]; SendClientMessage(playerid, COLOR_WHITE, "|___________ Extrait de Compte ___________|"); format(string, sizeof(string), " Argent sur le compte avant depфt: $%d", curfunds); SendClientMessage(playerid, COLOR_GRAD2, string); format(string, sizeof(string), " Somme dйposйe: $%d",cashdeposit); SendClientMessage(playerid, COLOR_GRAD4, string); SendClientMessage(playerid, COLOR_GRAD6, "|------------------------------------------|"); format(string, sizeof(string), " Argent sur le compte aprиs dйpфt: $%d", PlayerInfo[playerid][pAccount]); SendClientMessage(playerid, COLOR_WHITE, string); return 1; } return 1; }