/goto /enablegoto /disablegoto +REP
#6

pawn Код:
new status[MAX_PLAYERS]; // Change it if you want

// Put status[playerid] = 1 on gamemode


CMD:toggoto(playerd)
{
    if(status[playerid] == 1)
    {
        SendClientMessage(playerid, -1, "You have disabled goto");
        status[playerid] = 0;
    }
    else
    {
        SendClientMessage(playerid, -1, "You have enabled goto");
        status[playerid] = 1;
    }
    return 1;
}

CMD:goto(playerid, params[])
{
    new id, Float:X,Float:Y,Float:Z;
    if(sscanf(params, "u", id)) return SendClientMessage(playerid, -1, "USAGE: /goto <playerid/name>");
        if(id == INVALID_PLAYER_ID) return SendClientMessage(playerid, -1, "The player is offline");
    if(status[id] == 0) return SendClientMessage(playerid, -1, "The player has goto disabled!");
    new Interior = GetPlayerInterior(id);
    SetPlayerInterior(playerid,Interior);
    SetPlayerVirtualWorld(playerid,GetPlayerVirtualWorld(id));
    GetPlayerPos(id,X,Y,Z);
    if(IsPlayerInAnyVehicle(playerid))
    {
        SetVehiclePos(GetPlayerVehicleID(playerid), X+ 1, Y+ 1, Z);
        LinkVehicleToInterior(GetPlayerVehicleID(playerid),Interior);
    }
    else SetPlayerPos(playerid, X+ 1,Y+ 1, Z);
    return 1;
}
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)