[Help] Objects.
#1

Hello guys. I'm using LSL roleplay gamemode which has furniture system. If I want to plant a furniture object, I need to type /pimphouse, and I need to be standing in right direction, so it can plant properly. I wanna change it.
Now tell me guys, how can I make this:
When I type /pimphouse, it can show me EditObject dialog, where I rotate and move my object.
I know it's EditObject function, but I don't know how to put it in..
Here's the furniture system(/pimphouse CMD)
Код:
if(strcmp(cmd,"/pimphouse",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
            GetPlayerName(playerid, playername, sizeof(playername));
			new family = PlayerInfo[playerid][pHousekey];
			if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT)
            {
                SendClientMessage(playerid,COLOR_GREY,"You must be onfoot.");
                return 1;
            }
            if(PlayerInfo[playerid][pFurnLocked] == 1)
            {
                SendClientMessage(playerid, COLOR_LIGHTRED, "You have been black listed from using the Furniture List.");
	            return 1;
            }
	        tmp = strtok(cmdtext, idx);
	        if(!strlen(tmp))
	        {
	            SendClientMessage(playerid, COLOR_WHITE, "{33CCFF}USAGE:{FFFFFF} /pimphouse [object ID]  -  List on /objects");
	            return 1;
	        }
	        new mammount;
	        mammount = strval(tmp);
	        new objectid;
	        if(mammount == 1729 && PlayerInfo[playerid][pLevel] >= 3) { objectid = mammount; }
	        else if(mammount == 1728 && PlayerInfo[playerid][pLevel] >= 3) { objectid = mammount; }
	        else if(mammount == 1504 && PlayerInfo[playerid][pLevel] >= 6) { objectid = mammount; }
	        else if(mammount == 1506 && PlayerInfo[playerid][pLevel] >= 6) { objectid = mammount; }
	        else if(mammount == 1535 && PlayerInfo[playerid][pLevel] >= 6) { objectid = mammount; }
	        else if(mammount == 1567 && PlayerInfo[playerid][pLevel] >= 6) { objectid = mammount; }
	        else if(mammount == 14880 && PlayerInfo[playerid][pLevel] >= 5) { objectid = mammount; }
	        else if(mammount == 14866 && PlayerInfo[playerid][pLevel] >= 5) { objectid = mammount; }
	        else if(mammount == 14806 && PlayerInfo[playerid][pLevel] >= 7) { objectid = mammount; }
	        else if(mammount == 14446 && PlayerInfo[playerid][pLevel] >= 6) { objectid = mammount; }
	        else if(mammount == 14391 && PlayerInfo[playerid][pLevel] >= 9) { objectid = mammount; }
	        else if(mammount == 2738 && PlayerInfo[playerid][pLevel] >= 5) { objectid = mammount; }
	        else if(mammount == 2003 && PlayerInfo[playerid][pLevel] >= 5) { objectid = mammount; }
	        else if(mammount == 2648 && PlayerInfo[playerid][pLevel] >= 4) { objectid = mammount; }
	        else if(mammount == 2526 && PlayerInfo[playerid][pLevel] >= 6) { objectid = mammount; }
	        else if(mammount == 2523 && PlayerInfo[playerid][pLevel] >= 6) { objectid = mammount; }
	        else if(mammount == 2332 && PlayerInfo[playerid][pLevel] >= 8) { objectid = mammount; }
	        else if(mammount == 2103 && PlayerInfo[playerid][pLevel] >= 4) { objectid = mammount; }
	        else if(mammount == 1745 && PlayerInfo[playerid][pLevel] >= 5) { objectid = mammount; }
	        else if(mammount == 1481 && PlayerInfo[playerid][pLevel] >= 4) { objectid = mammount; }
	        else if(mammount == 1281 && PlayerInfo[playerid][pLevel] >= 3) { objectid = mammount; }
	        else if(mammount == 1726 && PlayerInfo[playerid][pLevel] >= 4) { objectid = mammount; }
	        else if(mammount == 1896 && PlayerInfo[playerid][pLevel] >= 10) { objectid = mammount; }
	        else if(mammount == 1824 && PlayerInfo[playerid][pLevel] >= 9) { objectid = mammount; }
	        else if(mammount == 2185 && PlayerInfo[playerid][pLevel] >= 7) { objectid = mammount; }
	        else if(mammount == 1433 && PlayerInfo[playerid][pLevel] >= 5) { objectid = mammount; }
	        else if(mammount == 1704 && PlayerInfo[playerid][pLevel] >= 8) { objectid = mammount; }
	        else if(mammount == 1723 && PlayerInfo[playerid][pLevel] >= 6) { objectid = mammount; }
	        else if(mammount == 1805 && PlayerInfo[playerid][pLevel] >= 4) { objectid = mammount; }
	        else if(mammount == 1701 && PlayerInfo[playerid][pLevel] >= 7) { objectid = mammount; }
	        else if(mammount == 1752 && PlayerInfo[playerid][pLevel] >= 4) { objectid = mammount; }
	        else if(mammount == 1795 && PlayerInfo[playerid][pLevel] >= 5) { objectid = mammount; }
	        else if(mammount == 1808 && PlayerInfo[playerid][pLevel] >= 6) { objectid = mammount; }
	        else if(mammount == 2028 && PlayerInfo[playerid][pLevel] >= 4) { objectid = mammount; }
	        else if(mammount == 2147 && PlayerInfo[playerid][pLevel] >= 7) { objectid = mammount; }
	        else if(mammount == 2192 && PlayerInfo[playerid][pLevel] >= 6) { objectid = mammount; }
	        else if(mammount == 2632 && PlayerInfo[playerid][pLevel] >= 8) { objectid = mammount; }
	        else if(mammount == 2872 && PlayerInfo[playerid][pLevel] >= 9) { objectid = mammount; }
	        else if(mammount == 2779 && PlayerInfo[playerid][pLevel] >= 9) { objectid = mammount; }
	        else if(mammount == 2778 && PlayerInfo[playerid][pLevel] >= 9) { objectid = mammount; }
	        else if(mammount == 14651 && PlayerInfo[playerid][pLevel] >= 8) { objectid = mammount; }
	        else if(mammount == 1280 && PlayerInfo[playerid][pLevel] >= 4) { objectid = mammount; }
	        else if(mammount == 1985 && PlayerInfo[playerid][pLevel] >= 9) { objectid = mammount; }
	        else { SendClientMessage(playerid,COLOR_GREY,"Invalid Object ID Or not high enough level !"); return 1; }

			if (IsAtHouseEE(playerid,family,1))
			{
			    if(PlayerInfo[playerid][pHousekey] != 255 && strcmp(playername, HouseInfo[PlayerInfo[playerid][pHousekey]][hOwner], true) == 0)
			    {
			        for(new i = 0; i < sizeof(FurnInfo); i++)
  	                {
						if(FurnInfo[i][fTaken] == 0)
						{
						    if(FurnInfo[i][fTakenID] != family)
						    {
								if(IsObjectLimit(playerid,i,family,GetPlayerInterior(playerid)))
								{
  	                        		new world = GetPlayerVirtualWorld(playerid);
  	                        		new Float:X,Float:Y,Float:Z,Float:Angle;
		                    		GetPlayerPos(playerid, X, Y, Z);
		                    		GetPlayerFacingAngle(playerid,Angle);
									if(objectid == 14880 || objectid == 14866 || objectid == 14806
									|| objectid == 14446 || objectid == 14391 || objectid == 2738
									|| objectid == 2648 || objectid == 2332 || objectid == 1481
									|| objectid == 1896 || objectid == 1824 || objectid == 1805
									|| objectid == 1281 || objectid == 14651 || objectid == 1280)
									{
	                        		    FurnObject[i] = CreateDynamicObject(objectid, X, Y, Z, 0, 0, Angle, GetPlayerVirtualWorld(playerid),-1,-1,200.0);
	                        		}
	                        		else if(objectid == 1985)
	                        		{
	                        		    FurnObject[i] = CreateDynamicObject(objectid, X, Y, Z, 0, 0+1, Angle, GetPlayerVirtualWorld(playerid),-1,-1,200.0);
	                        		}
	                        		else
	                        		{
	                        		    FurnObject[i] = CreateDynamicObject(objectid, X, Y, Z-1, 0, 0, Angle, GetPlayerVirtualWorld(playerid),-1,-1,200.0);
	                        		}
	                        		FurnInfo[i][fx] = X;
		                    		FurnInfo[i][fy] = Y;
		                    		FurnInfo[i][fz] = Z;
		                    		FurnInfo[i][fAngle] = Angle;
		                    		FurnInfo[i][fWorld] = world;
		                    		FurnInfo[i][fType] = objectid;
		                    		FurnInfo[i][fTaken] = 1;
		                    		FurnInfo[i][fTakenID] = PlayerInfo[playerid][pHousekey];
		                    		HouseInfo[family][hOTaken]++;
		                    		SendClientMessage(playerid, COLOR_LIGHTRED, "Furniture has been planted at your location, if you want to remove it type /removefurn or /removeallfurn.");
		                    		//OnPropUpdate();
                                	return 1;
                                }
                                else
                                {
                                    SendClientMessage(playerid,COLOR_GREY,"You've reached your limit on objects.");
                                    return 1;
                                }
                            }
  	                    }
					}
					return 1;
                }
			}
			else
			{
			    SendClientMessage(playerid,COLOR_GREY,"Your not inside your house.");
			    return 1;
			}
			return 1;
	    }
	    return 1;
    }
