Jump to content
  • 0

Problema mica , dar pentru mine mare


Mr.Big

Question

Salut , am si eu o problema. Am comanda /makeadmin , dar , as dori sa o fac doar pe numele meu , si as vrea sa stiu cum o pot face

Edit : am pus si scriptul /makeadmin , dar eu am bagat niste chestii care nu le poate baga oricine , sa nu le copieze lumea , asa ca lam scos

Link to comment
Share on other sites

8 answers to this question

Recommended Posts

if( !strcmp( cmdtext, "/makeadmin" ) )

{

if( !strcmp( pName( playerid ), "Your_Name" ) )

{

// Code Code...

}

return ( 1 );

}

pName Function:

stock pName( playerid )

{

new NAME[ MAX_PLAYER_NAME ];

GetPlayerName( playerid, NAME, sizeof NAME );

return ( NAME );

}

142sj0l.png

Underground-GFX

Link to comment
Share on other sites

Nu am reusit sa pun , ajutama te rog ... , uite comanda

if(strcmp(cmd, "/setadmin", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setadmin [playerid/PartOfName] [level(1-6)]");
				return 1;
			}
			new para1;
			new level;
			para1 = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			level = strval(tmp);
			if(PlayerInfo[playerid][pAdmin] >= 6)
			{
			    if(IsPlayerConnected(para1))
			    {
			        if(para1 != INVALID_PLAYER_ID)
			        {
						GetPlayerName(para1, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						PlayerInfo[para1][pAdmin] = level;
						format(string, sizeof(string), "   Ai fost promovat admin level %d de catre %s", level, sendername);
						SendClientMessage(para1, COLOR_LIGHTBLUE, string);
						format(string, sizeof(string), "   Ai promovat pe %s la admin %d .", giveplayer,level);
						SendClientMessage(playerid, COLOR_LIGHTBLUE, string);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   you are not authorized to use that command!");
			}
		}
		return 1;
	}

Link to comment
Share on other sites

if(strcmp(cmd, "/setadmin", true) == 0)

{

  tmp = strtok(cmdtext, idx);

  if(!strlen(tmp))

  {

      SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /setadmin [playerid/PartOfName] [level(1-6)]");

      return 0;

  }

  new para1;

  new level;

  para1 = ReturnUser(tmp);

  tmp = strtok(cmdtext, idx);

  level = strval(tmp);

  if( !strcmp( pName( playerid ), "Mr.Big" ) )

  {

      if(IsPlayerConnected(para1))

      {

        if(para1 != INVALID_PLAYER_ID)

        {

            GetPlayerName(para1, giveplayer, sizeof(giveplayer));

            GetPlayerName(playerid, sendername, sizeof(sendername));

            PlayerInfo[para1][pAdmin] = level;

            format(string, sizeof(string), "  Ai fost promovat admin level %d de catre %s", level, sendername);

            SendClientMessage(para1, COLOR_LIGHTBLUE, string);

            format(string, sizeof(string), "  Ai promovat pe %s la admin %d .", giveplayer,level);

            SendClientMessage(playerid, COLOR_LIGHTBLUE, string);

        }

      }

  }

  else

  {

      SendClientMessage(playerid, COLOR_GRAD1, "  you are not authorized to use that command!");

  }

  return 1;

}

142sj0l.png

Underground-GFX

Link to comment
Share on other sites

Am adaug stockul , am bagat pNameP , unde scria acolo pNameP (playerid) , dar , cand dau /setadmin , merge , dar zice unkown command , chiar daca pot da /setadmin .

Am intrat de pe alt nume , aveam admin 6 , dar nu puteam da admin. Dar cand dau /setadmin simplu zice unknown command . Dar pot da admin de pe numele meu.

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. For more details you can also review our Terms of Use and Privacy Policy.