Ignore Number Commands? -
DeerHooves - 18.02.2009
I'm trying to make a menu, and when its open, if you enter a number 1-10 it gives you that item on the textdraw. It works, but the only problem is that it spams the server client and server_log with numbers.
Example of command:
Код:
if(test[playerid] == 1)
{
new Float:phealth;
if (strcmp(text,"1",true) == 0)
{
}
else if (strcmp(text,"2",true) == 0)
{
}...
Example of server_log.txt:
Код:
[19:36:14] [chat] [player]: 1
[19:36:15] [chat] [player]: 2
[19:36:16] [chat] [player]: 3
[19:36:17] [chat] [player]: 4
[19:37:14] [chat] [player]: 5
Is there a way to make it ignore these #'s/commands on the server_log? There will be thousands of these spamming the log if its left as is.
Re: Ignore Number Commands? -
ICECOLDKILLAK8 - 18.02.2009
No
Re: Ignore Number Commands? -
1337pr0 - 19.02.2009
Quote:
Originally Posted by JeNkStAX
No
|

No imagination.
You need to customize OnPlayerText. Example:
pawn Код:
public OnPlayerText(playerid, text[])
{
if (IsPlayerInMenu(playerid))
{
// menu code stuff here
return 0;
}
return 1;
}
Re: Ignore Number Commands? -
Joe Staff - 19.02.2009
regardless, it shows in the log
Re: Ignore Number Commands? -
Norn - 19.02.2009
Quote:
Originally Posted by SilentHuntR
regardless, it shows in the log
|
It's not possible if it's return'd 0.
Re: Ignore Number Commands? -
DeerHooves - 19.02.2009
Quote:
Originally Posted by 1337pr0
You need to customize OnPlayerText. Example:
pawn Код:
public OnPlayerText(playerid, text[]) { if (IsPlayerInMenu(playerid)) { // menu code stuff here return 0; } return 1; }
|
I don't quite understand, how would I tell it that the player is in the menu?
Re: Ignore Number Commands? -
Norn - 19.02.2009
pawn Код:
if(test[playerid] == 1)
{
//All your stuff.
return 0;//Stopping text from continuing
}
Re: Ignore Number Commands? -
DeerHooves - 19.02.2009
Quote:
Originally Posted by Norn
pawn Код:
if(test[playerid] == 1) { //All your stuff. return 0;//Stopping text from continuing }
|
This is the way it is now, it does not show the numbers in chat, but they do spam the server window, and server log.
pawn Код:
public OnPlayerText(playerid, text[])
{
if(test[playerid] == 1)
{
if (strcmp(text,"1",true) == 0)
{
GivePlayerMoney(playerid, 100);
return 0;
}
else if (strcmp(text,"2",true) == 0)
{
GivePlayerMoney(playerid, 100);
return 0;
}
else if (strcmp(text,"3",true) == 0)
{
GivePlayerMoney(playerid, 100);
return 0;
}
else
{
SendClientMessage(playerid,COLOR_BRIGHTRED,"(1-3). Use LMB To Close The Menu.");
return 0;
}
}
return 0;
}
Also, when I return 0 at the end of the "if(test[playerid] == 1)", it gives me a warning that its unreachable, which I don't quite understand, because nothing blocking it.
Re: Ignore Number Commands? -
Norn - 19.02.2009
You can't stop text from showing in the server window.