Help With Script;
#1

Mind giving me a hand with this script? It works disabling nametags, but it says "unknown command" at the same time; and i can't enable them.

Help a brother out? <3

Код:
	if (strcmp("/togglename", cmdtext, true) == 0)
	{
		if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pTester] >= 1)
	{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
	ShowPlayerNameTagForPlayer(playerid, i, false);
	}
	SendClientMessage(playerid, COLOR_ORANGE, "You have disabled nametags.");
	}
z
	else if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pTester] >= 1)
	{
	for(new i = 0; i < MAX_PLAYERS; i++)
	{
	ShowPlayerNameTagForPlayer(playerid, i, true);
	}
	SendClientMessage(playerid, COLOR_ORANGE, "You have enabled nametags.");
	}
	else
	{
	SendClientMessage(playerid, COLOR_ORANGE, "You are not a staff member!");
	}
	return 0;
	}
[/cpode]
Reply
#2

pawn Код:
if (!strcmp(cmdtext, "/togglename", true))
{
    if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pTester] >= 1)
    {
        for(new i = 0; i < MAX_PLAYERS; i++)
        {
        ShowPlayerNameTagForPlayer(playerid, i, false);
        }
    SendClientMessage(playerid, COLOR_ORANGE, "You have disabled nametags.");
    }
      else if (PlayerInfo[playerid][pAdmin] >= 1 || PlayerInfo[playerid][pTester] >= 1)
      {
        for(new i = 0; i < MAX_PLAYERS; i++)
            {
            ShowPlayerNameTagForPlayer(playerid, i, true);
        }
        SendClientMessage(playerid, COLOR_ORANGE, "You have enabled nametags.");
      }
    else
        {
            SendClientMessage(playerid, COLOR_ORANGE, "You are not a staff member!");
        }
        return 1;
}
- or try changing the return in OnPlayerCommandText to 1? (if it's zero, that is.)
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)