Help with command
#1

Hello i have one command wich is /isadmin. Her function is to show what level of admin is the player. But the problem it's always show me 7 level..

Код:
	if(strcmp(cmd,"/isadmin",true)==0)
	{
		new adminstring[256];
		if(IsPlayerConnected(playerid))
		{
			if(PlayerInfo[playerid][pAdmin] >= 1)
			{
				tmp = strtok(cmdtext, idx);
				if(!strlen(tmp))
				{
					SendClientMessage(playerid, COLOR_GRAD2, "ИЗПОЛЗВАЙ: /isadmin [ номер на играча ]");
					return 1;
				}
				giveplayerid = ReturnUser(tmp);
				new admin = PlayerInfo[playerid][pAdmin];
				format(adminstring, sizeof(adminstring), "Играчът е %d ниво администратор!",admin);
				SendClientMessage(playerid, COLOR_RED,adminstring);
			}
		}
		return 1;
	}
Reply
#2

I'm guessing this:
pawn Код:
new admin = PlayerInfo[playerid][pAdmin];
Should be 'giveplayerid', and not 'playerid'?

Also, check if giveplayerid is valid before using it in an array...
Reply
#3

Thank u!
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)