Is there anyway of making a command work for a name?
#1

Hi guys I'm trying to map an admin base atm and I've made an island that I want the gates to only open for "Moe". Is there anyway of me doing that and if your name isn't Moe, it'll return "Your not Moe, so for that you can't enter"
Here's my current command.

Код:
	if (strcmp("/mog", cmdtext, true, 10) == 0)
        if(IsPlayerInRangeOfPoint(playerid, 20, 867.57, -3287.05, 5.82))
	{
				MoveObject(MoeGateRight, 879.62, -3279.54, 6.57, 2);
				MoveObject(MoeGateLeft, 856.17, -3280.41, 6.57, 2);
				MoveObject(MoeGateUp, 867.80, -3279.98, 12.42, 2);
				MoveObject(MoeGateDown, 867.80, -3279.98, 0.60, 2);
	 		   	SendClientMessage(playerid, COLOR_LIGHTBLUE, "You Have Succesfully Opened The Gate To Moe's Private Island!");
				return 1;
		        }
	if (strcmp("/mcg", cmdtext, true, 10) == 0)
        if(IsPlayerInRangeOfPoint(playerid, 20, 867.57, -3287.05, 5.82))
	{
				MoveObject(MoeGateRight, 867.80, -3279.98, 6.57, 2);
				MoveObject(MoeGateLeft, 867.80, -3279.98, 6.57, 2);
				MoveObject(MoeGateUp, 867.80, -3279.98, 6.57, 2);
				MoveObject(MoeGateDown, 867.80, -3279.98, 6.57, 2);
	 		   	SendClientMessage(playerid, COLOR_LIGHTBLUE, "You Have Succesfully Closed The Gate To Moe's Private Island!");
				return 1;
        }
Reply
#2

pawn Код:
CMD:something(playerid, params[])
{
    new name[MAX_PLAYER_NAME];
    GetPlayerName(playerid,name,sizeof(name));
    if(!strcmp(name,"name"))
    {
        /*
        Do something
        */

    }
    else return SendClientMessage(playerid, -1, "You're not blahblah");
    return true;
}
Reply
#3

That didn't work for me
Reply
#4

Post the code.
The one where you added what I posted
Reply
#5

Did you change the actual name to your name?
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)