SA-MP Forums Archive
[HELP]SendClientMessage not working properly - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: [HELP]SendClientMessage not working properly (/showthread.php?tid=148402)



[HELP]SendClientMessage not working properly - Lilcuete - 17.05.2010

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


Re: [HELP]SendClientMessage not working properly - Lilcuete - 17.05.2010

So if someone can reply asap thanks.


Re: [HELP]SendClientMessage not working properly - v0nz - 17.05.2010

Whats the error your getting?


Re: [HELP]SendClientMessage not working properly - Nee - 17.05.2010

Write the error.


Re: [HELP]SendClientMessage not working properly - Ozz - 17.05.2010

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


Re: [HELP]SendClientMessage not working properly - Lilcuete - 17.05.2010

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.


Re: [HELP]SendClientMessage not working properly - Lilcuete - 17.05.2010

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


Re: [HELP]SendClientMessage not working properly - Daren_Jacobson - 17.05.2010

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;
}



Re: [HELP]SendClientMessage not working properly - Lilcuete - 17.05.2010

Ok let me see if it works ig


Re: [HELP]SendClientMessage not working properly - Lilcuete - 17.05.2010

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