Help me guys
#5

Quote:

dcmd_setname(playerid,params[])
{
if(AccInfo[playerid][Level] >= 3 || IsPlayerAdmin(playerid))
{
new Index;
new tmp[256]; tmp = strtok(params,Index);
new tmp2[256]; tmp2 = strtok(params,Index);
if(!strlen(tmp) || !strlen(tmp2)) return
SendClientMessage(playerid, LIGHTBLUE2, "Usage: /setname [PlayerID] [NewName]") &&
SendClientMessage(playerid, orange, "Function: Will set Name of specified player!");
new player1 = strval(tmp);
new length = strlen(tmp2);
new string[128];
if(length < 3 || length > MAX_PLAYER_NAME) return
SendClientMessage(playerid,red,"ERROR: Incorrect Name Length");
if(AccInfo[player1][Level] == ServerInfo[MaxAdminLevel] && AccInfo[playerid][Level] != ServerInfo[MaxAdminLevel])
return SendClientMessage(playerid,red,"ERROR: You cannot use this command on this admin");
if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
{
SendCommandToAdmins(playerid,"SetName");
format(string, sizeof(string), " You have set \"%s's\" Name to \"%s\" ", pName(player1), tmp2);
SendClientMessage(playerid,BlueMsg,string);
if(player1 != playerid)
{
format(string,sizeof(string),"- Administrator \"%s\" has set your Name to \"%s\" -|", pName(playerid), tmp2);
SendClientMessage(player1,blue,string);
}
SetPlayerName(player1, tmp2);
return OnPlayerConnect(player1);
}
else return ErrorMessages(playerid, 2);
}
else return ErrorMessages(playerid, 1);
}

gimme star:P
__________________________________________________ _______________________________
High Voltage Drift
www.highvoltage-drift.tk
Reply


Messages In This Thread
Help me guys - by kevinhbk1 - 24.12.2011, 06:15
Re: Help me guys - by kevinhbk1 - 24.12.2011, 10:02
Re: Help me guys - by linuxthefish - 24.12.2011, 10:24
Re: Help me guys - by §с†¶e®РµРe - 24.12.2011, 11:14
Re: Help me guys - by ProdrifterX - 24.12.2011, 11:39
Re: Help me guys - by kevinhbk1 - 24.12.2011, 11:41
Re: Help me guys - by Thresholdold - 24.12.2011, 11:43
Re: Help me guys - by kevinhbk1 - 24.12.2011, 11:44
Re: Help me guys - by suhrab_mujeeb - 24.12.2011, 11:46
Re: Help me guys - by kevinhbk1 - 24.12.2011, 11:49

Forum Jump:


Users browsing this thread: 1 Guest(s)