Need help for Chat commands
#1

who can help me for this scripts

to have this commands

Chat Commands

* KennJie - Sends A Action Message You Type In The Chat Window
/pm [Nick/ID] - Sends A Private Message To The Player You Want To Privately Talk With
/nopm - Toggles Private Messaging On/Off
/pmon - Turns Private Messaging On
/pmoff - Turns Private Messaging Off
/w - Whispers To Players Who Are Near You
/cw - Vehicle Whisper To Players Who Are In The Car With You Only
/ignore [Nick/ID] - Allows You To Ignore/Unignore A Certain Player (Currently Unavailable)
/do - Will Display Your Text Like This (( Text ))
/calle - Will Display A Message To Players Who Are Close To You To Get In Your Car
/coverme - Will Display A Message To Players Who Are Close To You To Cover You


advance thank u
Reply
#2

For PM on and off,

pawn Код:
CMD:pm(playerid, params[])
{
    new str[128], target, pName[MAX_PLAYER_NAME],targetname[MAX_PLAYER_NAME];
    if(sscanf(params, "us[50]",target, str)) return SendClientMessage(playerid, 0xFFFF00AA, "SERVER:/pm [ID] [Text]");
    if(!IsPlayerConnected(target)) return SendClientMessage(playerid, 0xFFFF00AA, "SERVER:The player you're trying to PM is offline.");
    if(nopms == 0)
    {
        SendClientMessage(playerid, -1, "SERVER: The PM System is disabled!");
    }
    else if(nopms == 1)
    {
        new string[128];
        GetPlayerName(target, targetname, sizeof(targetname));
        GetPlayerName(playerid, pName, sizeof(pName));
        format(string, 128, "((PM from %s: %s))", pName, str);
        SendClientMessage(target, 0xFFFF00AA, string);
        format(string, 128, "((PM to %s: %s))", targetname, str);
        SendClientMessage(playerid,0xFFFF00AA, string);
    }
    return 1;
}

CMD:nopms(playerid, params[])
{
    new str[128];
    if(Player[playerid][Admin] <= 5) return SendClientMessage(playerid, -1, "SERVER: You're not a high enough level!");
    if(nopms == 0)
    {
        format(str, 128, "SERVER: The PM System has been enabled!");
        SendClientMessageToAll(-1,str);
        nopms = 1;
    }
    else if(nopms == 1)
    {
        format(str, 128, "SERVER: The PM System has been disabled!");
        SendClientMessageToAll(-1,str);
        nopms = 0;
    }
    return 1;
}
Make sure you put this at the top of your script

pawn Код:
new nopms = 0;
I'll edit it and add some more commands when i'm done scripting them.

----------------------------------------------------------------------------------

Here is the /me and /do.

pawn Код:
CMD:do(playerid, params[])
{
    new string[128], text, pName[MAX_PLAYER_NAME];
    GetPlayerName(playerid, pName, sizeof(pName));
    if(sscanf(params, "s", text))
    {
        SendClientMessage(playerid, -1, "USAGE: /do [text]");
        return 1;
    }
    else
    {
        format(string, sizeof(string), "* %s (( %s ))", text, pName);
        ProxDetector(30, playerid, string, GREY);
    }
    return 1;
}
pawn Код:
CMD:me(playerid, params[])
{
    new str[128], pName[MAX_PLAYER_NAME], text;
    GetPlayerName(playerid, pName, sizeof(pName));
    if(sscanf(params, "s",text)) return SendClientMessage(playerid, -1, "USAGE:/me [Text]");
    format(str,128,"%s %s",pName,text);
    ProxDetector(30, playerid, str, GREY);
    return 1;
}
You'll need to add this aswell. It makes it so if the player is a certain distance away they can't see it.

pawn Код:
stock ProxDetector(Float:radi, playerid, string[],color)
{
    new Float:x,Float:y,Float:z;
    GetPlayerPos(playerid,x,y,z);
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(IsPlayerInRangeOfPoint(i,radi,x,y,z))
        {
            SendClientMessage(i,color,string);
        }
    }
}
Reply
#3

That is the right /command dude?

btw thanks i gonna try this
Reply
#4

Quote:
Originally Posted by Keyhead
Посмотреть сообщение
For PM on and off,

pawn Код:
CMD:pm(playerid, params[])
{
    new str[128], target, pName[MAX_PLAYER_NAME],targetname[MAX_PLAYER_NAME];
    if(sscanf(params, "us[50]",target, str)) return SendClientMessage(playerid, 0xFFFF00AA, "SERVER:/pm [ID] [Text]");
    if(!IsPlayerConnected(target)) return SendClientMessage(playerid, 0xFFFF00AA, "SERVER:The player you're trying to PM is offline.");
    if(nopms == 0)
    {
        SendClientMessage(playerid, -1, "SERVER: The PM System is disabled!");
    }
    else if(nopms == 1)
    {
        new string[128];
        GetPlayerName(target, targetname, sizeof(targetname));
        GetPlayerName(playerid, pName, sizeof(pName));
        format(string, 128, "((PM from %s: %s))", pName, str);
        SendClientMessage(target, 0xFFFF00AA, string);
        format(string, 128, "((PM to %s: %s))", targetname, str);
        SendClientMessage(playerid,0xFFFF00AA, string);
    }
    return 1;
}

CMD:nopms(playerid, params[])
{
    new str[128];
    if(Player[playerid][Admin] <= 5) return SendClientMessage(playerid, -1, "SERVER: You're not a high enough level!");
    if(nopms == 0)
    {
        format(str, 128, "SERVER: The PM System has been enabled!");
        SendClientMessageToAll(-1,str);
        nopms = 1;
    }
    else if(nopms == 1)
    {
        format(str, 128, "SERVER: The PM System has been disabled!");
        SendClientMessageToAll(-1,str);
        nopms = 0;
    }
    return 1;
}
Make sure you put this at the top of your script

pawn Код:
new nopms = 0;
I'll edit it and add some more commands when i'm done scripting them.
Won't work per-player. If the variable is 0, no one in the whole server's gonna be able to get PMs. You need to make nopms a MAX_PLAYER array.
Reply
#5

@Rajat, It's toggleable. It works fine.
Reply
#6

guys can u give me the all scipts that i list on top help me guys Thanks
Reply
#7

Use the search button, this aren't an script request section.

Get it or get reported.
Reply
#8

@Kenji I added two more.
Reply
#9

pawn Код:
CMD:w(playerid, params[])
{
    new pName[MAX_PLAYER_NAME], targetid, TargetName[MAX_PLAYER_NAME],str[128], text, Float:x,Float:y,Float:z;
    GetPlayerPos(playerid, x,y,z);
    GetPlayerName(playerid, pName, sizeof(pName));
    GetPlayerName(targetid, TargetName, sizeof(TargetName));
    if(sscanf(params, "us", targetid, text)) return SendClientMessage(playerid, -1, "USAGE:/w [ID] [Text]");
    if(!IsPlayerInRangeOfPoint(playerid, 3.0, x,y,z)) return SendClientMessage(playerid, -1, "NOTICE: You're not near that person!");
    format(str, 128, "(([%d] - %s: %s))",playerid, pName, text);
    SendClientMessage(targetid, YELLOW, str);
    format(str,128, "(( PM Sent to %s - [%d]))", TargetName, targetid);
    SendClientMessage(playerid, YELLOW, str);
    return 1;
}
Reply
#10

i need that all commands guys can u help me
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)