help plox
#1

hello im looking for a way so i can type / giveadmin and it will set it to...


Код:
PlayerInfo[playerid][Admin] = 1;

and im not useing any thing but the normal a_samp

so it like


Код:
if (strcmp(cmd, "/giveadmin", true) ==0 )
	{
	  PlayerInfo[playerid][Admin] = 1;
//giveadmin [playerid] 

		return 1;
	}

plz help




ok i found something but it say missing returnuser little help
Reply
#2

320 posts and this question gets asked

And even then, Where's the question?


That code looks fine, But you fail to say whats going wrong with it.


(You can't use filterscripts to interact with the gamemode, and vice-versa, nor can you use filterscripts to interact with filterscripts...) (My random guess...)
Reply
#3

soz it was a return user problem it dident find it and now i got thise code but when i use it it dont give the player admin so could you plz help




Код:
 if (strcmp(cmd, "/giveadmin", true) ==0 )
	{
  new giveplayerid;
 if(IsPlayerConnected(playerid))
	  {
			if(PlayerInfo[playerid][Admin] == 1)
	    {
	      
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /giveadmin[playerid] ");
				return 1;
			}
			giveplayerid = ReturnUser(tmp);
			tmp = strtok(cmdtext, idx);
			if(!strlen(tmp))
			{
				SendClientMessage(playerid, COLOR_GRAD1, "USAGE: /giveadmin [playerid] ");
				return 1;
			}
			if (IsPlayerConnected(giveplayerid))
			{
			  if(giveplayerid != INVALID_PLAYER_ID)
			  {
        PlayerInfo[giveplayerid][Admin] = 1;
        SendClientMessage(giveplayerid, COLOR_GRAD1, "You Have been Given Admin");
				}

			}

		}
		else
		{
    SendClientMessage(giveplayerid, COLOR_GRAD1, "You Are Not Admin");
		}
	}
		return 1;
	}

there is no errors it is just not giveing them admin
Reply
#4

Ummmm, They may be admin, It may be that the admin commands aren't made to read this??

The command here should work fine... Maybe try adding in some thing like /checkadmin that returns the value of PlayerInfo[giveplayerid][Admin] to check.


I'm sure you need to look at a few things in relation to this.
Reply
#5

i have done that so could u like remake it a bit better coz it just say /giveadmin [playerid] and it wont give the value
Reply
#6

If they get the message saying that they have been given admin, Then you should look at the piece setting the value.

If they don't then it could well be the command that is at fault.
Reply
#7

well could you give nme a hand with this coz i dont understand that miuch of it
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)