admin help
#1

could someone help me coz i need a /makeadmin command and a / heal command


so evan if you do one i dont care i just need some help
Reply
#2

Quote:
Originally Posted by sggassasin
could someone help me coz i need a /makeadmin command and a / heal command


so evan if you do one i dont care i just need some help
Which adminmod do you run?
Here is the command without Adminmod (Just add If's.)

Код:
	if(strcmp(cmd, "/heal", true) == 0)
	{
	  if(IsPlayerConnected(playerid))
	  {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /heal [playerid/PartOfName]");
				return 1;
			}
			new playa;
			playa = ReturnUser(tmp);
			  if(IsPlayerConnected(playa))
			  {
			    if(playa != INVALID_PLAYER_ID)
			    {
			    
 						SetPlayerHealth(playa,100.0);
						format(string, sizeof(string), "You have been healed to 100 health.");
						SendClientMessage(playa, TEAM_GREEN_COLOR,string);
			    
				}
			}
		}
		return 1;
	}
Reply
#3

Go to script request thread.
Reply
#4

this is what i got for my admin thingy


if(PlayerInfo[playerid][pAdmin] <= 1)
{
Reply
#5

So add it.

And I'll say it again, go to script request thread.
Reply
#6

im not asking for a script im asking for help way difrent + othing gets done on that script
Reply
#7

Quote:
Originally Posted by sggassasin
im not asking for a script im asking for help way difrent + othing gets done on that script
You don't ask for help, you ask to make you this code. You haven't done any code you just want someone to make it for you => Script Request Thread.
Reply
#8

Quote:
Originally Posted by MenaceX^
Quote:
Originally Posted by sggassasin
im not asking for a script im asking for help way difrent + othing gets done on that script
You don't ask for help, you ask to make you this code. You haven't done any code you just want someone to make it for you => Script Request Thread.
ok now im just gonna not bother replying after this to you but i need some help coz i have this code but it dont work....



Код:
if(strcmp(cmdtext, "/makeadmin", true) == 0)
	{
    new string[128];
   new tmp[256];
    new player[MAX_PLAYER_NAME];
   new giveplayerid;
    if(PlayerInfo[playerid][pAdmin] <= 5)
    {
        tmp = strtok(cmdtext, idx);
        if(!strlen(tmp))
        {
            SendClientMessage(playerid, 0xFFFF00AA, "USAGE: /makeadmin [playerid] [level]");
            SendClientMessage(playerid, 0xFFFF00AA, "FUNCTION: Player will be an admin.");
            return 1;
        }
        giveplayerid = ReturnUser(tmp);
        tmp = strtok(cmdtext, idx);
        new level = strval(tmp);
        if(giveplayerid != INVALID_PLAYER_ID)
        {
            GetPlayerName(giveplayerid, giveplayer, sizeof(giveplayer));
            GetPlayerName(playerid, player, sizeof(player));
            PlayerInfo[playerid][pAdmin] = level;
            printf("Admin %s made %s a level %d admin.", player, giveplayer, level);
            format(string, sizeof(string), "You are now an administrator level %d thanks to %s.", level, player);
            SendClientMessage(giveplayerid, 0x00C2ECFF, string);
            format(string, sizeof(string), "You have given %s level %d admin.", giveplayer,PlayerInfo[giveplayerid][pAdmin]);
                SendClientMessage(playerid, 0x00C2ECFF, string);
        }
        else if(giveplayerid == INVALID_PLAYER_ID)
        {
            format(string, sizeof(string), "%i is not an active player.", giveplayerid);
            SendClientMessage(playerid, 0xE60000FF, string);
        }
    }
    else
    {
      SendClientMessage(playerid, 0xE60000FF, "You are not a lead admin!");
    }
return 1;
}
Reply
#9

pawn Код:
public OnPlayerCommandText(playerid, cmdtext[])
{
  dcmd(makeadmin, 9, cmdtext);
  return 0;
}

dcmd_makeadmin(playerid, params[])
{
  if(PlayerInfo[playerid][pAdmin] != 5) return SendClientMessage(playerid, color, "Sorry, You need to be a level 5 admin to use this command");

  new id, level;
  if(sscanf(params, "ui", id, level)) return SendClientMessage(playerid, color, "USAGE: /makeadmin [playerid] [level]");
  else if (id == INVALID_PLAYER_ID) return SendClientMessage(playerid, color, "Player not found");
  else if ((level < 1) || (level > 5)) return SendClientMessage(playerid, color, "The admin level can't be bigger then 5 and smaller then 1");
  else
  {  
    PlayerInfo[id][pAdmin] = level;
    SendClientMessage(playerid, color, "Player became admin");
  }
  return 1;
}
btw, this is why your code doesn't work
pawn Код:
PlayerInfo[playerid][pAdmin] = level;
should be
pawn Код:
PlayerInfo[giveplayerid][pAdmin] = level;
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)