[Help] /goto and /nogoto
#5

pawn Код:
new bool:Goto_Disabled[MAX_PLAYERS];

public OnPlayerDisconnect(playerid, reason)
{
    Goto_Disabled[playerid] = false;
    return 1;
}

CMD:goto(playerid, params[])
{
    if (sscanf(params, "u", id))
        return SendClientMessage(playerid, -1, "Usage: /goto [id/name]");
       
    if (!IsPlayerConnected(id))
        return SendClientMessage(playerid, -1, "Error: Player is not connected.");
       
    if (Goto_Disabled[playerid] == true)
        return SendClientMessage(playerid, -1, "Error: Player does not want anyone to teleport to him.");
       
    new Float:x, Float:y, Float:z;
    GetPlayerPos(id, x, y, z);
    SetPlayerInterior(playerid, GetPlayerInterior(id));
    SetPlayerPos(playerid, x, y, z);
    return 1;
}

CMD:nogoto(playerid, params[])
{
    if (Goto_Disabled[playerid] == false)
    {
        SendClientMessage(playerid, -1, "Players are now unable to teleport to you.");
        Goto_Disabled[playerid] = true;
    }
    else if (Goto_Disabled[playerid] == true)
    {
        SendClientMessage(playerid, -1, "Players are now able to teleport to you.");
        Goto_Disabled[playerid] = false;
    }
    return 1;
}
Reply


Messages In This Thread
[Help] /goto and /nogoto - by goldenpower - 04.08.2014, 06:31
Re: [Help] /goto and /nogoto - by GShock - 04.08.2014, 06:36
Re: [Help] /goto and /nogoto - by Stinged - 04.08.2014, 08:23
Re: [Help] /goto and /nogoto - by goldenpower - 04.08.2014, 09:06
Re: [Help] /goto and /nogoto - by Stinged - 04.08.2014, 10:29
Re: [Help] /goto and /nogoto - by SpikY_ - 04.08.2014, 11:31
Re: [Help] /goto and /nogoto - by goldenpower - 04.08.2014, 12:51
Re: [Help] /goto and /nogoto - by SpikY_ - 04.08.2014, 12:58
Re: [Help] /goto and /nogoto - by Stinged - 04.08.2014, 13:29
Re: [Help] /goto and /nogoto - by goldenpower - 04.08.2014, 14:02

Forum Jump:


Users browsing this thread: 1 Guest(s)