/goto /enablegoto /disablegoto +REP
#2

pawn Код:
new DisableGoto[MAX_PLAYERS];//On top of script

CMD:disablegoto(playerid,params[])
{
    DisableGoto[playerid] = 1;
}

CMD:enablegoto(playerid,params[])
{
    DisableGoto[playerid] = 0;
}

CMD:goto(playerid,params[])
{
    if(IsPlayerAdmin(playerid))//Is Player Rcon Admin
    {
        new player1;
        if(sscanf(params, "u", player1)) return
        SendClientMessage(playerid, COLOR_WHITE, "Usage: /goto [PlayerID]") &&
        SendClientMessage(playerid, COLOR_ORANGE, "Function: Will teleport you to a specified player");
        if(IsPlayerConnected(player1) && player1 != INVALID_PLAYER_ID)
        {
                new TeleporterName[MAX_PLAYER_NAME], ToPlayer[MAX_PLAYER_NAME], string3[128], string4[128];
                new Float:tX, Float:tY, Float:tZ;
                if(DisableGoTo[player1] == 1) return SendClientMessage(playerid,-1,"This player has disabled goto");
                GetPlayerPos(player1, tX, tY, tZ);
                GetPlayerName(player1, ToPlayer, sizeof(ToPlayer));
                GetPlayerName(playerid, TeleporterName, sizeof(TeleporterName));
                SetPlayerInterior(playerid,GetPlayerInterior(player1));
                format(string3, sizeof(string3), "You have teleported to %s's position.", ToPlayer);
                format(string4, sizeof(string4), "An Admin has Teleported to your position.");
                SendClientMessage(playerid, -1, string3);
                SendClientMessage(player1, -1, string4);
                if (GetPlayerState(playerid) == PLAYER_STATE_DRIVER)
                {
                    new VehicleID = GetPlayerVehicleID(playerid);
                    SetVehiclePos(VehicleID, tX, tY+2, tZ);
                }
                else
                {
                    SetPlayerPos(playerid, tX, tY+2, tZ);
                }
                return 1;
        }
        else return 0;
    }else return 0;
}
Reply


Messages In This Thread
/goto /enablegoto /disablegoto +REP - by [SU]Spartan - 14.09.2014, 13:58
Re: /goto /enablegoto /disablegoto +REP - by IceBilizard - 14.09.2014, 14:31
Re: /goto /enablegoto /disablegoto +REP - by Gogeta101 - 14.09.2014, 14:35
Re: /goto /enablegoto /disablegoto +REP - by [SU]Spartan - 14.09.2014, 15:11
Re: /goto /enablegoto /disablegoto +REP - by Abagail - 14.09.2014, 15:16
Re: /goto /enablegoto /disablegoto +REP - by Affan - 14.09.2014, 15:18
Re: /goto /enablegoto /disablegoto +REP - by Ricagor - 14.09.2014, 15:23

Forum Jump:


Users browsing this thread: 1 Guest(s)