OnPlayerText
#1

Sup, There a 4errors on one line

Код:
public OnPlayerText(playerid, text[])
{
    if(text[0] == '1' && HouseBuy1[playerid] == 1)
    {
	  SendClientMessage(playerid, -1, "You cannot purchase this house Right now {FFFFFF}[{00FFFF}Its not available Yet{FFFFFF}]");
	  HideDraw(playerid);
    }
	return 1;
}
PHP код:
error 028invalid subscript (not an array or too many subscripts): "HouseBuy1"
warning 215expression has no effect
 error 001
expected token";"but found "]"
error 029invalid expressionassumed zero
fatal error 107
too many error messages on one line 
Reply
#2

Which is the line with those errors?

Also, put the line in which you declare "HouseBuy1"

Also HideDraw is not a function
Reply
#3

Also, replace this:

Код:
SendClientMessage(playerid, -1, "You cannot purchase this house Right now {FFFFFF}[{00FFFF}Its not available Yet{FFFFFF}]");
With this:

Код:
SendClientMessage(playerid, -1, "You cannot purchase this house Right now {FFFFFF}{00FFFF}Its not available Yet{FFFFFF}");
Reply
#4

Here the line of bug

if(text[0] == '1' && HouseBuy1[playerid] == 1)
Reply
#5

Put the line in which you declare "HouseBuy1"
Reply
#6

Most likely, HouseBuy1 is not defined with [MAX_PLAYERS] making it a variable, not an array.

That's what i can read from the error. In order to use HouseBuy1[playerid], make sure it's defined like this:
PHP код:
new HouseBuy1[MAX_PLAYERS]; 
That also requires you to change the variable wherever else it has been used.
Reply
#7

Wrong...
Reply
#8

Quote:
Originally Posted by RedRex
Посмотреть сообщение
Wrong...
Perhaps you can state why "what" is wrong?
Saying "wrong" helps noone. Useless reply in my opinion, you don't even tell what you claim is wrong.
Reply
#9

https://sampwiki.blast.hk/wiki/OnPlayerText

According to that This function is called
Код:
Called when a player sends a chat message.
RedRex is right,It's wrong,Paste some more code? Can you?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)