Maffw Posted May 24, 2016 Posted May 24, 2016 Am o problema la clanuri si la case . Separat merg foarte bine dar atunci cand esti intr-un clan si detii o casa intr-un fel nu o mai detii pentru ca la numele de la casa se pune tot numele cu tot cu tag-ul de la clan si nu mai poti face nimic ... daca imi puteti zice cum sa fac sa nu se mai puna tag-ul si la casa atunci cand esti intr-un clan .. P.S server-ul este pe mysql si procesorul de comenzi e ZCMD , mai jos aveti comanda /buyhouse CMD:buyhouse(playerid, params[]) { if(gPlayerLogged[playerid] == 0) return SendClientMessage(playerid, COLOR_LIGHTRED, "Trebuie sa te loghezi mai intai."); if(IsPlayerConnected(playerid)) { new Float:oldposx, Float:oldposy, Float:oldposz,string[100],playername[MAX_PLAYER_NAME],sendername[MAX_PLAYER_NAME]; GetPlayerName(playerid, playername, sizeof(playername)); GetPlayerPos(playerid, oldposx, oldposy, oldposz); for(new h = 1; h < sizeof(HouseInfo); h++) { if(PlayerToPoint(2.0, playerid, HouseInfo[h][hEntrancex], HouseInfo[h][hEntrancey], HouseInfo[h][hEntrancez]) && HouseInfo[h][hOwned] == 0) { if(PlayerInfo[playerid][pLevel] < HouseInfo[h][hLevel]) { format(string, sizeof(string), "You must be Level %d to purchase this.", HouseInfo[h][hLevel]); SendClientMessage(playerid, COLOR_WHITE, string); return 1; } if(PlayerInfo[playerid][pPhousekey] != 999 && strcmp(GetName(playerid), HouseInfo[PlayerInfo[playerid][pPhousekey]][hOwner], true) == 0) return SendClientMessage(playerid, COLOR_YELLOW2, "Eroare: You already own a house, type /sellhouse if you want to buy this one."); if(GetPlayerCash(playerid) >= HouseInfo[h][hValue]) { InHouse[playerid] = h; PlayerInfo[playerid][pPhousekey] = HouseInfo[h][hID]; PlayerInfo[playerid][pRented] = -1; HouseInfo[h][hOwned] = 1; GetPlayerName(playerid, sendername, sizeof(sendername)); strmid(HouseInfo[h][hOwner], sendername, 0, strlen(sendername), 255); GivePlayerCash(playerid,-HouseInfo[h][hValue]); SetPlayerInterior(playerid,HouseInfo[h][hInterior]); SetPlayerPos(playerid,HouseInfo[h][hExitx],HouseInfo[h][hExity],HouseInfo[h][hExitz]); SetPlayerVirtualWorld(playerid,HouseInfo[h][hVirtual]); GameTextForPlayer(playerid, "~w~Welcome Home~n~You can exit at any time by moving to this door and press enter", 5000, 3); PlayerInfo[playerid][pInt] = HouseInfo[h][hInterior]; PlayerInfo[playerid][pLocal] = h; SendClientMessage(playerid, COLOR_WHITE, "Congratulations, on your new Purchase !"); SendClientMessage(playerid, COLOR_WHITE, "Type /help to review the new property help section !"); Update(playerid,pCashx); Update(playerid,pPhousekeyx); new str2[256]; format(str2,sizeof(str2),"UPDATE `houses` SET `Owned`='1',`Owner`='%s' WHERE `ID`='%d'",sendername,HouseInfo[h][hID]); mysql_query(SQL,str2); OnPropTextdrawUpdate(1,h); return 1; } else { SendClientMessage(playerid, COLOR_YELLOW2, "Eroare: You don't have the cash for that."); return 1; } } } } return 1; }
L0K3D. Posted May 24, 2016 Posted May 24, 2016 stochezi numele normal al jucatorului intr-o variabila
Alynush02 Posted May 24, 2016 Posted May 24, 2016 Update(playerid,pPhousekeyx); new str2[256]; format(str2,sizeof(str2),"UPDATE `houses` SET `Owned`='1',`Owner`='%s' WHERE `ID`='%d'",sendername,HouseInfo[h][hID]); mysql_query(SQL,str2); Ce-a zis loked, doar ca pui in loc de sendername variabila, gen pNickName sau pNormalName
Maffw Posted May 24, 2016 Author Posted May 24, 2016 Update(playerid,pPhousekeyx); new str2[256]; format(str2,sizeof(str2),"UPDATE `houses` SET `Owned`='1',`Owner`='%s' WHERE `ID`='%d'",sendername,HouseInfo[h][hID]); mysql_query(SQL,str2); Ce-a zis loked, doar ca pui in loc de sendername variabila, gen pNickName sau pNormalName Si in baza de date trebuie sa modific ceva ?
Maffw Posted May 25, 2016 Author Posted May 25, 2016 sa adaugi noua variabila cu numele. @Noxx Bun deci am creat variabila am adaugat-o in comanda in loc de 'sendername' si in baza de date nu dau de cap , am incercat doar atat fara sa fac nimic in baza de date , totul merge bine nu se mai incurca dar acum daca cumperi casa cu id-ul 4 iti da casa cu id-ul 5 si tot asa ...
Maffw Posted May 25, 2016 Author Posted May 25, 2016 (edited) Sorry pentru 2xpost dar inca nu am gasit cum sa fac la baza de date .. Edited May 25, 2016 by Noxx
Maffw Posted May 28, 2016 Author Posted May 28, 2016 (edited) Edit : Rezolvat , multumesc celor care au postat :). Edited May 29, 2016 by Noxx
Recommended Posts