[Ajuda] Comando /MudarNick
#6

Код:
	if(strcmp(cmd, "/mudarnick", true) == 0)
	{
	    GetPlayerName(playerid, sendername, sizeof(sendername));
	    PlayerInfo[playerid][pAdmin] = dini_Int(udb_encode(sendername), "leveladm");
		new tmpp[256];
		tmpp = strtok(cmdtext, idx);
		if(!strlen(tmpp))
		{
			SendClientMessage(playerid, COLOR_GREEN, "Uso correto: /mudarnick [id do player] [novo nick]");
			return 1;
		}
		giveplayerid = strval(tmpp);
		tmp = strtok(cmdtext, idx);
		GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
		GetPlayerName(playerid, sendername, sizeof(sendername));
		if(logado[playerid] == 1)
		{
		    if(PlayerInfo[playerid][pAdmin] >= 3)
		    {
		        if(IsPlayerConnected(giveplayerid))
		        {
					format(string, sizeof(string), "* ADMIN: Vocк mudou o nick de %s(%i) para %s", giveplayerid, tmp);
					SendClientMessage(playerid, COLOR_ADM, string);
					SetPlayerName(giveplayerid, tmp);
				}
				else
				{
				    format(string, sizeof(string), "%d nгo й um player ativo!", giveplayerid);
					SendClientMessage(playerid, COLOR_CYAN, string);
				}
			}
			else
			{
			    SendClientMessage(playerid, COLOR_CYAN, "Vocк nгo tem permissгo para usar este comando!");
			}
		}
		else
		{
		    SendClientMessage(playerid, COLOR_CYAN, "Vocк tem que estar logado para usar este comando!");
		}
	  	return 1;
  	}
Reply


Messages In This Thread
Comando /MudarNick - by Gabriel Santana - 29.07.2012, 15:57
Re: Comando /MudarNick - by humildadeforever - 29.07.2012, 16:04
Re: Comando /MudarNick - by Lуs - 29.07.2012, 16:11
Re: Comando /MudarNick - by Gabriel Santana - 29.07.2012, 16:13
Re: Comando /MudarNick - by Gabriel Santana - 29.07.2012, 16:15
Re: Comando /MudarNick - by DanDRT - 29.07.2012, 16:45

Forum Jump:


Users browsing this thread: 1 Guest(s)