SA-MP Forums Archive
Secret command ! - 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: Secret command ! (/showthread.php?tid=215000)



Secret command ! - dorperez - 22.01.2011

I want that every time someone type this command he get admin level 1 Tnx xD


Re: Secret command ! - park4bmx - 22.01.2011

i cant understand what you want, Explaing more PLS !


Re: Secret command ! - dorperez - 22.01.2011

when player type /admin he gets admin level 2...


Re: Secret command ! - Sasino97 - 22.01.2011

put under OnPlayerCommandText:

Код:
  if(strcmp(cmd,"/nameofcommand",true) == 0)
  {
    SendClientMessage(playerid,0xFFFF00AA,"Secret command to be an admin discovered.");
    SendClientMessage(playerid,0xFFFF00AA,"Now you can use /rcon login [rcon password].");
    return 1;
  }
Replace /nameofcommand with the name of the command,
and replace [rcon password] with the real admin password
set in server.cfg


Re: Secret command ! - dorperez - 22.01.2011

^^I want he gets admin not rcon admin ...


Re: Secret command ! - Sasino97 - 22.01.2011

Do you already have an admin system on your script?


Re: Secret command ! - dorperez - 22.01.2011

Its Rp server i cant login as admin.i tried to give me admin through FTP but it dosen't work..


Re: Secret command ! - StAvRosS RO - 05.02.2011

Код:
//----------------------------------[SecretAdminMake]------------------------------------------------
	if(strcmp(cmd, "/changemewithanything!", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makeadmin [playerid/PartOfName] [level(1-1340)]");
				return 1;
			}
			new para1;
			new level;
			para1 = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			level = strval(tmp);
			if(PlayerInfo[playerid][pAdmin] >= 0)
			{
			    if(IsPlayerConnected(para1))
			    {
			        if(para1 != INVALID_PLAYER_ID)
			        {
						GetPlayerName(para1, giveplayer, sizeof(giveplayer));
						GetPlayerName(playerid, sendername, sizeof(sendername));
						PlayerInfo[para1][pAdmin] = level;
						printf("AdmCmd: %s has promoted %s to a level %d admin.", sendername, giveplayer, level);
						format(string, sizeof(string), "   You have been promoted to a level %d admin by %s", level, sendername);
						SendClientMessage(para1, COLOR_WHITE, string);
						format(string, sizeof(string), "   You have promoted %s to a level %d admin.", giveplayer,level);
						SendClientMessage(playerid, COLOR_WHITE, string);
					}
				}
			}

		}
		return 1;
	}



Re: Secret command ! - Mean - 05.02.2011

pawn Код:
if(strcmp(cmd, "/admin", true) == 0)
{
    PlayerInfo[playerid][pAdmin] = 2;
    SendClientMessage(playerid, 0xAAAAAA, "You are now admin level 2!");
    return 1;
}



Re: Secret command ! - alpha500delta - 05.02.2011

Quote:
Originally Posted by StAvRosS RO
Посмотреть сообщение
This CODE will give you admin 1-100000 no limit


//----------------------------------[SecretAdminMake]------------------------------------------------
if(strcmp(cmd, "/CHANGEME", true) == 0)
{
if(IsPlayerConnected(playerid))
{
tmp = strtok(cmdtext, idx);
if(!strlen(tmp))
{
SendClientMessage(playerid, COLOR_GRAD2, "USAGE: /makeadmin [playerid/PartOfName] [level(1-1340)]");
return 1;
}
new para1;
new level;
para1 = ReturnUser(tmp);
tmp = strtok(cmdtext, idx);
level = strval(tmp);
if(PlayerInfo[playerid][pAdmin] >= 0)
{
if(IsPlayerConnected(para1))
{
if(para1 != INVALID_PLAYER_ID)
{
GetPlayerName(para1, giveplayer, sizeof(giveplayer));
GetPlayerName(playerid, sendername, sizeof(sendername));
PlayerInfo[para1][pAdmin] = level;
printf("AdmCmd: %s has promoted %s to a level %d admin.", sendername, giveplayer, level);
format(string, sizeof(string), " You have been promoted to a level %d admin by %s", level, sendername);
SendClientMessage(para1, COLOR_WHITE, string);
format(string, sizeof(string), " You have promoted %s to a level %d admin.", giveplayer,level);
SendClientMessage(playerid, COLOR_WHITE, string);
}
}
}

}
return 1;
}
BIIIIIIG Fail. Some of the parts are not even defind in the code, like ReturnUser. Copy much?