Help for 5 commands,please [+REP]
#1

These commands are designed for rcon admin. I would like to remove the rcon admin and remain only Level 4 Admin.

Код:
	if(strcmp(cmd, "/setkill", true) == 0) //Hm need me this commands if you can give me
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /setkill [Playerid/PartOfName] [kills]");
				return 1;
			}
			new playa;
			new kills1;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			kills1 = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] == 4)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
						PlayerInfo[playa][pKills] = kills1;
						SetPlayerScore(playa, PlayerInfo[playa][pKills]);
					}
				}
			}
		}
		return 1;
	}
Код:
	if(strcmp(cmd, "/givekill", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givekill [Playerid/PartOfName] [kills]");
				return 1;
			}
			new playa;
			new kills1;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			kills1 = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] == 4)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
						PlayerInfo[playa][pKills] += kills1;
						SetPlayerScore(playa, PlayerInfo[playa][pKills]);
					}
				}
			}
		}
		return 1;
	}
Код:
	if(strcmp(cmd, "/givekillall", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givekillall [kills]");
				return 1;
			}
			new kills1;
			tmp = strtok(cmdtext, idx);
			kills1 = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] == 4)
			{
	   			for(new i = 0; i < MAX_PLAYERS; i++)
				{
					if(IsPlayerConnected(i))
					{
						PlayerInfo[i][pKills] += kills1;
						SetPlayerScore(i, PlayerInfo[i][pKills]);
						return 1;
					}
				}
			}
		}
		return 1;
	}
Код:
	if(strcmp(cmd, "/givemoney", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "ИЗПОЛЗВАЙ: /givemoney [Playerid/PartOfName] [количество пари]");
				return 1;
			}
			new playa;
			new money;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			money = strval(tmp);
			if (PlayerInfo[playerid][pAdmin] >= 4)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
						GivePlayerCash(playa, money);
					}
				}
			}
		}
		return 1;
	}
Код:
	if(strcmp(cmd, "/setmoney", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "ИЗПОЛЗВАЙ: /setmoney [Playerid/PartOfName] [количество пари]");
				return 1;
			}
			new playa;
			new money;
			new plname[MAX_PLAYER_NAME];
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			money = strval(tmp);
			GetPlayerName(playa, plname, sizeof(plname));
			if (PlayerInfo[playerid][pAdmin] >= 4)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
						SetPlayerCash(playa, money);
						format(string, sizeof(string), "Ти добави %s's пари на $%d !", plname, money);
				        SendClientMessage(playerid, COLOR_GREY, string);
					}
				}
			}
		}
		return 1;
	}
Reply
#2

if (PlayerInfo[playerid][pAdmin] >= 4)

Seems like they are for Admin Level 4... Maybe this code will help with /givemoney

Код:
if(strcmp(cmd, "/givemoney", true) == 0)
	{
	    if(IsPlayerConnected(playerid))
	    {
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givemoney [playerid/PartOfName] [money]");
				return 1;
			}
			new playa;
			new money;
			playa = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_WHITE, "USAGE: /givemoney [playerid/PartOfName] [money]");
				return 1;
			}
			money = strvalEx(tmp);
			if(PlayerInfo[playerid][pAdmin] >= 4)
			{
			    if(IsPlayerConnected(playa))
			    {
			        if(playa != INVALID_PLAYER_ID)
			        {
			            GetPlayerName(playa, giveplayer, sizeof(giveplayer));
			            PlayerInfo[playa][pCash] = PlayerInfo[playa][pCash]+money;
						GivePlayerMoney(playa,money);
						format(string, sizeof(string), "   You have given %s $%d !", giveplayer,money);
						SendClientMessage(playerid, COLOR_GREY, string);
					}
				}
			}
			else
			{
				SendClientMessage(playerid, COLOR_GRAD1, "   You are not authorized to use that command !");
			}
		}
		return 1;
	}
Reply
#3

Don't work.Help please?
Reply
#4

HELP?
Reply
#5

how do we know what do you use as an admin system ?
find something like new pInfo[playerid][Admin] or PlayerInfo[playerid][Admin], etc...

EDIT : just saw that. they are for level 4 admins and above if(PlayerInfo[playerid][pAdmin] >= 4)
Reply
#6

if ur using ladmin pm me i can help
Reply
#7

I have my admin system, but are something like these commands tochno.Sled log in with rcon stava.Mozhe everything you do me the commands are the same, but have you made, not there.
Reply
#8

Please help
Reply
#9

Didn't get anything from that last message. If you use a translator at least make sure you don't have your foreign words still in them.

I am just going to take a guess here as I wasn't able to translate your message at all:
If the commands are still only for RCON admin, then there must be some statement surrounding your text. Look and see if there is a statement like if(IsPlayerAdmin(playerid)) surrounding your statements (or check elsewhere in your code).
Reply
#10

Explain the last. Can write commands that are level 4 Admin, but are not. Rights are level 4 Admin and allows me to use them. When you go in with rcon then let me. If anyone can help me fix it please write to me, and if you can please give me a ready-made commands otherwise.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)