SA-MP Forums Archive
Name Permissions - 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: Name Permissions (/showthread.php?tid=651312)



Name Permissions - OmerKhan - 18.03.2018

How can i create special permissions for a particular name ? For e.g

This msg is shown only if a player named "Omer" logs into the server:


>> Server Owner Omer has logged in.

If anyone can help me with this name login example, that would be appreciated.


Re: Name Permissions - BulletRaja - 18.03.2018

PHP код:
//onplayerconnect 
new playeridname[MAX_PLAYER_NAME];
   
GetPlayerName(playeridplayeridnamesizeof(playeridname));
if(
strfind(playeridname,"Omer",false) != 0)
{
 
SendClientMessageToAll(COLOR_YOUWANT,"Server Owner Omer has joined the server");




Re: Name Permissions - OmerKhan - 18.03.2018

Код:
SendClientMessage(playerid, COLOR_YELLOW, "SERVER: You have successfully logged in to the server.");
		new playeridname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, playeridname, sizeof(playeridname));
        if(strfind(playeridname,"Omer",false) != 0) return
        format(string, sizeof(string), ">> Omer has logged in.");
	    SendClientMessageToAll(COLOR_ORANGE, string);
The msg dosen't appears!


Re: Name Permissions - BulletRaja - 18.03.2018

Quote:
Originally Posted by OmerKhan
Посмотреть сообщение
Код:
SendClientMessage(playerid, COLOR_YELLOW, "SERVER: You have successfully logged in to the server.");
		new playeridname[MAX_PLAYER_NAME];
        GetPlayerName(playerid, playeridname, sizeof(playeridname));
        if(strfind(playeridname,"Omer",false) != 0) return
        format(string, sizeof(string), ">> Omer has logged in.");
	    SendClientMessageToAll(COLOR_ORANGE, string);
The msg dosen't appears!
PHP код:
new playeridname[MAX_PLAYER_NAME];
GetPlayerName(playeridplayeridnamesizeof(playeridname));
if(
strfind(playeridname,"Omer",false) != 0)  SendClientMessageToAll(COLOR_ORANGE">> Omer has logged in."); 



Re: Name Permissions - OmerKhan - 18.03.2018

Isn't working!


Re: Name Permissions - BulletRaja - 18.03.2018

PHP код:
new playeridname[MAX_PLAYER_NAME]; 
GetPlayerName(playeridplayeridnamesizeof(playeridname)); 
if (
strfind(playeridname"Omer"true) != -1){
  
SendClientMessageToAll(COLOR_ORANGE">> Omer has logged in."); 




Re: Name Permissions - Zeus666 - 18.03.2018

Give us your on player connect line


Re: Name Permissions - OmerKhan - 18.03.2018

Working fine sir
Код:
CMD:stats(playerid, params[])
{
	LoginCheck(playerid);
	new target;
	new id;
	if(sscanf(params, "u", target))
	{
  		target = playerid;
		SendClientMessage(playerid, COLOR_RED, "TIP: {FFFFFF}You can also view other players stats by /stats [player id]");
	}

	if(! IsPlayerConnected(target)) return SendClientMessage(playerid, COLOR_RED, "ERROR: The specified player is not conected.");


		if(User[playerid][accountAdmin] < User[id][accountAdmin])
		return SendClientMessage(playerid, COLOR_RED, "* You cannot use this command on higher admin.");

		ShowStatistics(playerid);
	return 1;
}
If i do /stats [ANY OTHER ID, NOT MINE], then it will show my stats


Re: Name Permissions - BulletRaja - 18.03.2018

make it
Код:
ShowStatistics(playerid); to ShowStatistics(target);