[FilterScript] A command to rename a player.
#1

Good evening one and all.

This code is not difficult, but I would still like to share, it can still be used for other players.

You will need includes ZCMD, sscanf2, can be downloaded on the net.

The code :

pawn Code:
// ENUM
enum pinfo
{
  admin,
  adminduty
};
new PlayerInfo[MAX_PLAYERS][pinfo];

// CMD

CMD:rename(playerid, params[])
{
  if(PlayerInfo[playerid][admin] >= 1)
  {
     new giveplayerid, nom[128], string[128], string1[128];
     if(PlayerInfo[playerid][adminduty] == 0) { return SendClientMessage(playerid, 0xFFEE0010AA, "You are not in /duty."); }
     if(sscanf(params, "us", giveplayerid, nom)) { return SendClientMessage(playerid, 0xFF4BB5C1AA, "/rename [playerid] [New_Name]"); }
     if(!IsPlayerConnected(giveplayerid)) { return SendClientMessage(playerid, 0xFFEE0010AA, "Player not connected."); }
     format(string, sizeof(string), "Admin %s you rename in: %s.", PlayerName(playerid), nom);
     SendClientMessage(giveplayerid, 0xFFEE0010AA, string);
     format(string1, sizeof(string1), "AdminWarning: %s a rename %s in %s", PlayerName(playerid), PlayerName(giveplayerid), nom);
     SendAdminMessage(string1);
     SetPlayerName(giveplayerid, nom);
     
  }
  else
  {
     SendClientMessage(playerid, 0xFFEE0010AA, "You are not a member of Administration.");
  }
  return 1;
}

// STOCK

stock SendAdminMessage(message[])
{
    for(new i = 0; i < MAX_PLAYERS; i++)
    {
        if(PlayerInfo[i][admin] && PlayerInfo[i][adminduty] >= 1)
        {
            SendClientMessage(i, 0xFFFF5214AA, message);
        }
        else return 0;
    }
    return 1;
}

stock PlayerName(playerid)
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid, name, sizeof(name));
    mysql_real_escape_string(name, name);
    return name;
}
If you have any questions, do not hesitate!
Reply
#2

Clearly copied from another scrip. Someone delete this shit
Reply
#3

This section is not for copy&pasting codes,this is for releasing Filterscripts,not snippets from gamemodes that you have either downloaded or just made for the hell of it,please either turn this into a filterscript code or move it into a tutorial on how to make a /changename command.
Reply
#4

It is not the copy / paste is done in French (my language) and translate.

I clearly stated that it is not hard to do.
Reply
#5

Quote:
Originally Posted by BrendaSAMP
View Post
It is not the copy / paste is done in French (my language) and translate.

I clearly stated that it is not hard to do.
Well,it could of also been quite easily added into a filterscript aswell,not just a plain copy n paste into a post,because you could of just shared it in script help on one of the post's there,because I seen someone looking for help about /changename command.
Reply
#6

lol the guy want and high reputation xd
Reply
#7

Someone is hungry for reputation points
Reply
#8

Either you make something yourself or don't just copy-paste.
Reply
#9

dont get this .. ?:S how will it change the name of the person if the players folder not selected ? is that possible,? can someone explain it to me .. .
Reply
#10

This is clearly copied from another script, if it wasn't it wouldn't lack the command for admin duty and also the admin levels. You could've made it with rcon instead of copy-pasting and proving that it's not your code.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)