I don't know if this is possible
#1

Hi all
i wanna know if it is possible to create a function for OnPlayerText
if i type: HELLO then it say hello

Reply
#2

It is. But do you want to have it after a command was entered or just when you type it in the normal chat ?
Reply
#3

Quote:
Originally Posted by afei™
It is. But do you want to have it after a command was entered or just when you type it in the normal chat ?
hmm normal chat
Reply
#4

if(!strcmp(text, "hello", 5, true))
{
SendClientMessage(playerid, color, "hello");
}
Reply
#5

Quote:
Originally Posted by Wadabak
if(!strcmp(text, "hello", 5, true))
{
SendClientMessage(playerid, color, "hello");
}
OMG
i don't want this
i don't ant they use CAPS LOCK
Reply
#6


if(!strcmp(text, "HELLO", 5, true))
{
SendClientMessage(playerid, color, strtolower(text));
return 1;
}

Or capalize something in strtolower, I don't it exactly
Reply
#7

Quote:
Originally Posted by Wadabak
if(!strcmp(text, "HELLO", 5, true))
{
SendClientMessage(playerid, color, strtolower(text));
return 1;
}

Or capalize something in strtolower, I don't it exactly
This is wrong.
Код:
if(!strcmp(text, "HELLO", 5, true))
{
  SendClientMessage(playerid, color, strtolower(text));
  return 1;
}
Reply
#8

Quote:
Originally Posted by -=[Serbish
=- ]
Quote:
Originally Posted by Wadabak
if(!strcmp(text, "HELLO", 5, true))
{
SendClientMessage(playerid, color, strtolower(text));
return 1;
}

Or capalize something in strtolower, I don't it exactly
Then tell me what's good

This is wrong.
Код:
if(!strcmp(text, "HELLO", 5, true))
{
 SendClientMessage(playerid, color, strtolower(text));
 return 1;
}
Reply
#9

Why is it wrong?
Reply
#10

PS: i mean all text if i type CAPS LOCK text then it will be small
Reply
#11

OnPlayerCommandText(..)
{
SendClientMessageToAll(color, strtolower(text);
return 0;
}
Reply
#12

Quote:
Originally Posted by Wadabak
OnPlayerCommandText(..)
{
SendClientMessageToAll(color, strtolower(text);
return 0;
}
Код:
error 017: undefined symbol "strtolower"
Reply
#13

I mean tolower(text);
Reply
#14

If i add this in OnPlayerText SendPlayerMessageToAll(playerid,tolower(text));
then it say:
error 035: argument type mismatch (argument 1)
Reply
#15

Quote:
Originally Posted by Hamptonin
If i add this in OnPlayerText SendPlayerMessageToAll(playerid,tolower(text));
then it say:
error 035: argument type mismatch (argument 1)
It's your own fault.
SendPlayerMessageToAll(playerid,tolower(text)); doesn't contain the playerid, it's for all.
Read in samp wiki how this function is working.
Reply
#16

http://forum.sa-mp.com/index.php?topic=42842.0
Reply
#17

Thanks jeff
pawn Код:
#define UpperToLower(%1) for ( new ToLowerChar; ToLowerChar < strlen( %1 ); ToLowerChar ++ ) if ( %1[ ToLowerChar ] > 64 && %1[ ToLowerChar ] < 91 ) %1[ ToLowerChar ] += 32
Reply
#18

Quote:
Originally Posted by -=[Serbish
=- ]
Quote:
Originally Posted by Hamptonin
If i add this in OnPlayerText SendPlayerMessageToAll(playerid,tolower(text));
then it say:
error 035: argument type mismatch (argument 1)
It's your own fault.
SendPlayerMessageToAll(playerid,tolower(text)); doesn't contain the playerid, it's for all.
Read in samp wiki how this function is working.
Your wrong you mean
Код:
SendClientMessageToAll( color, msg[] );
The one he posted is something different
Код:
SendPlayerMessageToAll( senderid, const message[] );
Reply
#19

Quote:
Originally Posted by -=[Serbish
=- ]
Quote:
Originally Posted by Hamptonin
If i add this in OnPlayerText SendPlayerMessageToAll(playerid,tolower(text));
then it say:
error 035: argument type mismatch (argument 1)
It's your own fault.
SendPlayerMessageToAll(playerid,tolower(text)); doesn't contain the playerid, it's for all.
Read in samp wiki how this function is working.
I think you must read in wiki

it send a message the playerid = the senderid the player who send the message
Reply
#20

Ahh, I didn't saw the Send"Player"MessageToAll.
Was to fast.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)