Dyanamic object spawner/maker
#1

This is my house pimping script
Код:
    if(strcmp(cmd,"/pimphouse",true)==0)
    {
        if(IsPlayerConnected(playerid))
        {
            new playername[32];
            GetPlayerName(playerid, playername, sizeof(playername));
			new family = PlayerInfo[playerid][pLocal];
			if(GetPlayerState(playerid) != PLAYER_STATE_ONFOOT)
            {
                SendClientMessage(playerid,COLOR_GREY,"You must be onfoot.");
                return 1;
            }
	        tmp = strtok(cmdtext, idx);
	        if(!strlen(tmp))
	        {
	            SendClientMessage(playerid, COLOR_WHITE, "USAGE: /pimphouse [Object ID - Object List on www.Universal-RP.com]");
	            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 == 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(PlayerInfo[playerid][pLocal] != playerid)
			    {
			        for(new i = 0; i < sizeof(FurnInfo); i++)
  	                {
						if(FurnInfo[i][fTaken] == 0)
						{
						    if(FurnInfo[i][fTakenID] != family)
						    {
                                if(PlayerInfo[playerid][pLocal] != playerid)
	                            {
					               SendClientMessage(playerid, COLOR_GREY, "   You are tpo far from your house !");
				                   return 1;
				                }
								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, world);
	                        		}
	                        		else if(objectid == 1985)
	                        		{
	                        		    FurnObject[i] = CreateDynamicObject(objectid, X, Y, Z, 0, 0+1, Angle, world);
	                        		}
	                        		else
	                        		{
	                        		    FurnObject[i] = CreateDynamicObject(objectid, X, Y, Z-1, 0, 0, Angle, world);
	                        		}
	                        		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][pLocal];
		                    		PlayerInfo[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;
                }
			return 1;
	    }
	    return 1;
    }
When i press this command with right object id, nothing happens, No error message appears . Can you help? it compiles fine
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)