SA-MP Forums Archive
Question? - 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)
+--- Thread: Question? (/showthread.php?tid=313358)



Question? - seanny - 25.01.2012

Hello,

How do I make a system where it shows the message a player sent, For example:

I said: Hello
then I said: LOL

How can I get it to show message one?

Sorry if I explained it badly, I am trying to make an RP Quiz like PR-RP.


Re: Question? - Snowman12 - 25.01.2012

not 100% sure what your on about however this is my attempt at a RP quiz:

pawn Код:
new string[50];
format(string,sizeof(string),"What is rawr?");
SendClientMessage(playerid,-1,"Rawr");
if(!strcmp(string,"rawr",true);
{
Kick(playerid);
}
Have no idea if it will work or not but meh


Re: Question? - [XST]O_x - 25.01.2012

Quote:
Originally Posted by Snowman12
Посмотреть сообщение
not 100% sure what your on about however this is my attempt at a RP quiz:

pawn Код:
new string[50];
format(string,sizeof(string),"What is rawr?");
SendClientMessage(playerid,-1,"Rawr");
if(!strcmp(string,"rawr",true);
{
Kick(playerid);
}
Have no idea if it will work or not but meh
Why using a string for this?

And I don't understand what the author trys to do, can you explain again?


Re: Question? - seanny - 25.01.2012

Quote:
Originally Posted by [XST]O_x
Посмотреть сообщение
Why using a string for this?

And I don't understand what the author trys to do, can you explain again?
I am trying to make a system where it shows a message,

Example:

message 1: lol123
message 2: 123lol

I need a system where it shows the message 1


Re: Question? - milanosie - 25.01.2012

I think u mean logs. for admins. Am I right?

if so, make a Folder Called Logs in your scriptfile
then just use your method of file writing at OnPlayerText


Re: Question? - Unte99 - 25.01.2012

Hard time understanding, lol.


Today I'm too lazy to explain, so here:


pawn Код:
new count=-1;
public OnPlayerText(playerid, text[])
{
    new message[180],playername[MAX_PLAYER_NAME];
    GetPlayerName(playerid, playername, sizeof(playername));
    count+=1;
    if(count==0)
    {
        format(message,sizeof(message),"%s says: %s", playername, text);
        SendClientMessageToAll(yourcolor, message);
        return 0;
    }
    if(count==1)
    {
        format(message,sizeof(message),"%s then says: %s", playername, text);
        SendClientMessageToAll(yourcolor, message);
        return 0;
    }
    if(count==2)
    {
        format(message,sizeof(message),"%s chit chats: %s", playername, text);
        SendClientMessageToAll(yourcolor, message);
        return 0;
    }
    if(count==3)
    {
        format(message,sizeof(message),"%s says while pukeing: %s", playername, text);
        SendClientMessageToAll(yourcolor, message);
        return 0;
    }
    if(count==4)
    {
        format(message,sizeof(message),"%s responds: %s", playername, text);
        SendClientMessageToAll(yourcolor, message);
        return 0;
    }
    if(count==5)
    {
        format(message,sizeof(message),"%s wonders: %s", playername, text);
        SendClientMessageToAll(yourcolor, message);
        count=-1;
        return 0;
    }
    return 1;
}
It could be done more carefully, i did it like simple.