Message wont display?
#1

Right, so I have this code, but in game, the message wont print, does anyone know why?



pawn Код:
if(strcmp(cmd, "/createhouse", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] < 10)
            {
                SendClientMessage(playerid,COLOR_WHITE,"You're not authroized to use this command !");
                return 1;
            }
            else
            {
                new house;
                for(new h = 1; h < SCRIPT_MAXHOUSES; h++)
                {
                    if(HouseInfo[h][hOwned] != 1)
                    {
                        house = h;
                        break;
                    }
                    else
                    {
                        new Float:X,Float:Y,Float:Z;
                        GetPlayerPos(playerid,X,Y,Z);
                        //format(string,sizeof(string),"Exit of Biz %d to %f - %f - %f",proplev,X,Y,Z);
                        //ABroadCast(COLOR_YELLOW,string,1);
                        SendClientMessage(playerid,COLOR_LIGHTRED,"A house should've been created.");
                        HouseInfo[house][hEntrancex] = X;
                        HouseInfo[house][hEntrancey] = Y;
                        HouseInfo[house][hEntrancez] = Z;
                        HouseInfo[house][hPickupID] = CreateDynamicPickup(1273, 1, X, Y, Z);
                        OnPropUpdate();
                        return 1;
                    }
                }
            }
        }
        return 1;
    }
Reply
#2

Cause you commented the print
pawn Код:
if(strcmp(cmd, "/createhouse", true) == 0)
    {
        if(IsPlayerConnected(playerid))
        {
            if (PlayerInfo[playerid][pAdmin] < 10)
            {
                SendClientMessage(playerid,COLOR_WHITE,"You're not authroized to use this command !");
                return 1;
            }
            else
            {
                new house;
                for(new h = 1; h < SCRIPT_MAXHOUSES; h++)
                {
                    if(HouseInfo[h][hOwned] != 1)
                    {
                        house = h;
                        break;
                    }
                    else
                    {
                        new Float:X,Float:Y,Float:Z;
                        GetPlayerPos(playerid,X,Y,Z);
                        format(string,sizeof(string),"Exit of Biz %d to %f - %f - %f",proplev,X,Y,Z);
                        ABroadCast(COLOR_YELLOW,string,1);
                        SendClientMessage(playerid,COLOR_LIGHTRED,"A house should've been created.");
                        HouseInfo[house][hEntrancex] = X;
                        HouseInfo[house][hEntrancey] = Y;
                        HouseInfo[house][hEntrancez] = Z;
                        HouseInfo[house][hPickupID] = CreateDynamicPickup(1273, 1, X, Y, Z);
                        OnPropUpdate();
                        return 1;
                    }
                }
            }
        }
        return 1;
    }
Reply
#3

I tried that and it still wasn't working.
Reply
#4

Is the players admin level above 10?
Reply
#5

The player we're speaking of is the owner.

Anyway, the current code is

pawn Код:
if(strcmp(cmd, "/createhouse", true) == 0)
    {
        if(IsPlayerConnected(playerid)) {
            new house;
            if (PlayerInfo[playerid][pAdmin] < 10) return SendClientMessage(playerid,COLOR_WHITE,"You're not authroized to use this command !");
            for(new h = 1; h < SCRIPT_MAXHOUSES; h++) {
                if(HouseInfo[h][hOwned] != 1)
                {
                    house = h;
                    break;
                }
                new Float:X,Float:Y,Float:Z;
                GetPlayerPos(playerid,X,Y,Z);
                format(string,sizeof(string),"Admin %s created an house, ID %d, at X[%f] Y[%f] Z[%f].",GetPlayerNameEx(playerid),h,X,Y,Z);
                ABroadCast(COLOR_LIGHTRED,string,1);
                HouseInfo[house][hEntrancex] = X;
                HouseInfo[house][hEntrancey] = Y;
                HouseInfo[house][hEntrancez] = Z;
                HouseInfo[house][hPickupID] = CreateDynamicPickup(1273, 1, X, Y, Z);
                OnPropUpdate();
                return 1;
            }
        }
        return 1;
    }
Yet it still wont create a house.
Reply
#6

Well whats 'owners' admin lvl
Reply
#7

Well you mean the message of the house creation isn't displaying or the house doesn't create at all. I noticed ABroadcast has the last param set to 1 which I think is the admin level, try setting that to 10. Correct me if I'm wrong.
Reply
#8

PHP код:
if(strcmp(cmd"/createhouse"true) == 0)
{
    if(
IsPlayerConnected(playerid))
    {
         new 
house;
           if (
PlayerInfo[playerid][pAdmin] < 10) return SendClientMessage(playerid,COLOR_WHITE,"You're not authroized to use this command !");
         for(new 
1SCRIPT_MAXHOUSESh++)
         {
              if(
HouseInfo[h][hOwned] != 1)
            {
                 
house h;
                   break;
               }
            new 
Float:X,Float:Y,Float:Z;
               
GetPlayerPos(playerid,X,Y,Z);
            print(
"debug");
               
HouseInfo[house][hEntrancex] = X;
              
HouseInfo[house][hEntrancey] = Y;
            
HouseInfo[house][hEntrancez] = Z;
             
HouseInfo[house][hPickupID] = CreateDynamicPickup(12731XYZ);
              
OnPropUpdate();
               return 
1;
          }
    }
     return 
1;

Reply
#9

Kush.. You forgot the loop
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)