18.01.2019, 10:13
I want if player name is online tarnsfer the cash into player account bank but strcmp not working
why?
why?
Code:
Dialog:DialogATM4(playerid, response, listitem, inputtext[]) { if(response) { new sb_string[256]; new AmountPool = GetPVarInt(playerid, "atm_cash"); if(User[playerid][pbank] > AmountPool) { GetPVarString(playerid, "atm_name_target", sb_string, sizeof(sb_string)); LOOP(i) { if(!strcmp(sb_string, GetName(i), false)) { If Online SendFormatedMessage(i,-1, "**"orange"Bazikon %s(%i) Moghdare "white"%i$ "orange"Rial Pool Be Hesab Banki Shoma Variz Kard!", GetName(playerid),playerid,AmountPool); PlayerPlaySound(i, 1057, 0.0, 0.0, 10.0); User[i][pbank] += AmountPool; } else { If Not Online new strb = SQL::GetIntEntryEx(""PLAYERS_TABLE"", "pbank", "username", sb_string); new handle = SQL::OpenEx(SQL::UPDATE, ""PLAYERS_TABLE"", "username", sb_string); SQL::WriteInt(handle, "pbank", strb+TargetATMCash[playerid]+AmountPool); SQL::Close(handle); } } PlayerPlaySound(playerid, 1057, 0.0, 0.0, 10.0); User[playerid][pbank] -= AmountPool; SendFormatedMessage(playerid, COLOR_ORANGE,"*Shoma Mablagh %i Pool Be Hesab Banki Bazikon %s Variz Kardid!",AmountPool,sb_string); } else return Error(playerid, "Shoma In Moghdar Pool Ra Dar Hesab Banki Khod Nadrid!"); } return 1; }