SA-MP Forums Archive
help plox - 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: help plox (/showthread.php?tid=112494)



help plox - sggassasin - 08.12.2009

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


Re: help plox - Sew_Sumi - 08.12.2009

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...)


Re: help plox - sggassasin - 08.12.2009

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


Re: help plox - Sew_Sumi - 08.12.2009

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.


Re: help plox - sggassasin - 08.12.2009

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



Re: help plox - Sew_Sumi - 08.12.2009

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.


Re: help plox - sggassasin - 08.12.2009

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