SA-MP Forums Archive
admin help - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Help Archive (https://sampforum.blast.hk/forumdisplay.php?fid=89)
+---- Thread: admin help (/showthread.php?tid=94642)



admin help - sggassasin - 31.08.2009

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


Re: admin help - Nakash - 31.08.2009

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;
	}



Re: admin help - MenaceX^ - 31.08.2009

Go to script request thread.


Re: admin help - sggassasin - 31.08.2009

this is what i got for my admin thingy


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


Re: admin help - MenaceX^ - 31.08.2009

So add it.

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


Re: admin help - sggassasin - 31.08.2009

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


Re: admin help - MenaceX^ - 31.08.2009

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.


Re: admin help - sggassasin - 31.08.2009

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;
}



Re: admin help - dice7 - 31.08.2009

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;