[HELP]SendClientMessage not working properly
#1

Ok well i just puted in a streamer in my gamemode so i can stream checkpoints,well the checkpoints are working perfectly.But then i edited OnPlayerEnterDynamicCP so that if a person enters a checkpoint of a house that the house is not own it is supposed to say "This house is for sale"Well that works,But i also made it if a person enter a checkpoint of the house owned it will say "House is owned by %s" Well that doesn't work it says the same thing "House is for sale" even though the house is owned how can i fix it.heres my code:
Код:
public LoadPickups()
{
	pickuptoggle = 1;
	new string[128];


for(new h = 0; h < sizeof(HouseInfo); h++)
	{
 	if(HouseInfo[h][hOwned] == 0)
		{


			 	Houses = CreateDynamicCP(HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ], 2.2000, -1, -1, -1, 25);

		}
		if(HouseInfo[h][hOwned] == 1)
		{


			HousesOwned = CreateDynamicCP(HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ],2.2000, -1, -1, -1, 25);
		}
	}
}
public OnPlayerEnterDynamicCP(playerid, checkpointid) //there should be no ; at the end, this is a callback
{
new Bool:bHouseO[MAX_PLAYERS] = 1;
new string[256];
for(new h = 0; h < sizeof(HouseInfo); h++)
	{


	if(bHouseO[playerid] == 1)
	{
		if(HouseInfo[h][hOwned] == 0)
		{
if(checkpointid = Houses)
	{
		SendClientMessage(playerid, COLOR_GREEN, "Would you like to buy this house?");
		SendClientMessage(playerid, COLOR_GREEN, "Price show in the text");
		SendClientMessage(playerid, COLOR_WHITE, "Avilable Commands:/enter,(/buyhouse)");
bHouseO[playerid] = 0;
	}

else if(bHouseO[playerid] == 1)
	{
if(HouseInfo[h][hOwned] == 0)
		{
	if(checkpointid = HousesOwned)
	{
	format(string, sizeof(string),"House is owned by %s",HouseInfo[h][hOwner]);
	SendClientMessage(playerid,COLOR_WHITE,string);
	bHouseO[playerid] = 0;

}
}
}
}
}
}
	return 1;
}

Please help thanks
Reply
#2

So if someone can reply asap thanks.
Reply
#3

Whats the error your getting?
Reply
#4

Write the error.
Reply
#5

Quote:
Originally Posted by CuETe
Ok well i just puted in a streamer in my gamemode so i can stream checkpoints,well the checkpoints are working perfectly.But then i edited OnPlayerEnterDynamicCP so that if a person enters a checkpoint of a house that the house is not own it is supposed to say "This house is for sale"Well that works,But i also made it if a person enter a checkpoint of the house owned it will say "House is owned by %s" Well that doesn't work it says the same thing "House is for sale" even though the house is owned how can i fix it.heres my code:
Did he say anything about any errors? He asked why he got no messages when he was at the checkpoint
Reply
#6

Lol no im saying it says the same message "House is for sale" when the house is owned it is supposed to say "House is owned by %s" but it doesn't.
Reply
#7

Quote:
Originally Posted by CuETe
Lol no im saying it says the same message "House is for sale" when the house is owned it is supposed to say "House is owned by %s" but it doesn't.
Please reply asap i need this fixed
Reply
#8

pawn Код:
public LoadPickups()
{
    pickuptoggle = 1;
    new string[128];


for(new h = 0; h < sizeof(HouseInfo); h++)
    {
    if(HouseInfo[h][hOwned] == 0)
        {


                Houses = CreateDynamicCP(HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ], 2.2000, -1, -1, -1, 25);

        }
        if(HouseInfo[h][hOwned] == 1)
        {


            HousesOwned = CreateDynamicCP(HouseInfo[h][hEnterX], HouseInfo[h][hEnterY], HouseInfo[h][hEnterZ],2.2000, -1, -1, -1, 25);
        }
    }
}
public OnPlayerEnterDynamicCP(playerid, checkpointid) //there should be no ; at the end, this is a callback
{
    new Bool:bHouseO[MAX_PLAYERS] = 1;
    new string[256];
    for(new h = 0; h < sizeof(HouseInfo); h++)
    {


        if(bHouseO[playerid] == 1)
        {
            if(HouseInfo[h][hOwned] == 0)
            {
                if(checkpointid = Houses)
                {
                    SendClientMessage(playerid, COLOR_GREEN, "Would you like to buy this house?");
                    SendClientMessage(playerid, COLOR_GREEN, "Price show in the text");
                    SendClientMessage(playerid, COLOR_WHITE, "Avilable Commands:/enter,(/buyhouse)");
                    bHouseO[playerid] = 0;
                }
                else if(HouseInfo[h][hOwned] == 0)
                {
                    if(checkpointid = HousesOwned)
                    {
                        format(string, sizeof(string),"House is owned by %s",HouseInfo[h][hOwner]);
                        SendClientMessage(playerid,COLOR_WHITE,string);
                        bHouseO[playerid] = 0;
                    }
                }
            }
        }
    }
    return 1;
}
Reply
#9

Ok let me see if it works ig
Reply
#10

Ok no it doesn't work it still says If the house is owned "House is for sale" what is wrong?
Reply


Forum Jump:


Users browsing this thread: 5 Guest(s)