If someone says "hey" a message is sent to the player
#1

Need help on doing this ^^
Reply
#2

More information please..
Reply
#3

pawn Код:
public OnPlayerText(playerid, text[])
{
  if(!strcmp(text, "hey", true))
  {
    SendClientMessage(playerid, 0xFFFFFFAA, "Message here");
  }
}
Reply
#4

Quote:
Originally Posted by PSPLeo
pawn Код:
public OnPlayerText(playerid, text[])
{
  if(!strcmp(text, "hey", true))
  {
    SendClientMessage(playerid, 0xFFFFFFAA, "Message here");
  }
}
tanks
Reply
#5

Quote:
Originally Posted by PSPLeo
pawn Код:
public OnPlayerText(playerid, text[])
{
  if(!strcmp(text, "hey", true))
  {
    SendClientMessage(playerid, 0xFFFFFFAA, "Message here");
  }
}
error 017: undefined symbol "text"
Reply
#6

What line is the error on?
Reply
#7

Quote:
Originally Posted by braduz
Quote:
Originally Posted by PSPLeo
pawn Код:
public OnPlayerText(playerid, text[])
{
  if(!strcmp(text, "hey", true))
  {
    SendClientMessage(playerid, 0xFFFFFFAA, "Message here");
  }
}
error 017: undefined symbol "text"
Just change "text to what you have at OnPlayerText(player, "that is that TEXT error" so you will have

public OnPlayerText(playerid, //IDK WHAT YOU GOT HERE[])
{
if(!strcmp(//SAME AS IDK..., "hey", true))
{
SendClientMessage(playerid, 0xFFFFFFAA, "Message here");
}
}
Reply
#8

Quote:
Originally Posted by MaykoX
Quote:
Originally Posted by braduz
Quote:
Originally Posted by PSPLeo
pawn Код:
public OnPlayerText(playerid, text[])
{
  if(!strcmp(text, "hey", true))
  {
    SendClientMessage(playerid, 0xFFFFFFAA, "Message here");
  }
}
error 017: undefined symbol "text"
Just change "text to what you have at OnPlayerText(player, "that is that TEXT error" so you will have

public OnPlayerText(playerid, //IDK WHAT YOU GOT HERE[])
{
if(!strcmp(//SAME AS IDK..., "hey", true))
{
SendClientMessage(playerid, 0xFFFFFFAA, "Message here");
}
}
Reply
#9

I explain what he means:

pawn Код:
public OnPlayerText(playerid, text[])
{
  if(!strcmp(text, "hey", true))
  {
    SendClientMessage(playerid, 0xFFFFFFAA, "Message here");
  }
}
You need to have the variable "text" in the public declaration. That means, if "text[]" would be "Woot[]" it would look like this:

pawn Код:
public OnPlayerText(playerid, Woot[])
{
  if(!strcmp(Woot, "hey", true))
  {
    SendClientMessage(playerid, 0xFFFFFFAA, "Message here");
  }
}
The name of the string in the comparation must the the same as in the public declaration.

I hope you understood.
Reply
#10

Quote:
Originally Posted by DeathOnaStick
I explain what he means:

pawn Код:
public OnPlayerText(playerid, text[])
{
  if(!strcmp(text, "hey", true))
  {
    SendClientMessage(playerid, 0xFFFFFFAA, "Message here");
  }
}
You need to have the variable "text" in the public declaration. That means, if "text[]" would be "Woot[]" it would look like this:

pawn Код:
public OnPlayerText(playerid, Woot[])
{
  if(!strcmp(Woot, "hey", true))
  {
    SendClientMessage(playerid, 0xFFFFFFAA, "Message here");
  }
}
The name of the string in the comparation must the the same as in the public declaration.

I hope you understood.
ahh, so if i added lots of texts i would have to add them all in the title brackets? ()
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)