SA-MP Forums Archive
/r Chat - 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: /r Chat (/showthread.php?tid=311048)



/r Chat - Davman - 14.01.2012

Hello, I would like to develop the command /r.
In my gamemode there are no other team it would be a sort of Global Chat a simple command like.
/r TEXT

I do not know how to get started


Re: /r Chat - iGetty - 14.01.2012

So a global chat?

Here:

pawn Код:
command(r, playerid, params[])
{
    new message[128], string[256], pName[24];
    GetPlayerName(playerid, pName, 24);
    if(sscanf(params, "s", message)) return SendClientMessage(playerid, GREY, "Server: /r(adio) [text]");
    {
        format(string, sizeof(string), "[Radio] %s says: %s", pName, message);
        SendClientMessageToAll(GREY, string);
    }
    return 1;
}
Try that.


Re: /r Chat - Scenario - 14.01.2012

I see another tsunami of n00bs has arrived!

https://sampwiki.blast.hk/wiki/Scripting...tarting_out.21


Re: /r Chat - Davman - 14.01.2012

Quote:
Originally Posted by RealCop228
Посмотреть сообщение
I see another tsunami of n00bs has arrived!

https://sampwiki.blast.hk/wiki/Scripting...tarting_out.21
I invite you to moderate, thanks noob.


Re: /r Chat - iGetty - 14.01.2012

Haha RealCop, we all start somewhere, don't we?


Re: /r Chat - Davman - 14.01.2012

Quote:
Originally Posted by iGetty
Посмотреть сообщение
So a global chat?

Here:

pawn Код:
command(r, playerid, params[])
{
    new message[128], string[256], pName[24];
    GetPlayerName(playerid, pName, 24);
    if(sscanf(params, "s", message)) return SendClientMessage(playerid, GREY, "Server: /r(adio) [text]");
    {
        format(string, sizeof(string), "[Radio] %s says: %s", pName, message);
        SendClientMessageToAll(GREY, string);
    }
    return 1;
}
Try that.
Please, no zcmd


Re: /r Chat - iGetty - 14.01.2012

What do you need it in? strcmp?


Re: /r Chat - Davman - 14.01.2012

Quote:
Originally Posted by iGetty
Посмотреть сообщение
What do you need it in? strcmp?
Yes, thanks.
Sorry


Re: /r Chat - vincee - 14.01.2012

ZCMD is easier, much easier, strcmp causes soooo much shit and its slow.



edit, shit wrong code.



gotta troll.




Re: /r Chat - Steven82 - 14.01.2012

Quote:
Originally Posted by Davman
Посмотреть сообщение
Yes, thanks.
Sorry
First things first. Always better to start out knowing how to use ZCMD and SSCANF. I didn't know how, but when i learned how i was shocked how much easier commands were to make. And you might also want to learn Y_INI over dini. And MySQL or SQLite wouldn't be a bad thing to know either. Just some useful tips.