SA-MP Forums Archive
I don't know if this is possible - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: I don't know if this is possible (/showthread.php?tid=61988)

Pages: 1 2


I don't know if this is possible - hamptonin - 17.01.2009

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




Re: I don't know if this is possible - afei - 17.01.2009

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


Re: I don't know if this is possible - hamptonin - 17.01.2009

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


Re: I don't know if this is possible - Antironix - 17.01.2009

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


Re: I don't know if this is possible - hamptonin - 17.01.2009

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


Re: I don't know if this is possible - Antironix - 17.01.2009


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

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



Re: I don't know if this is possible - Serbish - 17.01.2009

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;
}



Re: I don't know if this is possible - hamptonin - 17.01.2009

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;
}



Re: I don't know if this is possible - Antironix - 17.01.2009

Why is it wrong?


Re: I don't know if this is possible - hamptonin - 17.01.2009

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


Re: I don't know if this is possible - Antironix - 17.01.2009

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


Re: I don't know if this is possible - hamptonin - 17.01.2009

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



Re: I don't know if this is possible - Antironix - 17.01.2009

I mean tolower(text);


Re: I don't know if this is possible - hamptonin - 17.01.2009

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


Re: I don't know if this is possible - Serbish - 17.01.2009

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.


Re: I don't know if this is possible - Jefff - 17.01.2009

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


Re: I don't know if this is possible - hamptonin - 17.01.2009

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



Re: I don't know if this is possible - afei - 17.01.2009

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[] );



Re: I don't know if this is possible - hamptonin - 17.01.2009

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


Re: I don't know if this is possible - Serbish - 17.01.2009

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