fake someones name
#1

This command is supposed to fake someones name with a message, but it doesnt work.

What i want is the players name color, then the message in white.
The problem : It now uses the whole message his name color, and if i do

/acfake 0 test

It will say: Eros: TEros

Please help me, this is my code

pawn Код:
dcmd_acfake(playerid, params[])
{
    new player, color;
    new name[MAX_PLAYER_NAME+1];
    new text;
    new string[128];
   
    if(!sscanf(params, "ds", player, text))
    {
        GetPlayerName(player, name, sizeof(name));
      color = GetPlayerColor(GetPlayerID(name));
      format(string, sizeof(string), "%s : %s", name, text);
      SendClientMessageToAll(color, string);
    }
   
    return 1;
}

Thnx
Reply
#2

There's a filterscript of this, search.
Reply
#3

pawn Код:
dcmd_acfake(playerid, params[])
{
    new id;
    if(sscanf(params, "ds", id, params))
        return SendClientMessage(playerid, 0xFFFFFFAA, "Right Usage: /acfake [id][text]");
    else    return SendPlayerMessageToAll(id, params);
}
Reply
#4

pawn Код:
dcmd_acfake(playerid, params[])
{
    if(sscanf(params, "ds", id, params)) return SendClientMessage(playerid, 0xFFFFFFAA, "Right Usage: /acfake [id][text]");
    else if(!IsPlayerConnected(id)) return SendClientMessage(playerid, 0xFFFFFFAA, "No such player");
    else return SendPlayerMessageToAll(id, params);
}
Reply
#5

pawn Код:
dcmd_acfake(playerid, params[])
{
    new id = INVALID_PLAYER_ID;
    if(sscanf(params, "us", id, params)) return SendClientMessage(playerid, 0xFFFFFFAA, "Right Usage: /acfake [id][text]");
    if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, 0xFFFFFFAA, "Warning: Invalid player!");
    return SendPlayerMessageToAll(id, params);
}
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)