House system problem ?
#1

I type here /createhouse and the params


And boom .




WTF?

pawn Код:
if(strcmp(cmd, "/createhouse", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /createhouse [type] [price] [level] [interior]");
                SendClientMessage(playerid, COLOR_GRAD2, "TYPE: (1) Small , Medium , Big");
                return 1;
            }
            if(PlayerInfo[playerid][pAdmin] < 3)
            {
                SendClientMessage(playerid, COLOR_GRAD1, "You don't have acces to use this command.");
                return 1;
            }
            new type;
            new price;
            new level;
            new interior;
            type = strval(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /createhouse [type] [price] [level] [interior]");
                SendClientMessage(playerid, COLOR_GRAD2, "TYPE: (1) Small , Medium , Big");
                return 1;
            }
            price = strval(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {

                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /createhouse [type] [price] [level] [interior]");
                SendClientMessage(playerid, COLOR_GRAD2, "TYPE: (1) Small , Medium , Big");
                return 1;
            }
            level = strval(tmp);
            tmp = strtok(cmdtext, idx);
            if(!strlen(tmp))
            {
                SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /createhouse [type] [price] [level] [interior]");
                SendClientMessage(playerid, COLOR_GRAD2, "TYPE: (1) Small , Medium , Big");
                return 1;
            }
            interior = strval(tmp);
            tmp = strtok(cmdtext, idx);
            new Float:x, Float:y, Float:z;
            GetPlayerPos(playerid, x, y, z);
            new hid = sHouse + 1;
            HouseInfo[hid][hOwned] = 0;
            HouseInfo[hid][hRent] = 0;
            HouseInfo[hid][hLevel] = level;
            HouseInfo[hid][hTakings] = 0;
            format(HouseInfo[hid][hOwner], 128, "No-One");
           
            if(type == 1)
            {
                printf("Type luat");
                if(interior == 1)
                {
                    printf("Interior luat");
                    HouseInfo[hid][hType] = 1;
                    HouseInfo[hid][hInt] = 10;
                    HouseInfo[hid][hExitx] = 2259.38;
                    HouseInfo[hid][hExity] = -1135.77;
                    HouseInfo[hid][hExitz] = 1050.64;
                    HouseInfo[hid][hEntrancex] = x;
                    HouseInfo[hid][hEntrancey] = y;
                    HouseInfo[hid][hEntrancez] = y;
                }
            }
            new fftext[20];
            if(HouseInfo[hid][hType] == 1) { fftext = "mic"; }
           
            HouseInfo[hid][hPickup] = AddStaticPickup(1273, 23, HouseInfo[hid][hEntrancex],HouseInfo[hid][hEntrancey], HouseInfo[hid][hEntrancez]);
            format(string, sizeof(string), "[ Casa de vanzare ]\n\n( Pret de cumparare %d$ )\n( Nivelul necesar %d )\n( Interiorul este %s )", HouseInfo[hid][hValue], HouseInfo[hid][hLevel], fftext);
            HouseInfo[hid][hText3D] = CreateDynamic3DTextLabel(string, COLOR_GROVE, HouseInfo[hid][hEntrancex],HouseInfo[hid][hEntrancey], HouseInfo[hid][hEntrancez]+0.75,10.0,INVALID_PLAYER_ID,INVALID_VEHICLE_ID,1,0,-1,-1, 45.0);
            sHouse++;
            printf(" Am creat casa %d", sHouse);
        }
        return 1;
    }
Reply


Messages In This Thread
House system problem ? - by Metharon - 10.06.2015, 14:43
Re: House system problem ? - by Jimmy0wns - 10.06.2015, 14:50
Re: House system problem ? - by CodeStyle175 - 10.06.2015, 15:12

Forum Jump:


Users browsing this thread: 1 Guest(s)