26.12.2012, 11:09
1. Yes
2. Yes
np!
Ach, grapje maar..
heres the code for changename:
Adjust it to ZCMD if u don't use dcmd.
this code should be placed under OnPlayerspawn, afaik.
This will hide the nametags of a player.
using
will set everyone's text & nametag color to white
now at
use an if check to see whether it was a success, if so set the player's color to red.
do notice that theres no playerid parameter on that callback, so you will have to find every player's ID on OnPlayerConnect, compare that to the one that logged in succesfully and set the color that way
or use a timer with a delay of 1 or more seconds that checks if 'IsPlayerAdmin(playerid)' is true, then set his color.
Vele wegen leiden naar Rome.
Merry Christmas!
2. Yes
np!
Ach, grapje maar..
heres the code for changename:
pawn Код:
dcmd_changename(playerid,params[])
{
new player,newname[MAX_PLAYER_NAME],string[128],playername[MAX_PLAYER_NAME];
if(!IsPlayerAdmin(playerid)) return 0;//SendClientMessage(playerid, COLOR_RED, "[System] You must be an admin!");
if(sscanf(params, "us", player,newname)) return SendClientMessage(playerid, COLOR_RED, "[System] Usage: /changename [id/part of name] [name] ");
if(!IsPlayerConnected(player)) return SendClientMessage(playerid,COLOR_RED,"[System] Invalid player or player is not connected.");
if(strlen(newname) > 16) return SendClientMessage(playerid,COLOR_RED,"[System] Not allowed to have more than 16 characters in the name.");
GetPlayerName(player,playername,sizeof(playername));
SetPlayerName(player,newname);
format(string,128,"You have changed %s's name into %s",playername,newname);
SendClientMessage(playerid,COLOR_YELLOW,string);
return 1;
}
pawn Код:
dcmd(changename,10,cmdtext);
pawn Код:
for(new i = 0; i < GetMaxPlayers(); i++)
{
if(IsPlayerConnected(i))
{
ShowPlayerNameTagForPlayer(playerid, i, 0);
ShowPlayerNameTagForPlayer(i,playerid, 0);
}
}
This will hide the nametags of a player.
using
pawn Код:
SetPlayerColor(playerid,-1);
now at
pawn Код:
public OnRconLoginAttempt(ip[], password[], success)
do notice that theres no playerid parameter on that callback, so you will have to find every player's ID on OnPlayerConnect, compare that to the one that logged in succesfully and set the color that way
or use a timer with a delay of 1 or more seconds that checks if 'IsPlayerAdmin(playerid)' is true, then set his color.
Vele wegen leiden naar Rome.
Merry Christmas!