Make a commands exclusively for a specific Player - Help Me!
#1

Hello,

I have created a lot of garages, but i dont know how to make a Cmd to work only for a specific player and a greater Admin. If you people know anyway to make a specific Commands work for a specific player, Please Help Me!.
Eg:- When the player name is 'Ramshid'. And when types /opengate, the Gate opens, but never opens when others type it...


Any Idea about it... Please Give me.......


Thank You!
Reply
#2

pawn Код:
new name[MAX_PLAYER_NAME];
GetPlayerName(playerid, name, MAX_PLAYER_NAME);
if(!strcmp(name, "Ramshid"))
{
   //open gate
}
else SendClientMessage(playerid, 0xFFFFFFAA, "You're not Ramshid! Don't touch the gate!);
Reply
#3

Thanks for your help, but where i should put the cmd?
i mean the /gateopen cmd please include it and show me

Thank You very much!
Reply
#4

Quote:
Originally Posted by ramshidjafar
Thanks for your help, but where i should put the cmd?
i mean the /gateopen cmd please include it and show me

Thank You very much!
I thought that you already got a command.

Look for some tutorial and just insert the command they suggest in the script I posted and post if something goes wrong.
Reply
#5

Well i have made another teleport one, see below!
Код:
if(!strcmp(pname,"Ramshid_Jafar"))
{
	  SetPlayerPos(playerid, 2320.4258, 584.7402, 7.7802);
	  SetPlayerInterior(playerid, 0);
	  return 1;
}
else SendClientMessage(playerid, 0xFFFFFFAA, "You're not Ramshid_Jafar! Don't type Again!");
That got compiled well, but i need to add TELEPORT CMD in between Can u say that?

EDIT:

I got fixed it!
Код:
if(!strcmp(pname,"Ramshid_Jafar"))
{
	if(strcmp(cmd, "/info", true) == 0) {
	  SetPlayerPos(playerid, 2320.4258, 584.7402, 7.7802);
	  SetPlayerInterior(playerid, 0);
	  return 1;
	}
	}
else SendClientMessage(playerid, 0xFFFFFFAA, "You're not Ramshid_Jafar! Don't type Again!");
Reply
#6

Quote:
Originally Posted by ramshidjafar
I got fixed it!
Код:
if(!strcmp(pname,"Ramshid_Jafar"))
{
	if(strcmp(cmd, "/info", true) == 0) {
	  SetPlayerPos(playerid, 2320.4258, 584.7402, 7.7802);
	  SetPlayerInterior(playerid, 0);
	  return 1;
	}
}
else SendClientMessage(playerid, 0xFFFFFFAA, "You're not Ramshid_Jafar! Don't type Again!");
I'd suggest you making it like this..
pawn Код:
if(strcmp(cmd, "/info", true) == 0)
{
     if(!strcmp(pname,"Ramshid_Jafar")){
      SetPlayerPos(playerid, 2320.4258, 584.7402, 7.7802);
      SetPlayerInterior(playerid, 0);
      return 1;
    }
    else SendClientMessage(playerid, 0xFFFFFFAA, "You're not Ramshid_Jafar! Don't type Again!");
}
'else' will stop from working all commands below this one.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)