help for /name command
#9

try this

Код:
if(strcmp(cmd, "/nickname", true) ==0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			GetPlayerName(playerid, sendername, sizeof(sendername));
			new length = strlen(cmdtext);
			while ((idx < length) && (cmdtext[idx] <= ' '))
			{
				idx++;
			}
			new offset = idx;
			new result[64];
			while ((idx < length) && ((idx - offset) < (sizeof(result) - 1)))
			{
				result[idx - offset] = cmdtext[idx];
				idx++;
			}
			result[idx - offset] = EOS;
			if(!strlen(result))
			{
				SendClientMessage(playerid, color_dgreen, "Server_CommandCheck: /nickname [name]");
				SendClientMessage(playerid, color_dgreen, "Server_CommandCheck: This name will be what others see you as.");
				return 1;
			}
			SetPlayerName(playerid, result);
			OnPlayerUpdate(playerid);

    	format(str, sizeof(str), "Your nickname has been set to '%s'", result);
    	SendClientMessage(playerid, color_white, str);
			return 1;
	  }
	  return 1;
	}
Reply


Messages In This Thread
help for /name command - by [GF]sIdEkIcK - 12.07.2009, 14:02
Re: help for /name command - by BLACK-RIDER-1692 - 12.07.2009, 14:04
Re: help for /name command - by [GF]sIdEkIcK - 12.07.2009, 14:13
Re: help for /name command - by BLACK-RIDER-1692 - 12.07.2009, 14:14
Re: help for /name command - by [GF]sIdEkIcK - 12.07.2009, 14:20
Re: help for /name command - by BLACK-RIDER-1692 - 12.07.2009, 14:23
Re: help for /name command - by [GF]sIdEkIcK - 12.07.2009, 14:24
Re: help for /name command - by Rks25 - 12.07.2009, 14:25
Re: help for /name command - by BLACK-RIDER-1692 - 12.07.2009, 14:29
Re: help for /name command - by Gergo1352 - 12.07.2009, 14:32

Forum Jump:


Users browsing this thread: 1 Guest(s)