Доступ к архиву

Переход в группу "Пользователь"

300.00 ₽
Одноразовый платёж
Быстрый переход в группу "Пользователи", без надобности написания постов и ожидания.

Покупка дает возможность:
Быть полноправным участником форума
Нормальное копирование кода
Создавать темы
Скачивать файлы
Доступ к архиву Pawno-Info

OnPlayerEditDynamicObject

Статус
В этой теме нельзя размещать новые ответы.

Armanish

Компетентный
Вообщем когда хочу я поставить мебель в своем доме не появляются текстдравы для редактирования места то есть не вызывается EditDynamicObject
В аккаунте pModelObject при покупке мебели все записывается нормально, ид объекта и все в этом духе нормально записывается

Вот код:
PHP:
case 2726:
		{
			if(!response) return ShowPlayerDialog(playerid,dHouseMenu,2,"{96e300}Управление домом","{Ffa500}1. {FFFFFF}Открыть | закрыть дом\n{Ffa500}2. {FFFFFF}Статистика дома\n{Ffa500}3. {FFFFFF}Улучшения\n{Ffa500}4. {FFFFFF}Гараж\n{Ffa500}5. {FFFFFF}Найти авто на карте\n{Ffa500}6. {FFFFFF}Продать дом\n{FFa500}7. {ffffff}Мебель [НОВОЕ]","Далее","Отмена");
			if(pData[playerid][pMebel][listitem] <= 0) return SendClientMessage(playerid,0xFFa500AA,"[Ошибка] У Вас нет данного предмета");
			new k = -1, Float:pos[4];
			for(new i; i<MAX_MEBEL_MODEL; i++)
			{
			    if(HouseMebel[pData[playerid][pHouse]][listitem][i]) continue;
		 		k = i;
		 		break;
			}
			if(k == -1) return SendClientMessage(playerid,0xFFa500AA,"[Ошибка] В Вашем доме уже 10 подобных предметов");
			GetPlayerPos(playerid,pos[0],pos[1],pos[2]);
			GetPlayerFacingAngle(playerid,pos[3]);
			SetPVarInt(playerid,"MebelType",listitem);
			SetPVarInt(playerid,"MebelNumber",k);
			SetPVarInt(playerid,"MebelAdd",true);
			new houseid = pData[playerid][pHouse]-1;
			EditDynamicObject(playerid,CreateDynamicObject(pData[playerid][pMebelObject][listitem],pos[0]+1.5,pos[1],pos[2],0,0,pos[3],houseid));
			return 1;
		}
