/r Chat
#1

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
Reply
#2

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.
Reply
#3

I see another tsunami of n00bs has arrived!

https://sampwiki.blast.hk/wiki/Scripting...tarting_out.21
Reply
#4

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.
Reply
#5

Haha RealCop, we all start somewhere, don't we?
Reply
#6

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
Reply
#7

What do you need it in? strcmp?
Reply
#8

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

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



edit, shit wrong code.



gotta troll.

Reply
#10

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.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)