#5

pawn Код:
CMD:gotoid(playerid, params[])
{
    new giveplayerid;
    if(sscanf(params, "u", giveplayerid)) return SendClientMessageEx(playerid, COLOR_WHITE, "USAGE: /gotoid [playerid]");

    new Float:plocx,Float:plocy,Float:plocz;
    if (IsPlayerConnected(giveplayerid))
    {
        if(PlayerInfo[playerid][pAdminDuty] == 0) return SendClientMessage(playerid, -1, "You must be on Admin Duty to use this Command!");
        if (PlayerInfo[playerid][pAdmin] >= 2)
        {
            if(GetPlayerState(giveplayerid) == PLAYER_STATE_SPECTATING)
            {
                SendClientMessageEx(playerid, COLOR_GRAD2, "That player is spectating someone.");
                return 1;
            }
            if(GetPlayerState(playerid) == PLAYER_STATE_SPECTATING)
            {
                SendClientMessageEx(playerid, COLOR_GRAD2, "You can not do this while spectating.");
                return 1;
            }
            GetPlayerPos(giveplayerid, plocx, plocy, plocz);
            SetPlayerVirtualWorld(playerid, PlayerInfo[giveplayerid][pVW]);
            Streamer_UpdateEx(playerid, plocx, plocy, plocz);

            if (GetPlayerState(playerid) == 2)
            {
                new tmpcar = GetPlayerVehicleID(playerid);
                SetVehiclePos(tmpcar, plocx, plocy+4, plocz);
                TelePos[playerid][0] = 0.0;TelePos[playerid][1] = 0.0;
            }
            else
            {
                SetPlayerPos(playerid,plocx,plocy+2, plocz);
                SetPlayerInterior(playerid, GetPlayerInterior(giveplayerid));
                SetPlayerVirtualWorld(playerid, GetPlayerVirtualWorld(giveplayerid));
            }

            SendClientMessageEx(playerid, COLOR_GRAD1, "   You have been teleported!");
        }
        else
        {
            SendClientMessageEx(playerid, COLOR_GRAD1, "You are not authorized to use that command!");
        }

    }
    else SendClientMessageEx(playerid, COLOR_GRAD1, "Invalid player specified.");
    return 1;
}
EDIT: Lol, 4 replies xD
Reply


Messages In This Thread
help - by LemonPunch - 28.10.2013, 12:55
Re: help - by Konstantinos - 28.10.2013, 12:59
Re: help - by HardRock - 28.10.2013, 12:59
Re: help - by Dolby - 28.10.2013, 12:59
Re: help - by EiresJason - 28.10.2013, 13:00
Re: help - by LemonPunch - 28.10.2013, 13:32
Re: help - by Konstantinos - 28.10.2013, 13:34
Re: help - by LemonPunch - 28.10.2013, 13:36
Re: help - by -=Dar[K]Lord=- - 28.10.2013, 13:37

Forum Jump:


Users browsing this thread: 2 Guest(s)