PHP:
public OnPlayerEditDynamicObject(playerid, objectid, response, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz)
{
	if((GetPVarInt(playerid,"MebelType") || !GetPVarInt(playerid,"MebelType")) && (GetPVarInt(playerid,"MebelNumber") || !GetPVarInt(playerid,"MebelNumber")) && response == EDIT_RESPONSE_FINAL && !GetPVarInt(playerid, "MebelRedact") && GetPVarInt(playerid, "MebelAdd"))
	{
		stringor[0] = EOS;
		DestroyDynamicObject(objectid);
		HouseMebel[pData[playerid][pHouse]][GetPVarInt(playerid,"MebelType")][GetPVarInt(playerid,"MebelNumber")] = CreateDynamicObject(pData[playerid][pMebelObject][GetPVarInt(playerid,"MebelType")],x,y,z,0,0,rz,pData[playerid][pHouse]+50);
		mysql_format(MySQLGo, stringor,sizeof(stringor), "INSERT INTO `mebel` (`Model`, `PosX`, `PosY`, `PosZ`, `PosA`, `House`, `Type`, `Number`) VALUES ('%d', '%f', '%f', '%f', '%f', '%d', '%d', '%d')",
		pData[playerid][pMebelObject][GetPVarInt(playerid,"MebelType")], x, y, z, rz, pData[playerid][pHouse], GetPVarInt(playerid,"MebelType"), GetPVarInt(playerid,"MebelNumber"));
		mysql_empty(MySQLGo, stringor);
		pData[playerid][pMebel][GetPVarInt(playerid,"MebelType")]--;
		format(stringor,sizeof(stringor),"%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i,%i",pData[playerid][pMebel][0],pData[playerid][pMebel][1],pData[playerid][pMebel][2],pData[playerid][pMebel][3],pData[playerid][pMebel][4],
		pData[playerid][pMebel][5],pData[playerid][pMebel][6],pData[playerid][pMebel][7],pData[playerid][pMebel][8],pData[playerid][pMebel][9],pData[playerid][pMebel][10],
		pData[playerid][pMebel][11],pData[playerid][pMebel][12],pData[playerid][pMebel][13],pData[playerid][pMebel][14],pData[playerid][pMebel][15]);
	    UpdatePlayerDataEx(playerid, "pMebel", stringor);
	    /*switch(GetPVarInt(playerid,"MebelType"))
		{
		    case 0: HouseInfo[pData[playerid][pHouse]][LabelText][4] = CreateDynamic3DTextLabel("Чтобы открыть холодильник, нажмите клавишу:\n"SERVER"''H''", -1,x,y,z+1,9.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,pData[playerid][pHouse]+50);
		    case 1,3: HouseInfo[pData[playerid][pHouse]][LabelText][3] = CreateDynamic3DTextLabel("Для просмотра телевизора введите:\n"SERVER"(/tv)",CWHITE,x,y,z+1,9.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,pData[playerid][pHouse]+50);
			case 7: HouseInfo[pData[playerid][pHouse]][LabelText][5] = CreateDynamic3DTextLabel("Чтобы переодеться, нажмите клавишу:\n"SERVER"''H''", -1,x,y,z+1,9.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,pData[playerid][pHouse]+50);
			case 8: HouseInfo[pData[playerid][pHouse]][LabelText][2] = CreateDynamic3DTextLabel("Для того чтобы лечь спать, нажмите клавишу:\n"SERVER"''H''", -1,x,y,z+1,9.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,pData[playerid][pHouse]+50);
		}*/
		DeletePVar(playerid,"MebelType");
		DeletePVar(playerid,"MebelNumber");
		DeletePVar(playerid,"MebelAdd");
	}
	else if((GetPVarInt(playerid,"MebelType") || !GetPVarInt(playerid,"MebelType")) && (GetPVarInt(playerid,"MebelNumber") || !GetPVarInt(playerid,"MebelNumber")) && response == EDIT_RESPONSE_FINAL && GetPVarInt(playerid, "MebelRedact"))
	{
	    stringor[0] = EOS;
	    DestroyDynamicObject(objectid);
   		HouseMebel[pData[playerid][pHouse]][GetPVarInt(playerid,"MebelType")][GetPVarInt(playerid,"MebelNumber")] = CreateDynamicObject(pData[playerid][pMebelObject][GetPVarInt(playerid,"MebelType")],x,y,z,0,0,rz,pData[playerid][pHouse]+50);
   		mysql_format(MySQLGo, stringor, sizeof(stringor), "UPDATE `mebel` SET `PosX` = '%f', `PosY` = '%f', `PosZ` = '%f', `PosA` = '%f' WHERE `House`='%i' AND `Type` = '%i' AND `Number` = '%i'", x, y, z, rz, pData[playerid][pHouse],GetPVarInt(playerid,"MebelType"),GetPVarInt(playerid,"MebelNumber"));
   		mysql_empty(MySQLGo, stringor);
	    /*switch(GetPVarInt(playerid,"MebelType"))
		{
		    case 0: DestroyDynamic3DTextLabel(HouseInfo[pData[playerid][pHouse]][LabelText][4]);
		    case 1,3: DestroyDynamic3DTextLabel(HouseInfo[pData[playerid][pHouse]][LabelText][3]);
		    case 8: DestroyDynamic3DTextLabel(HouseInfo[pData[playerid][pHouse]][LabelText][2]);
		}
	    switch(GetPVarInt(playerid,"MebelType"))
		{
		    case 0: HouseInfo[pData[playerid][pHouse]][LabelText][4] = CreateDynamic3DTextLabel("Чтобы открыть холодильник, нажмите клавишу:\n"SERVER"''H''", -1,x,y,z+1,9.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,pData[playerid][pHouse]+50);
		    case 1,3: HouseInfo[pData[playerid][pHouse]][LabelText][3] = CreateDynamic3DTextLabel("Для просмотра телевизора введите:\n"SERVER"(/tv)",CWHITE,x,y,z+1,9.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,pData[playerid][pHouse]+50);
   			case 7: HouseInfo[pData[playerid][pHouse]][LabelText][5] = CreateDynamic3DTextLabel("Чтобы переодеться, нажмите клавишу:\n"SERVER"''H''", -1,x,y,z+1,9.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,pData[playerid][pHouse]+50);
			case 8: HouseInfo[pData[playerid][pHouse]][LabelText][2] = CreateDynamic3DTextLabel("Для того чтобы лечь спать, нажмите клавишу:\n"SERVER"''H''", -1,x,y,z+1,9.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,0,pData[playerid][pHouse]+50);
		}*/
		DeletePVar(playerid,"MebelType");
		DeletePVar(playerid,"MebelNumber");
		DeletePVar(playerid,"MebelRedact");
	}
	else if((GetPVarInt(playerid,"MebelType") || !GetPVarInt(playerid,"MebelType")) && (GetPVarInt(playerid,"MebelNumber") || !GetPVarInt(playerid,"MebelNumber")) && response == EDIT_RESPONSE_CANCEL && !GetPVarInt(playerid, "MebelRedact"))
	{
		DestroyDynamicObject(objectid);
		DeletePVar(playerid,"MebelType");
		DeletePVar(playerid,"MebelNumber");
		DeletePVar(playerid,"MebelRedact");
	}
	else if((GetPVarInt(playerid,"MebelType") || !GetPVarInt(playerid,"MebelType")) && (GetPVarInt(playerid,"MebelNumber") || !GetPVarInt(playerid,"MebelNumber")) && response == EDIT_RESPONSE_CANCEL && GetPVarInt(playerid, "MebelRedact"))
	{
		DestroyDynamicObject(objectid);
		HouseMebel[pData[playerid][pHouse]][GetPVarInt(playerid,"MebelType")][GetPVarInt(playerid,"MebelNumber")] = CreateDynamicObject(pData[playerid][pMebelObject][GetPVarInt(playerid,"MebelType")],GetPVarFloat(playerid,"HouseX"),GetPVarFloat(playerid,"HouseY"),GetPVarFloat(playerid,"HouseZ"),0,0,GetPVarFloat(playerid,"HouseRz"),pData[playerid][pHouse]+50);
		DeletePVar(playerid,"HouseX"),DeletePVar(playerid,"HouseY"),DeletePVar(playerid,"HouseZ"),DeletePVar(playerid,"HouseRz");
		DeletePVar(playerid,"MebelType");
		DeletePVar(playerid,"MebelNumber");
		DeletePVar(playerid,"MebelRedact");
	}
	return true;
}
 
Статус
В этой теме нельзя размещать новые ответы.
Сверху Снизу