PlayerText Commands
#1

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?
Reply
#2

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.
Reply
#3

I replaced Return1; with Return false Still nothing

Reply
#4

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;
}
Reply
#5

This probably wont help you

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

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.
Reply
#7

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
Reply
#8

Ah okay :P
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)