SA-MP Forums Archive
fake someones name - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: fake someones name (/showthread.php?tid=75032)



fake someones name - Robbin237 - 28.04.2009

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



Re: fake someones name - MenaceX^ - 28.04.2009

There's a filterscript of this, search.


Re: fake someones name - Nero_3D - 28.04.2009

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);
}



Re: fake someones name - Pyrokid - 29.04.2009

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);
}



Re: fake someones name - Nero_3D - 29.04.2009

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);
}