A error
#1

I'm making this :

pawn Код:
if(!strcmp(cmdtext, "/me", true, 3)) //action use /me [action]
    {
        if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "Use: /me [action]");
        new pname[24], str[128];
        GetPlayerName(playerid, pname, 24);
        format(str, sizeof(str), "%s Does: %s", pname, text);
        ProxDetector(10.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
        return 1;
    }
for my zombie RP server, but I got this error:

pawn Код:
C:\Users\Marino Varesio\Desktop\zombie outbreak\gamemodes\Zombie_Outbreak_Original.pwn(1680) : error 017: undefined symbol "text"
Pawn compiler 3.2.3664          Copyright (c) 1997-2006, ITB CompuPhase


1 Error.
Reply
#2

pawn Код:
if(!strcmp(cmdtext, "/me", true, 3)) //action use /me [action]
{
    if(!cmdtext[3])return SendClientMessage(playerid, 0xFF0000FF, "Use: /me [action]");
    new pname[24], str[128];
    GetPlayerName(playerid, pname, 24);
    format(str, sizeof(str), "%s Does: %s", pname, cmdtext); // faggot
    ProxDetector(10.0, playerid, str, COLOR_FADE1, COLOR_FADE2, COLOR_FADE3, COLOR_FADE4, COLOR_FADE5);
    return 1;
}
Reply
#3

weird, I have another command that text works just fine =/
Reply
#4

now it appears New_Player Does: /me bla =/
Reply
#5

From the wiki

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me
    {
        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]);
        SendClientMessageToAll(0xFFFF00AA, str);
        return 1;
    }
    return 0;
}
Reply
#6

Код:
  if(!strcmp(cmdtext, "/me ", true, 3))
    {
        if(logged[playerid] == 0) return SendClientMessage(playerid, 0x0000A0AA, "You cannot use commands because you are not logged in.");
        else
        if(logged[playerid] == -2) return SendClientMessage(playerid, 0x0000A0AA, "You cannot use commands because you are jailed.");
        else
        if(!cmdtext[3])return SendClientMessage(playerid, 0x0000BBAA, "USAGE: /me [action]");
        new str[128];
        GetPlayerName(playerid, str, sizeof(str));
        format(str, sizeof(str), "**%s %s", str, cmdtext[4]);
        SendClientMessageToAll(GetPlayerColor(playerid), str);
        return 1;
    }
here no error
Reply
#7

marinov, again making double posts? there is a edit button.
Now i personally suggest using ZMCD or YCMD, both are easier to use, faster. etc.
i personally dislike strcmp.
and yes, will's post is correct.
Again, there is a wiki for something.
Reply
#8

Quote:
Originally Posted by willsuckformoney
Посмотреть сообщение
From the wiki

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
    if(!strcmp(cmdtext, "/me", true, 3)) // 3 is the length of /me
    {
        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]);
        SendClientMessageToAll(0xFFFF00AA, str);
        return 1;
    }
    return 0;
}
wrong because I don't want it to send message to all, I want it to send messages only for the people near the player
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)