Helpme! I Cant Make Me Admin In Gamemode Virtual Gaming RP
#1

Hi All , I Have a Question , How To Make us Admin In the virtual gaming roleplay ,
I'm Trying To Perform Step Scriptfiles > user , and I set the admin level to 1338 And I Log Into Server , After I Log Into server , Suddenly " Server Has Closed The Connection " I'm Taking the Next Step, is / rcon login , after I Login RCON , I Typing the command / setadmin , Suddenly Appears word " You Not Authorized To Use This command ' , Can You Help Me To Solve This problem ?? If You Know How To Be a Admin Reply This Post . [Sorry For My Bad English]
Reply
#2

Show us your setadmin command code, or maybe if you don't want, try adding this to your setadmin command

Код:
CMD:setadmin(playerid, params[])
{
	if (! IsPlayerAdmin(playerid))
	{
	    return SendClientMessage(playerid, COLOR_RED, "You are not RCON Administrator");
	}

//Setadmin Command Here

	return 1;
}
Then log into rcon administrator, the type /setadmin and make yourself admin

Best of Luck.
Reply
#3

This IS The Code Of Game Mode Virtual Gaming RP
Код:
CMD:setadmin(playerid, params[])
{
	if(PlayerInfo[playerid][pAdmin] >= 6)
	{
		new
			iAdminValue,
			iTargetID;

		if(sscanf(params, "ui", iTargetID, iAdminValue))
		{
			SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setadmin [playerid/partofname] [level]");//Devian_
		}
		else if(IsPlayerConnected(iTargetID))
		{
			if(AdminDuty[iTargetID] != 0)
			{
		    	SendClientMessage(playerid, COLOR_WHITE, "That admin is currently on-duty. They must go off-duty in order for you to set their admin level.");
		    	return 1;
			}
			new szMessage[47 + (MAX_PLAYER_NAME * 2)];

			format(szMessage, sizeof(szMessage), "AdmCmd: %s has set %s to Level %d Admin.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID), iAdminValue);
			ABroadCast(COLOR_LIGHTRED,szMessage, 1);
			PlayerInfo[iTargetID][pAdmin] = iAdminValue;
			format(szMessage, sizeof(szMessage), "You have been set to Level %d Admin by %s.", iAdminValue, GetPlayerNameEx(playerid));
			SendClientMessage(iTargetID, COLOR_LIGHTBLUE, szMessage);

			if(PlayerInfo[iTargetID][pHelper] >= 1) {
			    PlayerInfo[iTargetID][pHelper] = 0;
			    PlayerInfo[iTargetID][pAcceptReport] = 0;
			}

			if(iAdminValue == 0)
			{
                format(PlayerInfo[iTargetID][pAdminName], MAX_PLAYER_NAME, "0");
			}
		}
		else SendClientMessage(playerid, COLOR_GRAD2, "Invalid player specified.");
	}
	else SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
	return 1;
}
Reply
#4

Just copy and paste the code which Twiix sent you above your /setadmin code, like this
Код:
CMD:setadmin(playerid, params[])
{

    if (! IsPlayerAdmin(playerid))
	{
	    return SendClientMessage(playerid, COLOR_RED, "You are not RCON Administrator");
	}
	if(PlayerInfo[playerid][pAdmin] >= 6)
	{
		new
			iAdminValue,
			iTargetID;

		if(sscanf(params, "ui", iTargetID, iAdminValue))
		{
			SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setadmin [playerid/partofname] [level]");//Devian_
		}
		else if(IsPlayerConnected(iTargetID))
		{
			if(AdminDuty[iTargetID] != 0)
			{
		    	SendClientMessage(playerid, COLOR_WHITE, "That admin is currently on-duty. They must go off-duty in order for you to set their admin level.");
		    	return 1;
			}
			new szMessage[47 + (MAX_PLAYER_NAME * 2)];

			format(szMessage, sizeof(szMessage), "AdmCmd: %s has set %s to Level %d Admin.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID), iAdminValue);
			ABroadCast(COLOR_LIGHTRED,szMessage, 1);
			PlayerInfo[iTargetID][pAdmin] = iAdminValue;
			format(szMessage, sizeof(szMessage), "You have been set to Level %d Admin by %s.", iAdminValue, GetPlayerNameEx(playerid));
			SendClientMessage(iTargetID, COLOR_LIGHTBLUE, szMessage);

			if(PlayerInfo[iTargetID][pHelper] >= 1) {
			    PlayerInfo[iTargetID][pHelper] = 0;
			    PlayerInfo[iTargetID][pAcceptReport] = 0;
			}

			if(iAdminValue == 0)
			{
                format(PlayerInfo[iTargetID][pAdminName], MAX_PLAYER_NAME, "0");
			}
		}
		else SendClientMessage(playerid, COLOR_GRAD2, "Invalid player specified.");
	}
	else SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
	return 1;
}
Reply
#5

the result is still the same
Reply
#6

Код:
CMD:setadmin(playerid, params[])
{
	if(IsPlayerAdmin(playerid) || PlayerInfo[playerid][pAdmin] >= 6)
	{
		new
			iAdminValue,
			iTargetID;

		if(sscanf(params, "ui", iTargetID, iAdminValue))
		{
			SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setadmin [playerid/partofname] [level]");//Devian_
		}
		else if(IsPlayerConnected(iTargetID))
		{
			if(AdminDuty[iTargetID] != 0)
			{
		    	SendClientMessage(playerid, COLOR_WHITE, "That admin is currently on-duty. They must go off-duty in order for you to set their admin level.");
		    	return 1;
			}
			new szMessage[47 + (MAX_PLAYER_NAME * 2)];

			format(szMessage, sizeof(szMessage), "AdmCmd: %s has set %s to Level %d Admin.", GetPlayerNameEx(playerid), GetPlayerNameEx(iTargetID), iAdminValue);
			ABroadCast(COLOR_LIGHTRED,szMessage, 1);
			PlayerInfo[iTargetID][pAdmin] = iAdminValue;
			format(szMessage, sizeof(szMessage), "You have been set to Level %d Admin by %s.", iAdminValue, GetPlayerNameEx(playerid));
			SendClientMessage(iTargetID, COLOR_LIGHTBLUE, szMessage);

			if(PlayerInfo[iTargetID][pHelper] >= 1) {
			    PlayerInfo[iTargetID][pHelper] = 0;
			    PlayerInfo[iTargetID][pAcceptReport] = 0;
			}

			if(iAdminValue == 0)
			{
                format(PlayerInfo[iTargetID][pAdminName], MAX_PLAYER_NAME, "0");
			}
		}
		else SendClientMessage(playerid, COLOR_GRAD2, "Invalid player specified.");
	}
	else SendClientMessage(playerid, COLOR_GRAD1, "You're not authorized to use that command!");
	return 1;
}
Reply
#7

I am sorry , I Forgot Restarting Samp-server.exe
Thank You Help Me This Is Work, +Rep For U All
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)