Message wont display? -
Will77 - 15.09.2011
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;
}
Re: Message wont display? -
Pinguinn - 15.09.2011
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;
}
Re: Message wont display? -
Will77 - 15.09.2011
I tried that and it still wasn't working.
Re: Message wont display? -
PrawkC - 15.09.2011
Is the players admin level above 10?
Re: Message wont display? -
Will77 - 15.09.2011
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.
Re: Message wont display? -
PrawkC - 15.09.2011
Well whats 'owners' admin lvl
Re: Message wont display? -
scottyishere - 15.09.2011
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.
Re: Message wont display? -
Kush - 15.09.2011
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 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);
print("debug");
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;
}
Re: Message wont display? -
PrawkC - 15.09.2011
Kush.. You forgot the loop