24.12.2011, 11:39
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); } |
__________________________________________________ _______________________________
High Voltage Drift
www.highvoltage-drift.tk