Mysql cmd admin error
#1

problem cmd admin to sell house is not updated to zero value hID on the table mysql en phpmyadmin

Код:
CMD:asellh(playerid,params[]) {
  if(PlayerInfo[playerid][Level] >= 6) {
    new i;
    i = GetHouseID(playerid);
    if(i == -255) return SendClientMessage(playerid, 0xDC143CAA, "ERROR: You need to be on house icon to remove it");
    new Query[128],string[128];
    format(Query, sizeof(Query), "UPDATE `houses` SET `Owner` = '%s', `Owned` = '%d'  WHERE `ID` = '%d'","NULL",0,HouseInfo[i][Houseid]);
    mysql_tquery(mysql, Query, "", "");
    if(HouseInfo[i][Owned] == 1) {
    HERE!  format(Query, sizeof(Query),"UPDATE `accounts` SET `hID` = 0,`HOwned` = 0 WHERE `Name` = '%s'",pName(playerid));HERE 
      mysql_tquery(mysql, Query, "", "");
      foreach (new i2 : Player) {
	     if(IsPlayerConnected(i2)) {
           if(strcmp(HouseInfo[i][Owner],pName(i2),false )== 0) {
               PlayerInfo[i2][hOwned] = 0;
			   PlayerInfo[i2][hID] = 0;
               format(string,sizeof string,"Administrator %s Has Reseted Your House",pName(playerid));
               SendClientMessage(i2,0x33AA33AA,string);
           }
	    }
      }
    }
    HouseInfo[i][Owned] = 0;
	strmid(HouseInfo[i][Owner],"NULL", 0, strlen("NULL"), 255);
    DestroyDynamicPickup(HousePickup[i]);
    HousePickup[i] = CreateDynamicPickup(1273, 23, HouseInfo[i][HX], HouseInfo[i][HY], HouseInfo[i][HZ]);
    UpdateDynamic3DTextLabelText(hTextInfo[i],0x00FF00FF,"Not Owned");
    DestroyDynamicMapIcon(housemapicon[i]);
    housemapicon[i] = CreateDynamicMapIcon(HouseInfo[i][HX], HouseInfo[i][HY], HouseInfo[i][HZ],31,c_y);
    format(string,sizeof string,"You've Successfully Sold This house [ ID: %d ]",i);
    SendClientMessage(playerid, 0x33AA33AA, string);
	format(string,sizeof string,"Administrator %s(IP: %s) Has Rested House ID: %d",pName(playerid),pIP(playerid),i);
	SaveToFile("resetlog",string);
    MessageToAdmins(red ,string);
   } else return SendClientMessage(playerid, 0xDC143CAA, "ERROR: You need to be rcon to use this command");
  return 1;
}
Reply


Messages In This Thread
Mysql cmd admin error - by nbx2000 - 13.06.2018, 00:17
Re: Mysql cmd admin error - by JasonRiggs - 13.06.2018, 00:26
Re: Mysql cmd admin error - by nbx2000 - 13.06.2018, 02:08
Re: Mysql cmd admin error - by Slawi - 13.06.2018, 03:01
Re: Mysql cmd admin error - by Calisthenics - 13.06.2018, 07:08
Re: Mysql cmd admin error - by GTLS - 13.06.2018, 08:53

Forum Jump:


Users browsing this thread: 1 Guest(s)