Cant Make A Only Admin Command
#1

i have a little question
i cant make a only admin command
I have MADE this:
PAWN Code:
pawn Код:
if (strcmp(cmdtext, "/ap2", true)==0)
    {
    if(DMArena[playerid] == 1) return SendClientMessage(playerid, RED, "You are not allowed to teleport while DeathMatching!");
        new cartype = GetPlayerVehicleID(playerid);
        new State=GetPlayerState(playerid);
        SetPlayerInterior(playerid,0);
        IsPlayerAdmin(playerid);
        format(string, sizeof(string), "%s warped to Los Santos' Airport ! ( /ap2 )", player);
        SendClientMessageToAll(YELLOW, string);
    GameTextForPlayer(playerid, "~y~Welcome to the 2nd Airport !", 3000,6);
        if(State!=PLAYER_STATE_DRIVER)
        {SetPlayerPos(playerid,1398.4218,-2420.0742,13.2148);SetPlayerFacingAngle(playerid,263);}
        else if(IsPlayerInVehicle(playerid, cartype) == 1)
        {SetVehiclePos(cartype,1398.4218,-2420.0742,13.2148);
        SetVehicleZAngle(cartype,78.1831);}
        else
        {SetPlayerPos(playerid,1398.4218,-2420.0742,13.2148);SetPlayerFacingAngle(playerid,263);}
        return 1;}

can any one help me?
Reply
#2

Here, this will work for only RCON administrators:

Код:
if (strcmp(cmdtext, "/ap2", true)==0)
{
    if(DMArena[playerid] == 1)
			return SendClientMessage(playerid, RED, "You are not allowed to teleport while DeathMatching!");
		if(!IsPlayerAdmin(playerid))
			return SendClientMessage(playerid, RED, "You are not an admin!");
		
		new cartype = GetPlayerVehicleID(playerid);
		new State=GetPlayerState(playerid);
		SetPlayerInterior(playerid,0);
		IsPlayerAdmin(playerid);
		
		format(string, sizeof(string), "%s warped to Los Santos' Airport ! ( /ap2 )", player);
		SendClientMessageToAll(YELLOW, string);
    GameTextForPlayer(playerid, "~y~Welcome to the 2nd Airport !", 3000,6);
		
		if(State!=PLAYER_STATE_DRIVER)
 		{
			SetPlayerPos(playerid,1398.4218,-2420.0742,13.2148);
			SetPlayerFacingAngle(playerid,263);
		}
		else if(IsPlayerInVehicle(playerid, cartype) == 1)
		{
			SetVehiclePos(cartype,1398.4218,-2420.0742,13.2148);
			SetVehicleZAngle(cartype,78.1831);
		}
		else
		{
			SetPlayerPos(playerid,1398.4218,-2420.0742,13.2148);SetPlayerFacingAngle(playerid,263);
		}
		return 1;
}
Reply
#3

Quote:
Originally Posted by Ettans
Here, this will work for only RCON administrators:

Код:
if (strcmp(cmdtext, "/ap2", true)==0)
{
    if(DMArena[playerid] == 1)
			return SendClientMessage(playerid, RED, "You are not allowed to teleport while DeathMatching!");
		if(!IsPlayerAdmin(playerid))
			return SendClientMessage(playerid, RED, "You are not an admin!");
		
		new cartype = GetPlayerVehicleID(playerid);
		new State=GetPlayerState(playerid);
		SetPlayerInterior(playerid,0);
		IsPlayerAdmin(playerid);
		
		format(string, sizeof(string), "%s warped to Los Santos' Airport ! ( /ap2 )", player);
		SendClientMessageToAll(YELLOW, string);
    GameTextForPlayer(playerid, "~y~Welcome to the 2nd Airport !", 3000,6);
		
		if(State!=PLAYER_STATE_DRIVER)
 		{
			SetPlayerPos(playerid,1398.4218,-2420.0742,13.2148);
			SetPlayerFacingAngle(playerid,263);
		}
		else if(IsPlayerInVehicle(playerid, cartype) == 1)
		{
			SetVehiclePos(cartype,1398.4218,-2420.0742,13.2148);
			SetVehicleZAngle(cartype,78.1831);
		}
		else
		{
			SetPlayerPos(playerid,1398.4218,-2420.0742,13.2148);SetPlayerFacingAngle(playerid,263);
		}
		return 1;
}
yeah thanks it works! ty Ettans
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)