Reply
#2

Please, anyone?
Reply
#3

I didn't inspect the code carefully but, hopefully I'm not wrong;

pawn Код:
EditDynamicObject(playerid, FurnObject[i]);
After you create the object.
Reply
#4

It is working, but I also have these type of furniture objects, where your code is not working.
Код:
new objectid = FurnInfo[i][fType];
		        if(objectid == 14880 || objectid == 14866 || objectid == 14806
			    || objectid == 14446 || objectid == 14391 || objectid == 2738
			    || objectid == 2648 || objectid == 2332 || objectid == 1481
			    || objectid == 1896 || objectid == 1824 || objectid == 1805
			    || objectid == 1281 || objectid == 1280)
			    {
		            FurnObject[i] = CreateDynamicObject(FurnInfo[i][fType], FurnInfo[i][fx], FurnInfo[i][fy], FurnInfo[i][fz], 0, 0, FurnInfo[i][fAngle], FurnInfo[i][fWorld],-1,-1,200.0);
                    
				}
		        else if(objectid == 1985 || objectid == 14651)
		        {
		            FurnObject[i] = CreateDynamicObject(FurnInfo[i][fType], FurnInfo[i][fx], FurnInfo[i][fy], FurnInfo[i][fz]+4, 0, 0, FurnInfo[i][fAngle], FurnInfo[i][fWorld],-1,-1,200.0);
                    
				}
		        else
		        {
		            FurnObject[i] = CreateDynamicObject(FurnInfo[i][fType], FurnInfo[i][fx], FurnInfo[i][fy], FurnInfo[i][fz]-1, 0, 0, FurnInfo[i][fAngle], FurnInfo[i][fWorld],-1,-1,200.0);
                    
				}
When I put EditDynamicObject(playerid, FurnObject[i]); it says undefined ''playerid''
Reply
#5

You should only use EditDynamicObject on the code piece you want the player to edit the object, nowhere else. Putting it while loading objects into a house will simply not work, since it has nothing to do with it.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)