SA-MP Forums Archive
PlayerText Commands - 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: PlayerText Commands (/showthread.php?tid=130178)



PlayerText Commands - Fugative. - 25.02.2010

pawn Код:
if(buyfood[playerid] == 1)
    {
        if (strcmp(text,"1",true) == 0)
        {
        new Playermoney = GetPlayerMoney(playerid);
        if (Playermoney >= 1)
        {
            SetPlayerHealth(playerid, eHealth+5);
            buyfood[playerid] = 1;
            return 0;
        }
        SendClientMessage(playerid,RED,"You don't have enough money to buy this!");
        return 1;
    }
Right for some reason when this command is being used, In chat I keep saying 1. How can I stop this? my code is right isn't?


Re: PlayerText Commands - wafffllesss - 25.02.2010

Quote:
Originally Posted by Fugitive.
pawn Код:
if(buyfood[playerid] == 1)
    {
        if (strcmp(text,"1",true) == 0)
        {
        new Playermoney = GetPlayerMoney(playerid);
        if (Playermoney >= 1)
        {
            SetPlayerHealth(playerid, eHealth+5);
            buyfood[playerid] = 1;
            return 0;
        }
        SendClientMessage(playerid,RED,"You don't have enough money to buy this!");
        return 1;
    }
Right for some reason when this command is being used, In chat I keep saying 1. How can I stop this? my code is right isn't?
Return False. then the chat wont show it.


Re: PlayerText Commands - Fugative. - 25.02.2010

I replaced Return1; with Return false Still nothing




Re: PlayerText Commands - VonLeeuwen - 25.02.2010

Try this:

Код:
if(buyfood[playerid] == 1)
{
	if(strcmp(text,"1",true) == 0)
	{
		new Playermoney = GetPlayerMoney(playerid);
		if (Playermoney >= 1)
		{
			SetPlayerHealth(playerid, eHealth+5);
			buyfood[playerid] = 1;
		}
		else
		{
			SendClientMessage(playerid,RED,"You don't have enough money to buy this!");
		}
	}
	return 0;
}



Re: PlayerText Commands - Torran - 25.02.2010

This probably wont help you

But NEVER return 0 in OnPlayerText as when a player types hello or something it wont appear in chatbox


Re: PlayerText Commands - VonLeeuwen - 25.02.2010

Quote:
Originally Posted by Torran
This probably wont help you

But NEVER return 0 in OnPlayerText as when a player types hello or something it wont appear in chatbox
My function wouldn't do that, as what I wrote will be placed INSIDE the OnPlayerText callback.


Re: PlayerText Commands - Torran - 25.02.2010

Quote:
Originally Posted by VonLeeuwen
Quote:
Originally Posted by Torran
This probably wont help you

But NEVER return 0 in OnPlayerText as when a player types hello or something it wont appear in chatbox
My function wouldn't do that, as what I wrote will be placed INSIDE the OnPlayerText callback.
I wasnt referring to your function, I was just saying


Re: PlayerText Commands - VonLeeuwen - 26.02.2010

Ah okay :P