/me isn't working
#1

pawn Код:
if(strcmp(cmd, "/me", true) == 0)
    {
        if(IsLogged[playerid] == 1)
        {
            new pname[24], str[128];
            GetPlayerName(playerid, pname, 24);

            if(PlayerInfo[playerid][MaskOn] == 1)
            {
                format(str, sizeof(str), "Stranger %s", str);
            }
            else
            {
                format(str, sizeof(str), "%s %s", pname, str);
            }

            ProxDetector(10.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
        }
        else
        {
            SendClientMessage(playerid, COLOR_ERRORRED, "SERVER: You need to be logged in to use this command!");
        }
    }
It just displays their name or "stranger", no second part.
Reply
#2

Are you using Strtok?
Reply
#3

Try this:

Код:
if(strcmp(cmd, "/me", true) == 1)
    {
        if(IsLogged[playerid] == 1)
        {
            new pname[24], str[128];
            GetPlayerName(playerid, pname, 24);

            if(PlayerInfo[playerid][MaskOn] == 1)
            {
                format(str, sizeof(str), "Stranger %s", str);
            }
            else
            {
                format(str, sizeof(str), "%s %s", pname, str);
            }

            ProxDetector(10.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
        }
        else
        {
            SendClientMessage(playerid, COLOR_ERRORRED, "SERVER: You need to be logged in to use this command!");
        }
    }
Reply
#4

pawn Код:
if(!strcmp(cmdtext, "/me", true, 3))
{
    if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [ACTION]");
    new str[128];
    GetPlayerName(playerid, str, sizeof(str));
    format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    for(new i=0; i<MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(IsPlayerInRangeOfPoint(i, 40.0, x, y, z))
    {
    SendClientMessage(i, COLOR_LIME, str);
    }
    }
    }
    return 1;
    }
Try my code
Reply
#5

Quote:
Originally Posted by Naruto_Emilio
Посмотреть сообщение
pawn Код:
if(!strcmp(cmdtext, "/me", true, 3))
{
    if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [ACTION]");
    new str[128];
    GetPlayerName(playerid, str, sizeof(str));
    format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    for(new i=0; i<MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(IsPlayerInRangeOfPoint(i, 40.0, x, y, z))
    {
    SendClientMessage(i, COLOR_LIME, str);
    }
    }
    }
    return 1;
    }
Try my code
You copied that off a admin script, witch needs Includes.
Reply
#6

Quote:
Originally Posted by Naruto_Emilio
Посмотреть сообщение
pawn Код:
if(!strcmp(cmdtext, "/me", true, 3))
{
    if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "USAGE: /me [ACTION]");
    new str[128];
    GetPlayerName(playerid, str, sizeof(str));
    format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
    new Float:x, Float:y, Float:z;
    GetPlayerPos(playerid, x, y, z);
    for(new i=0; i<MAX_PLAYERS; i++)
    {
    if(IsPlayerConnected(i))
    {
    if(IsPlayerInRangeOfPoint(i, 40.0, x, y, z))
    {
    SendClientMessage(i, COLOR_LIME, str);
    }
    }
    }
    return 1;
    }
Try my code
Thanks matey. Do you have msn by any chance? I'm pushing a big project.
Reply
#7

Quote:
Originally Posted by lowrida018
Посмотреть сообщение
You copied that off a admin script, witch needs Includes.
I rewrote it any way, to look like this:

pawn Код:
if(!strcmp(cmdtext, "/me", true, 3))
    {
        if(!cmdtext[3])return SendClientMessage(playerid, COLOR_ERRORRED, "USAGE: /me [ACTION]");
       
        new str[128];
        GetPlayerName(playerid, str, sizeof(str));
       
        if(PlayerInfo[playerid][MaskOn] == 1)
        {
                format(str, sizeof(str), "* Stranger %s", cmdtext[4]);
        }
        else
        {
                format(str, sizeof(str), "* %s %s", str, cmdtext[4]);
        }
       
        ProxDetector(10.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);

        return 1;
    }
Does anyone have that purple colour that most servers use in /me?
Reply
#8

Yes lemme pm it to you
Reply
#9

Quote:
Originally Posted by Jonteh
Посмотреть сообщение
Thanks matey. Do you have msn by any chance? I'm pushing a big project.
I can help with it.
Reply
#10

Quote:
Originally Posted by lowrida018
Посмотреть сообщение
I can help with it.
Sounds good. My MSN is jontycat@zaphotel.net
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)